/* StoneVaults — layout fixes (mobile nav, marketplace density, landing groups) */

/* Header logo — branding DB may set 130px desktop height; cap inside navbar */
header .flex-shrink-0 a[href="/"],
header .flex-shrink-0 a[aria-label*="Home"] {
  display: flex;
  align-items: center;
  max-height: 4rem;
  overflow: hidden;
}

header .flex-shrink-0 img,
header a[href="/"] img,
header img[class*="brand-logo"] {
  height: 2.5rem !important;
  max-height: 2.5rem !important;
  width: auto !important;
  max-width: 10rem !important;
  object-fit: contain !important;
  margin: 0 !important;
}

@media (min-width: 1280px) {
  header .flex-shrink-0 img,
  header a[href="/"] img {
    height: 3rem !important;
    max-height: 3rem !important;
    max-width: 12rem !important;
  }
}

header nav a[href="/"] > span,
header nav a[href="/"] > div {
  overflow: hidden !important;
  max-width: 100%;
}

/* Logged-in header: keep center nav visible from 1024px */
@media (min-width: 1024px) {
  header nav.hidden.lg\:flex {
    display: flex !important;
    flex: 1 1 auto;
    min-width: 0;
  }

  header .group\/nav.hidden.lg\:block {
    display: block !important;
  }

  header .hidden.sm\:flex.items-center.space-x-6 {
    flex-shrink: 0;
  }
}

/* Prevent horizontal page scroll */
html,
body {
  overflow-x: hidden;
}

#root {
  min-width: 0;
}

/* Tablet header: slightly shorter bar */
@media (min-width: 768px) and (max-width: 1023px) {
  header .flex.justify-between.h-20 {
    min-height: 4rem !important;
    height: 4rem !important;
  }

  header.min-h-\[5rem\] {
    min-height: 4rem !important;
  }

  header nav.hidden.lg\:flex {
    gap: 0.35rem !important;
  }

  header nav.hidden.lg\:flex a[href^="/quote/"] {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    font-size: 9px !important;
  }
}

/* ----- Mobile header & drawer (hamburger below 1024px) ----- */

@media (max-width: 767px) {
  header {
    position: sticky;
    top: 0;
    z-index: 50;
  }

  header.min-h-\[5rem\] {
    min-height: 3.75rem !important;
  }

  header .flex.justify-between.h-20,
  header .min-h-\[5rem\].items-center {
    min-height: 3.75rem !important;
    height: auto !important;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  header .max-w-7xl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Keep currency + menu visible; shrink login row on tiny screens */
  header .md\:hidden.flex.items-center.gap-2 {
    flex-shrink: 0;
    gap: 0.35rem !important;
  }

  /* Browse / marketplace — between logo and currency (injected by site-mobile-fix.js) */
  a.sv-header-marketplace {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 2.25rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    border: 2px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
  }

  a.sv-header-marketplace:hover {
    background: #f59e0b;
    color: #111827;
  }

  header .flex.justify-between.h-20 {
    gap: 0.35rem;
  }

  header .flex-shrink-0.flex.items-center {
    flex-shrink: 1;
    min-width: 0;
  }

  header .lg\:hidden button[aria-label="Toggle menu"],
  header button[aria-label="Toggle menu"] {
    position: relative;
    z-index: 62;
    min-height: 44px;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
  }

  header button[aria-label="Toggle menu"] span:first-child {
    font-size: 9px !important;
    letter-spacing: 0.14em !important;
  }

  /* Mobile drawer above content */
  button[aria-label="Close mobile menu"],
  aside.md\:hidden.fixed.inset-y-0.right-0,
  aside.fixed.inset-y-0.right-0 {
    z-index: 61 !important;
    pointer-events: auto;
  }

  button[aria-label="Close mobile menu"] {
    z-index: 60 !important;
  }

  html.sv-mobile-menu-open,
  body.sv-mobile-menu-open {
    overflow: hidden;
    touch-action: none;
  }

  body.sv-mobile-menu-open #root {
    pointer-events: none;
  }

  body.sv-mobile-menu-open aside.fixed,
  body.sv-mobile-menu-open button[aria-label="Close mobile menu"],
  body.sv-mobile-menu-open button[aria-label="Toggle menu"] {
    pointer-events: auto;
  }
}

