* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f5f0; color: #1a1a1a; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.btn-r { background: #D85A30; color: #fff; border: none; padding: 9px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-block; white-space: nowrap; }
.btn-r:hover { background: #993C1D; }
.btn-o { background: transparent; color: #D85A30; border: 1.5px solid #D85A30; padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-block; white-space: nowrap; }
.btn-o:hover { background: #FAECE7; }
.btn-g { background: transparent; color: #666; border: 0.5px solid #ccc; padding: 6px 13px; border-radius: 8px; font-size: 12px; cursor: pointer; display: inline-block; white-space: nowrap; }
.card { background: #fff; border: 0.5px solid #e0e0e0; border-radius: 12px; padding: 1rem 1.25rem; }
.tag { background: #FAECE7; color: #712B13; font-size: 11px; padding: 2px 9px; border-radius: 20px; font-weight: 500; display: inline-block; }
.b2b { background: #E6F1FB; color: #0C447C; font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 500; display: inline-block; }
.b2c { background: #EAF3DE; color: #27500A; font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 500; display: inline-block; }

/* ── NAV ───────────────────────────────────────────────── */
.nav { background: #fffdcc; border-bottom: 0.5px solid #e0e0e0; padding: 12px 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 200; }
.nav-links { display: flex; gap: 20px; font-size: 13px; color: #666; }
.nav-links a:hover { color: #D85A30; }
.nav-links a.active { color: #D85A30; font-weight: 500; }
.nav-logo img { height: 87px; object-fit: contain; }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: #1a1a1a; font-size: 24px; line-height: 1; }
.nav-overlay { display: none; }

footer { background: #f5f5f0; border-top: 0.5px solid #e0e0e0; padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
footer img { height: 24px; object-fit: contain; }
.footer-links { display: flex; gap: 16px; font-size: 12px; color: #888; flex-wrap: wrap; }
.container { max-width: 960px; margin: 0 auto; padding: 0 28px; }
.fi { width: 100%; padding: 9px 12px; border: 0.5px solid #ccc; border-radius: 8px; font-size: 13px; background: #fff; color: #1a1a1a; font-family: inherit; }
.fi:focus { outline: none; border-color: #D85A30; }
.info-bar { background: #f5f5f0; border-top: 0.5px solid #e0e0e0; border-bottom: 0.5px solid #e0e0e0; padding: 11px 28px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: #666; }

/* ── RESPONSIVE GRID HELPER CLASSES (replace inline grid-template-columns) ── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-sidebar { display: grid; grid-template-columns: 1fr 220px; gap: 0; }
.grid-sidebar-gap { display: grid; grid-template-columns: 1fr 220px; gap: 30px; }
.hero-flex { display: flex; gap: 32px; align-items: center; justify-content: space-between; }
.detail-flex { display: flex; gap: 20px; align-items: flex-start; }

/* ════════════════════════════════════════════════════════
   MOBILE / TABLET RESPONSIVE RULES
   ════════════════════════════════════════════════════════ */
@media (max-width: 880px) {
  .container { padding: 0 18px; }

  /* Nav becomes hamburger-driven */
  .nav { padding: 12px 18px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 78%;
    max-width: 300px;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 80px 24px 24px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 250;
    box-shadow: -4px 0 24px rgba(0,0,0,0.08);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { padding: 13px 0; width: 100%; border-bottom: 0.5px solid #eee; font-size: 15px; }
  .nav-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 240;
  }
  .nav-overlay.open { display: block; }
  .nav-actions .btn-o { display: none; }
  .nav-actions .btn-r { padding: 8px 14px; font-size: 12px; }

  /* Mobile nav gets its own "List your brand" + Sign in inside the drawer */
  .nav-links .mobile-only-link { display: block; }

  /* Hero & flex sections stack */
  .hero-flex { flex-direction: column; align-items: stretch; gap: 24px; }
  .hero-flex > div { max-width: 100% !important; }

  .detail-flex { flex-direction: column; }
  .detail-flex > div:last-child { width: 100%; }

  /* Grids collapse */
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2-eq { grid-template-columns: 1fr; }
  .grid-sidebar, .grid-sidebar-gap { grid-template-columns: 1fr; }
  .grid-sidebar > div:first-child { border-right: none !important; padding-right: 0 !important; border-bottom: 0.5px solid #eee; padding-bottom: 18px; margin-bottom: 4px; }
  .grid-sidebar > div:last-child { padding-left: 0 !important; }

  /* Brand detail header actions go full width */
  .brand-actions { flex-direction: row !important; width: 100%; }
  .brand-actions a { flex: 1; text-align: center; }

  /* Filter bar stacks on listing page */
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar > div:first-child { width: 100%; flex: none; }
  .filter-bar select { width: 100%; flex: none; }

  /* CTA strips and footer stack */
  footer { flex-direction: column; text-align: center; }
  .cta-strip { flex-direction: column; align-items: flex-start !important; gap: 14px; }
  .cta-strip > a, .cta-strip > button { width: 100%; text-align: center; }

  h1 { font-size: 22px !important; }
  .story-pill-row { gap: 6px !important; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .card { padding: 0.85rem 1rem; }
}
