﻿  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    color: #1c1e21;
    min-height: 100vh;
  }

  /* ---- HEADER ---- */
  .page-header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .meta-logo {
    height: 36px;
    width: auto;
  }
  .page-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1c1e21;
  }

  /* ---- MAIN LAYOUT ---- */
  .page-body {
    max-width: 860px;
    margin: 36px auto;
    padding: 0 20px 60px;
  }

  .section-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #65676b;
    margin-bottom: 16px;
  }

  /* ---- PERSONAL INFO ---- */
  .card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 24px;
    margin-bottom: 24px;
  }

  .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }
  .field-row.single { grid-template-columns: 1fr; }
  .field-group { display: flex; flex-direction: column; gap: 6px; }

  label {
    font-size: 13px;
    font-weight: 500;
    color: #444;
  }
  label .req { color: #e02828; margin-left: 2px; }

  input[type="text"], input[type="tel"], input[type="email"] {
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    color: #1c1e21;
    background: #fff;
    transition: border-color .15s;
    width: 100%;
  }
  input:focus { outline: none; border-color: #1877f2; box-shadow: 0 0 0 3px rgba(24,119,242,.12); }
  input.invalid { border-color: #e02828; }

  .address-sub { font-size: 11px; color: #888; margin-top: 3px; }

  /* ---- GIFT PICKER ---- */
  .gift-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    margin-bottom: 14px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, background .15s;
    align-items: flex-start;
  }
  .gift-card:hover { border-color: #aaa; }
  .gift-card.selected { border: 2px solid #1877f2; background: #f0f6ff; }
  .gift-card.sold-out {
    opacity: 0.55;
    cursor: not-allowed;
    background: #fafafa;
  }
  .gift-card.sold-out:hover { border-color: #ddd; }
  .gift-card.sold-out .gift-radio { visibility: hidden; }
  .sold-out-badge {
    display: inline-block;
    font-size: 11px; font-weight: 600;
    padding: 2px 9px; margin-left: 10px;
    border-radius: 999px; vertical-align: middle;
    background: #fde7e9; color: #b3261e;
    border: 1px solid #f5c6cb;
    text-transform: uppercase; letter-spacing: 0.03em;
  }

  .gift-radio {
    width: 20px; min-width: 20px; height: 20px;
    border-radius: 50%;
    border: 1.5px solid #bbb;
    display: flex; align-items: center; justify-content: center;
    margin-top: 3px; flex-shrink: 0;
  }
  .gift-card.selected .gift-radio { background: #1877f2; border-color: #1877f2; }
  .gift-radio-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #fff; display: none;
  }
  .gift-card.selected .gift-radio-dot { display: block; }

  .gift-img {
    width: 195px; min-width: 195px; height: 195px;
    border-radius: 8px; object-fit: cover;
    background: #f0f0f0; flex-shrink: 0;
  }

  .gift-body { flex: 1; min-width: 0; }
  .gift-name { font-size: 15px; font-weight: 600; margin-bottom: 7px; color: #1c1e21; }
  .gift-desc { font-size: 13px; color: #555; line-height: 1.65; margin-bottom: 10px; }

  /* ---- SIZE SECTIONS ---- */
  .size-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
  }
  .size-group-label {
    font-size: 12px; font-weight: 600; color: #444; margin-bottom: 7px;
  }
  .size-grid { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
  .size-btn {
    font-size: 12px; font-family: inherit;
    padding: 4px 12px; border-radius: 6px;
    border: 1px solid #ccc; background: #fff;
    cursor: pointer; color: #333;
    transition: background .1s, border-color .1s, color .1s;
  }
  .size-btn:hover { border-color: #1877f2; color: #1877f2; }
  .size-btn.active { background: #1877f2; border-color: #1877f2; color: #fff; }

  /* ---- SIZE CHART ---- */
  .chart-toggle {
    font-size: 12px; color: #1877f2; cursor: pointer;
    background: none; border: none; padding: 0;
    text-decoration: underline; margin-top: 4px; display: inline-block;
  }
  .size-chart-wrap {
    display: none;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow-x: auto;
  }
  .size-chart-wrap.open { display: block; }
  .size-chart {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
  .size-chart th, .size-chart td {
    padding: 7px 10px;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
    white-space: nowrap;
  }
  .size-chart th { background: #f7f7f7; font-weight: 600; color: #444; }
  .size-chart tr:last-child td { border-bottom: none; }
  .size-chart td:first-child { text-align: left; font-weight: 500; color: #333; }

  .one-size-badge {
    display: inline-block;
    font-size: 11px; padding: 3px 10px;
    border-radius: 999px;
    background: #f0f0f0; color: #666;
    border: 1px solid #ddd; margin-top: 8px;
  }

  /* ---- ERRORS ---- */
  .field-error { font-size: 12px; color: #e02828; margin-top: 4px; display: none; }
  .field-error.show { display: block; }
  .form-error-banner {
    background: #fff3f3; border: 1px solid #f5a5a5;
    color: #c0392b; border-radius: 8px;
    padding: 12px 16px; font-size: 13px;
    margin-bottom: 20px; display: none;
  }
  .form-error-banner.show { display: block; }

  /* ---- SUBMIT ---- */
  .submit-btn {
    display: block; width: 100%;
    height: 46px; border-radius: 8px;
    background: #1877f2; color: #fff;
    font-size: 15px; font-weight: 600;
    border: none; cursor: pointer;
    transition: background .15s;
    margin-top: 8px;
  }
  .submit-btn:hover { background: #166fe5; }
  .submit-btn:active { background: #1464d4; }

  /* ---- SUCCESS ---- */
  .success-screen {
    display: none;
    text-align: center;
    padding: 60px 20px;
  }
  .success-screen.show { display: block; }
  .success-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: #e6f4ea; display: flex;
    align-items: center; justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
  }
  .success-screen h2 { font-size: 22px; margin-bottom: 10px; }
  .success-screen p { font-size: 14px; color: #65676b; line-height: 1.6; }
  .success-detail {
    background: #f7f7f7; border-radius: 8px;
    padding: 16px; margin: 20px auto; max-width: 420px;
    text-align: left; font-size: 13px; color: #444; line-height: 1.8;
  }

  .closed-screen {
    display: none;
    text-align: center;
    padding: 60px 20px;
  }
  .closed-screen.show { display: block; }
  .closed-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: #f0f0f0; display: flex;
    align-items: center; justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
  }
  .closed-screen h2 { font-size: 22px; margin-bottom: 10px; }
  .closed-screen p { font-size: 14px; color: #65676b; line-height: 1.6; max-width: 420px; margin: 0 auto; }

  /* ---- RESPONSIVE: TABLET (540–768px) ---- */
  @media (max-width: 768px) {
    .page-body { margin: 20px auto; }
    .gift-img { width: 140px; min-width: 140px; height: 140px; }
  }

  /* ---- RESPONSIVE: PHONE (under 540px) ---- */
  @media (max-width: 540px) {
    .field-row { grid-template-columns: 1fr; }

    /* city / state / zip: city full width, state+zip side by side */
    .field-row.addr-bottom {
      grid-template-columns: 1fr 1fr !important;
    }
    .field-row.addr-bottom .field-group:first-child {
      grid-column: 1 / -1;
    }

    /* gift card: stack image above description */
    .gift-card {
      flex-direction: column;
      gap: 12px;
      padding: 14px;
      align-items: stretch;
    }
    .gift-radio { align-self: flex-start; }
    .gift-img {
      width: 100%;
      min-width: unset;
      height: 220px;
      object-fit: cover;
      border-radius: 8px;
    }

    .card { padding: 16px; }
    .submit-btn { font-size: 16px; }
  }