/* Hero: CTAs above stats bar (no overlap) */
section.relative.min-h-\[90vh\].bg-gray-900 > div.mt-8,
section.relative.min-h-\[90vh\].bg-gray-900 > div.relative.z-20 {
  position: relative;
  z-index: 25;
}

section.relative.min-h-\[90vh\].bg-gray-900 > div.lg\:absolute,
section.relative.min-h-\[90vh\].bg-gray-900 > div.absolute.bottom-8,
section.relative.min-h-\[90vh\].bg-gray-900 > div[class*='bottom-8'] {
  pointer-events: auto;
}

@media (min-width: 1024px) {
  section.relative.min-h-\[90vh\].bg-gray-900.group {
    padding-bottom: 11rem !important;
  }

  section.relative.min-h-\[90vh\].bg-gray-900 .container.mx-auto.px-6.relative.z-30 {
    padding-bottom: 1rem;
  }
}

@media (max-width: 1023px) {
  section.relative.min-h-\[90vh\].bg-gray-900.group {
    padding-bottom: 2rem !important;
    min-height: auto !important;
  }

  section.relative.min-h-\[90vh\].bg-gray-900 > div.relative.z-20 {
    margin-bottom: 1.25rem !important;
  }

  section.relative.min-h-\[90vh\].bg-gray-900 > div.relative.z-10.w-full {
    position: relative !important;
  }

  /* Hero trust strip: 2×2 grid, compact on tablet/phone */
  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5,
  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5.sm\:p-8 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    flex-direction: unset !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    padding: 0.65rem !important;
    border-radius: 1rem !important;
  }

  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5 > div,
  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5.sm\:p-8 > div {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100%;
    min-width: 0;
  }

  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5 .w-12,
  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5.sm\:p-8 .w-12 {
    width: 2rem !important;
    height: 2rem !important;
    border-radius: 0.5rem !important;
    flex-shrink: 0;
  }

  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5 .text-xl,
  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5.sm\:p-8 .text-xl {
    font-size: 0.95rem !important;
    line-height: 1.1 !important;
  }

  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5 .text-\[9px\],
  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5.sm\:p-8 .text-\[9px\] {
    font-size: 7px !important;
    letter-spacing: 0.14em !important;
    line-height: 1.2 !important;
  }

  section.relative.min-h-\[90vh\].bg-gray-900 > div.relative.z-10.w-full {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    padding-bottom: 0.5rem !important;
  }
}

@media (max-width: 767px) {
  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5,
  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5.sm\:p-8 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5,
  section.relative.min-h-\[90vh\].bg-gray-900 .rounded-\[2rem\].p-5.sm\:p-8 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ----- Mobile-only minimalist landing (desktop unchanged) ----- */
@media (max-width: 767px) {
  /* Hide duplicate blocks: compact group list + quote grid (still on desktop) */
  div.bg-white.overflow-hidden > section.py-12.bg-white.border-b.border-gray-100,
  div.bg-white.overflow-hidden > section.py-16.bg-gray-50.border-b.border-gray-100 {
    display: none !important;
  }

  /* Hero: shorter, less vertical padding */
  div.bg-white.overflow-hidden > section.relative.min-h-\[90vh\] {
    min-height: 72vh !important;
    padding-top: 5.5rem !important;
    padding-bottom: 1.75rem !important;
  }

  div.bg-white.overflow-hidden > section.relative.min-h-\[90vh\] h1 {
    font-size: 2.35rem !important;
    line-height: 0.95 !important;
    margin-bottom: 1rem !important;
  }

  div.bg-white.overflow-hidden > section.relative.min-h-\[90vh\] .text-lg {
    font-size: 0.95rem !important;
    padding-left: 1rem !important;
    margin-bottom: 1.25rem !important;
  }

  div.bg-white.overflow-hidden > section.relative.min-h-\[90vh\] .mb-8 {
    margin-bottom: 1rem !important;
  }

  /* All landing sections: tighter rhythm */
  div.bg-white.overflow-hidden > section {
    padding-top: 2.25rem !important;
    padding-bottom: 2.25rem !important;
  }

  div.bg-white.overflow-hidden > section.py-32 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  div.bg-white.overflow-hidden .container.mx-auto.px-6 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Section intros: title only on small screens */
  div.bg-white.overflow-hidden > section.py-16.bg-white.border-b .max-w-2xl.text-gray-500,
  div.bg-white.overflow-hidden > section.py-24.bg-white.relative .text-lg.max-w-2xl,
  div.bg-white.overflow-hidden > section .text-center.mb-16 p {
    display: none !important;
  }

  div.bg-white.overflow-hidden > section .text-center.mb-16,
  div.bg-white.overflow-hidden > section .mb-10 {
    margin-bottom: 1.25rem !important;
  }

  div.bg-white.overflow-hidden h2.text-3xl,
  div.bg-white.overflow-hidden h2.text-4xl,
  div.bg-white.overflow-hidden h2.text-5xl {
    font-size: 1.35rem !important;
    line-height: 1.15 !important;
  }

  div.bg-white.overflow-hidden p.text-\[10px\].uppercase {
    margin-bottom: 0.5rem !important;
    letter-spacing: 0.2em !important;
  }

  /* Product groups: 2 per row, readable cards */
  div.bg-white.overflow-hidden > section.py-16.bg-white.border-b .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    align-items: stretch;
  }

  div.bg-white.overflow-hidden > section.py-16.bg-white.border-b a.block.h-full,
  div.bg-white.overflow-hidden > section.py-16.bg-white.border-b .rounded-\[2rem\] {
    border-radius: 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0;
  }

  .sv-group-card__media {
    min-height: 6.75rem !important;
    aspect-ratio: auto !important;
    flex-shrink: 0;
  }

  .sv-group-card__media img {
    object-fit: cover !important;
    object-position: center center !important;
  }

  .sv-group-card__overlay {
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0.65rem !important;
  }

  .sv-group-card__icon {
    margin: 0 !important;
    width: 2.75rem !important;
    height: 2.75rem !important;
  }

  .sv-group-card__title-on-media,
  .sv-group-card__paths {
    display: none !important;
  }

  .sv-group-card__body {
    padding: 0.6rem 0.55rem 0.7rem !important;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .sv-group-card__title {
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.35rem !important;
    -webkit-line-clamp: 2;
  }

  .sv-group-card__desc,
  .sv-group-card__root {
    display: none !important;
  }

  .sv-group-card__actions {
    margin-top: auto !important;
    gap: 0.35rem !important;
  }

  .sv-group-card__actions .inline-flex,
  .sv-group-card__actions a,
  .sv-group-card__actions span {
    font-size: 7px !important;
    letter-spacing: 0.06em !important;
    line-height: 1.2 !important;
  }

  .sv-group-card__actions .text-amber-600,
  .sv-group-card__actions .text-primary-600 {
    font-size: 7px !important;
  }

  /* Browse by category: 2-up, shorter tiles */
  div.bg-white.overflow-hidden > section.py-24.bg-white.relative .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }

  div.bg-white.overflow-hidden > section.py-24.bg-white.relative .h-\[220px\],
  div.bg-white.overflow-hidden > section.py-24.bg-white.relative .sm\:h-\[300px\],
  div.bg-white.overflow-hidden > section.py-24.bg-white.relative .md\:h-\[400px\] {
    height: 9.5rem !important;
    min-height: 9.5rem !important;
    border-radius: 1rem !important;
  }

  /* Featured / supplier blocks: denser grids */
  div.bg-white.overflow-hidden section .grid.gap-4,
  div.bg-white.overflow-hidden section .grid.gap-8,
  div.bg-white.overflow-hidden section .md\:gap-8 {
    gap: 0.65rem !important;
  }

  div.bg-white.overflow-hidden section .grid-cols-1.sm\:grid-cols-2,
  div.bg-white.overflow-hidden section .grid-cols-2.sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Product group cards on very small phones — keep 2 columns */
@media (max-width: 639px) {
  section [class*="xl:grid-cols-4"][class*="md:grid-cols-2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
  }

  section [class*="xl:grid-cols-4"] h3,
  section [class*="xl:grid-cols-4"] .font-serif {
    font-size: 0.95rem !important;
    line-height: 1.2 !important;
  }
}

/* ----- Marketplace: denser cards, working list rows ----- */
@media (max-width: 1023px) {
  main.container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}

/* List view: horizontal row on all breakpoints */
main.container a[class*="flex-row"][class*="items-stretch"] img,
main.container a.flex-row img {
  object-fit: cover;
}

main.container a.flex-row h3,
main.container a[class*="flex-row"] h3 {
  font-size: 1rem !important;
  line-height: 1.25 !important;
}

/* Category chips: scroll instead of clipping */
main.container .overflow-x-auto,
main.container [class*="overflow-x-auto"] {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* Sticky filter bar on mobile — don't cover bottom nav */
@media (max-width: 767px) {
  main.flex-grow.bg-gray-50 {
    background: #fff !important;
  }

  main.container {
    padding-top: 1.5rem !important;
    padding-bottom: 4.5rem !important;
  }

  main.container .sticky {
    top: 3.5rem;
  }

  main.container .rounded-\[2rem\] {
    border-radius: 1rem !important;
  }

  main.container .aspect-\[4\/5\] {
    aspect-ratio: 3 / 4 !important;
  }

  /* Marketplace mobile: less chrome */
  main.container section.mb-8,
  main.container section.mb-12 {
    margin-bottom: 1rem !important;
  }

  main.container h2.text-2xl {
    font-size: 1.15rem !important;
  }

  main.container .rounded-\[2rem\].border.p-5 {
    padding: 0.85rem !important;
  }
}

/* View toggle buttons — easier tap targets */
main.container button:has(svg) {
  min-width: 44px;
  min-height: 44px;
}

/* Product group pills row on marketplace */
@media (max-width: 639px) {
  main.container .grid-cols-1.sm\:grid-cols-2.xl\:grid-cols-4,
  main.container [class*="sm:grid-cols-2"][class*="xl:grid-cols-4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }
}

/* Marketplace + group pages: 2 product columns on phones (<640px) */
@media (max-width: 639px) {
  main.container .grid.grid-cols-1.sm\:grid-cols-2,
  main.container .grid.grid-cols-1.md\:grid-cols-2,
  main.container .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4,
  main.container .grid.grid-cols-1.md\:grid-cols-2.xl\:grid-cols-3,
  main.container .grid.grid-cols-1.md\:grid-cols-2.xl\:grid-cols-4,
  main.container .grid.grid-cols-2.sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }

  main.container .grid.grid-cols-2.sm\:grid-cols-2.md\:grid-cols-3,
  main.container .grid.grid-cols-2.sm\:grid-cols-2.md\:grid-cols-3.xl\:grid-cols-4 {
    gap: 0.45rem !important;
  }

  main.container .aspect-\[4\/5\] {
    aspect-ratio: 3 / 4 !important;
  }

  main.container .rounded-\[2rem\].sm\:rounded-\[2\.5rem\] h3,
  main.container .rounded-2xl h3 {
    font-size: 0.75rem !important;
  }

  main.container .rounded-\[2rem\].sm\:rounded-\[2\.5rem\] .p-5,
  main.container .rounded-2xl .p-5 {
    padding: 0.55rem !important;
  }
}

@media (min-width: 480px) and (max-width: 639px) {
  main.container .grid.grid-cols-1.sm\:grid-cols-2,
  main.container .grid.grid-cols-1.md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 640px) and (max-width: 767px) {
  main.container .grid.grid-cols-1.sm\:grid-cols-2.xl\:grid-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* General responsive images */
img {
  max-width: 100%;
  height: auto;
}

/* Tables / wide content */
.overflow-x-auto {
  max-width: 100%;
}

/* Header Browse link (tablet + phone) */
@media (max-width: 1023px) {
  a.sv-header-marketplace {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 2.35rem;
    padding: 0.4rem 0.75rem;
    margin-right: 0.15rem;
    border-radius: 9999px;
    border: 2px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
  }

  a.sv-header-marketplace:hover {
    background: #f59e0b;
    color: #111827;
  }
}

/* ----- Mobile drawer ----- */
@media (max-width: 1023px) {
  aside.fixed.inset-y-0.right-0 .sv-drawer-hidden,
  aside.lg\:hidden.fixed .sv-drawer-hidden {
    display: none !important;
  }

  /* Navigation block stays visible (quote/category blocks only hidden) */
  aside.fixed.inset-y-0.right-0 section:not(.sv-drawer-hidden),
  aside.lg\:hidden.fixed section:not(.sv-drawer-hidden) {
    display: block !important;
  }

  aside.fixed.inset-y-0.right-0 .sv-drawer-account,
  aside.lg\:hidden.fixed .sv-drawer-account {
    order: -1;
    margin-bottom: 0.25rem;
  }

  aside.fixed.inset-y-0.right-0 .sv-drawer-account .mt-4.grid,
  aside.lg\:hidden.fixed .sv-drawer-account .mt-4.grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  aside.fixed.inset-y-0.right-0 .sv-drawer-account a[href='/login'],
  aside.fixed.inset-y-0.right-0 .sv-drawer-account a[href='/register'],
  aside.lg\:hidden.fixed .sv-drawer-account a[href='/login'],
  aside.lg\:hidden.fixed .sv-drawer-account a[href='/register'] {
    min-height: 3rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
  }

  aside.fixed.inset-y-0.right-0 .flex-1.overflow-y-auto .space-y-4,
  aside.lg\:hidden.fixed .flex-1.overflow-y-auto .space-y-4 {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  aside.fixed.inset-y-0.right-0 .relative.overflow-hidden.border-b,
  aside.lg\:hidden.fixed .relative.overflow-hidden.border-b {
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
    min-height: 0 !important;
  }
}

/* ----- Mobile / tablet: visible header + menu button ----- */
@media (max-width: 1023px) {
  header.sticky,
  header {
    position: sticky !important;
    top: 0 !important;
    z-index: 200 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
  }

  header .flex.justify-between.h-20 {
    min-height: 3.5rem !important;
    height: 3.5rem !important;
  }

  header .flex.items-center.gap-2.lg\:hidden,
  header .lg\:hidden.flex {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  header button[aria-label='Toggle menu'] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 3rem !important;
    min-height: 3rem !important;
    padding: 0.5rem 0.65rem !important;
    background: #fff !important;
    border: 2px solid #f59e0b !important;
    color: #0f172a !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25) !important;
  }

  header button[aria-label='Toggle menu'] span:last-child {
    background: #f3f4f6 !important;
    color: #0f172a !important;
  }

  /* Drawer on top of everything */
  aside.lg\:hidden.fixed,
  aside.fixed.inset-y-0.right-0 {
    z-index: 250 !important;
    width: min(92vw, 22rem) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    top: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  aside.lg\:hidden.fixed > div.flex.h-full.flex-col,
  aside.fixed.inset-y-0.right-0 > div.flex.h-full.flex-col {
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
  }

  aside.lg\:hidden .relative.overflow-hidden.border-b,
  aside.fixed.inset-y-0.right-0 .relative.overflow-hidden.border-b {
    flex: 0 0 auto !important;
    min-height: 5.5rem !important;
    height: auto !important;
    max-height: none !important;
  }

  aside.lg\:hidden .absolute.inset-0,
  aside.fixed.inset-y-0.right-0 .absolute.inset-0 {
    position: absolute !important;
    inset: 0 !important;
    height: 100% !important;
    pointer-events: none !important;
  }

  aside.lg\:hidden .flex-1.overflow-y-auto,
  aside.fixed.inset-y-0.right-0 .flex-1.overflow-y-auto {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
  }

  header.sticky.top-0 {
    position: sticky !important;
    top: 0 !important;
    z-index: 200 !important;
  }

  button[aria-label='Close mobile menu'] {
    z-index: 240 !important;
  }

  /* Hero must not cover header */
  main.flex-grow {
    position: relative;
    z-index: 0;
  }
}

/* ----- Product group cards (all breakpoints) ----- */
.sv-group-card__media {
  position: relative;
  isolation: isolate;
}

.sv-group-card__media img {
  object-fit: cover;
  object-position: center;
}

.sv-group-card__overlay {
  pointer-events: none;
}

@media (min-width: 640px) {
  .sv-group-card__paths {
    display: block !important;
  }

  .sv-group-card__desc,
  .sv-group-card__root {
    display: block !important;
  }

  .sv-group-card__overlay {
    align-items: flex-start !important;
    justify-content: flex-end !important;
  }

  .sv-group-card__icon {
    margin-bottom: 1rem !important;
  }
}

/* ----- Explore page: group grid cards ----- */
.sv-explore-page .sv-explore-card {
  min-height: 0;
}

@media (max-width: 767px) {
  .sv-explore-page main .grid.grid-cols-1 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
  }

  .sv-explore-page .sv-explore-card {
    border-radius: 1rem !important;
  }

  .sv-explore-page .sv-explore-card .aspect-\[16\/10\] {
    aspect-ratio: 4 / 3 !important;
    min-height: 0 !important;
  }

  .sv-explore-page .sv-explore-card .flex-1.p-5 {
    padding: 0.65rem !important;
  }

  .sv-explore-page .sv-explore-card .mt-4.flex-wrap {
    flex-direction: column;
    gap: 0.35rem !important;
  }

  .sv-explore-page .sv-explore-card .mt-4.flex-wrap a {
    width: 100%;
    padding: 0.5rem 0.65rem !important;
    font-size: 0.7rem !important;
  }

  .sv-explore-page .sv-explore-card .grid.grid-cols-2.gap-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.4rem !important;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .sv-explore-page main .grid.grid-cols-1 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.sv-explore-page .sv-explore-card img {
  display: block;
  width: 100%;
}

@media (min-width: 768px) {
  .sv-explore-page .grid.md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .sv-explore-page .grid.md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }
}

/* ----- Country supplier credibility strip ----- */
.sv-country-suppliers__kicker {
  margin: 0 0 0.5rem;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #d97706;
}

.sv-country-suppliers__head {
  margin-bottom: 1.25rem;
}

.sv-country-suppliers__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #0f172a;
}

.sv-country-suppliers__lead {
  margin: 0.5rem 0 0;
  max-width: 40rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #64748b;
}

.sv-country-suppliers__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .sv-country-suppliers__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .sv-country-suppliers__title {
    font-size: 1.65rem;
  }
}

@media (min-width: 1024px) {
  .sv-country-suppliers__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

.sv-country-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.sv-country-card:hover {
  border-color: #fcd34d;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
  transform: translateY(-2px);
}

.sv-country-card__flag-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 1.75rem;
}

.sv-country-card__flag-img {
  display: block;
  width: 2.5rem;
  height: auto;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  object-fit: cover;
}

.sv-country-card__flag-emoji {
  display: none;
  font-size: 1.75rem;
  line-height: 1;
}

.sv-country-card__flag-img[style*='display: none'] + .sv-country-card__flag-emoji {
  display: inline !important;
}

.sv-country-card__name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.sv-country-card__count {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
}

/* ----- Footer SEO (site-footer-seo.js) — enhances existing footer only ----- */
footer[role='contentinfo'] {
  contain: layout style;
}

footer[role='contentinfo'] nav[data-sv-footer-nav],
footer[role='contentinfo'] nav[data-sv-footer-block] {
  display: block;
}

footer .sv-footer-dynamic h4 {
  color: #f59e0b;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
}

footer .sv-footer-dynamic ul,
footer nav[data-sv-footer-nav] ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

footer nav[data-sv-footer-nav] a:focus-visible,
footer nav[data-sv-footer-block] a:focus-visible,
footer .border-t a:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
  border-radius: 2px;
}

footer .text-secondary-300[data-sv-tagline] {
  max-width: 36rem;
  line-height: 1.6;
}

/* Hide legacy duplicate footer grid if cached */
footer .sv-footer-seo-nav {
  display: none !important;
}

/* Mobile drawer: show full navigation + injected links */
@media (max-width: 1023px) {
  aside.fixed.inset-y-0.right-0 section:not(.sv-drawer-hidden) .space-y-2 a,
  aside.lg\:hidden.fixed section:not(.sv-drawer-hidden) .space-y-2 a {
    display: flex !important;
  }

  aside.fixed.inset-y-0.right-0 .sv-drawer-injected-link,
  aside.lg\:hidden.fixed .sv-drawer-injected-link {
    display: flex !important;
  }

  aside.fixed.inset-y-0.right-0 .space-y-2,
  aside.lg\:hidden.fixed .space-y-2 {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }
}

.sv-country-card__cta {
  margin-top: 0.15rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d97706;
}
