/* === Reset & Global Styles === */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #fafafa;
  --text: #223;
  --muted: #555;
  --brand: rgb(228, 239, 255);
  --brand-hover: rgb(0, 165, 183);
  --card-bg: #fff;
  --card-bd: #e9e9e9;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
  --radius: 12px;
  --gap: 16px;
}
body {
 font-family: system-ui,
  -apple-system,
  Segoe UI,
  Roboto,
  sans-serif;
 background: var(--bg);
 background-image: linear-gradient(rgb(228, 239, 255), #fafafa);
 background-repeat: no-repeat;
 background-attachment: fixed;
 color: var(--text); }

.hidden {
  display: none !important;
}

/* === Top Navigation Menu === */
/*.top-menu { position: sticky; top: 0; width: 100%; background: var(--bg); z-index: 1000; background-color: #ecf0f1; }*/

/* === HEADER: base layout for both lines === */
.top-menu {
  position: sticky;          /* stays at top while scrolling */
  top: 0;
  z-index: 1000;
}

/* Each line of the header */
.top-menu-line {
  display: flex;
  justify-content: center;   /* center the inner content column */
}

/* TOP line: grey background */
.top-menu-line-1 {
  background: rgb(230, 231, 232);  /* R:230 G:231 B:232 */
}

/* BOTTOM line: blue background */
.top-menu-line-2 {
  background: rgb(51, 102, 153);   /* R:51 G:102 B:153 */
  color: #ffffff;
}

/* Inner container used in BOTH lines */
.top-menu-inner {
  width: 100%;
  max-width: 2000px;         /* controls how wide the content is */
  margin: 0 auto;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Add left/right shadow effect to the inner block */
.top-menu-line-1 .top-menu-inner,
.top-menu-line-2 .top-menu-inner {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);  /* subtle shadow around */
}

/* === TOP LINE CONTENT === */

.logo-block {
  flex: 0 0 auto;
}

.logo-image {
  height: 40px;
  max-width: 160px;
  object-fit: contain;
}

/* Search form stretches in the middle */
.search-block {
  position: relative;
  flex: 1 1 auto;
  max-width: 480px;
  margin: 0 0.5rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 2.3rem 0.5rem 0.8rem;  /* room on the right for icon */
  border-radius: 999px;
  border: 1px solid #cccccc;
  background: rgb(254, 254, 254);        /* R:254 G:254 B:254 */
  font-size: 0.95rem;
  box-sizing: border-box;
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;   /* clicking here still focuses the input */
  font-size: 1rem;
}

/* Sign-in block */
.signin-block {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  margin-left: auto;
}

.signin-block:hover {
  border-color: #bbbbbb;
  background: rgba(255, 255, 255, 0.6);
}

.signin-icon {
  font-size: 1.2rem;
}

.signin-text {
  white-space: nowrap;
}

/* Cart block */
.cart-block {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
}

.cart-block:hover {
  border-color: #bbbbbb;
  background: rgba(255, 255, 255, 0.6);
}

.cart-icon {
  font-size: 1.2rem;
}

.cart-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.cart-label {
  font-size: 0.8rem;
}

.cart-amount {
  font-size: 0.9rem;
  font-weight: 600;
}

/* === BOTTOM LINE CONTENT (line 2) === */
.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 26px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

/* Base: small dots */
.menu-toggle span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
  transition:
    width 0.25s ease,
    height 0.25s ease,
    border-radius 0.25s ease,
    transform 0.25s ease,
    opacity 0.2s ease;
  transform-origin: center;
}

/* Hover: dots stretch into little pills (only when menu is closed) */
body:not(.nav-open) .menu-toggle:hover span {
  width: 22px;
  border-radius: 3px;
}

/* When nav is open: turn burger into an X */
body.nav-open .menu-toggle span {
  width: 22px;        /* ensure full bar width */
  height: 4px;        /* thinner bars */
  border-radius: 3px;
}

/* Top bar: rotate to / */
body.nav-open .menu-toggle span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

/* Middle bar: hide */
body.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

/* Bottom bar: rotate to \ */
body.nav-open .menu-toggle span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* Navigation area between burger and right-side buttons */
.main-nav {
  flex: 1 1 auto;
  margin-left: 0.75rem;
}

.nav-items {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav-link:hover {
  text-decoration: underline;
}

/* Track order button */
.track-order-btn {
  flex: 0 0 auto;
  margin-left: auto;          /* pushes Track order + lang selector to the right */
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
  height: 32px;
  white-space: nowrap;
}

.track-order-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Language selector glued to the right edge */
.lang-selector {
  flex: 0 0 auto;
  margin-left: 0.5rem;        /* small gap from Track order */
}

/* If your existing custom dropdown already has styles, this just keeps it aligned nicely */
.custom-dropdown {
  color: #ffffff;
}

/* Ensure inner container on line 2 has smaller horizontal padding so right side feels "glued" */
.top-menu-line-2 .top-menu-inner {
  padding: 0.35rem 0.4rem;
}

.nav-bar {
  max-width: 2000px; margin: 0 auto; padding: 0.75em 1em;
  display: flex; justify-content: space-between; align-items: center; position: relative;
}
.logo-container { position: absolute; left: 1em; display: flex; align-items: center; }
.logo-container img { height: 40px; }
.nav-wrapper { flex: 1; display: flex; justify-content: center; }
.nav-items { display: flex; gap: 2em; }
.nav-items a {
  text-decoration: none; color: var(--brand);
  font-weight: 600; font-size: 1rem; transition: transform .2s, color .2s;
}
.nav-items a:hover { transform: scale(1.08); color: var(--brand-hover); }

/* === Language Selector === */
.custom-dropdown { position: relative; width: 160px; cursor: pointer; user-select: none; }
.selected-lang {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  gap: .5em;
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
  height: 32px;
  white-space: nowrap;
}
.selected-lang img, .lang-options img { width: 20px; height: 20px; border-radius: 50%; }
.lang-options {
  position: absolute; top: 110%; left: 0; width: 100%;
  background: rgb(51, 102, 153); border: 1px solid #ccc; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.2);
  display: none; flex-direction: column; z-index: 1001;
}
.lang-options div { padding: .5em 1em; display: flex; align-items: center; gap: .5em; cursor: pointer; }
.lang-options div:hover { background: rgb(41, 82, 123); }

/* === Category Selector (top row of round icons) === */
.category-selector {
  margin-top: 80px; padding: 2em 1em;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5em; background: var(--bg);
  background-color: transparent;
}
.category { display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.category img {
  width: 100px; height: 100px; padding: 10px; border-radius: 50%;
  background-color: #ddd; border: 5px solid transparent;
  transition: transform .2s, box-shadow .2s, background-color .2s;
}
.category .label { margin-top: .5em; font-size: .9em; }
.category:hover img { transform: scale(1.1); box-shadow: 0 0 10px rgba(0,0,0,.2); }
.category.active img { transform: scale(1.25); box-shadow: 0 0 15px rgba(0,0,0,.35); }

/* === Content Grid Containers === */
.product-list {
  padding: 2em 1em;
}

.category-preview > h2,
.subcategory-preview > h2,
.product-preview > h2 {
  font-size: 1.25rem; font-weight: 700; margin: 0 .25rem .5rem;
  text-align: center;
  width: 100%;
  margin: 10px 0;
}

/* Clickable overview titles */
.category-preview > h2 { cursor: pointer; }
.category-preview > h2:hover { text-decoration: underline; color: var(--brand-hover); }

/* Generic grid for subcategories and products */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 220px); /* fixed card width */
  gap: var(--gap);
  justify-content: center;     /* centers the grid tracks */
  justify-items: stretch;      /* cards fill the 220px track */
  align-items: stretch;
  width: 100%;
  margin: 0 auto;
}

.product-card, .subcategory-card {
  display: flex;
  flex-direction: column;
  height: 100%;   /* fill the grid row height */
  width: 100%;    /* fill the grid column width */
}

/* Use flexbox specifically for subcategory grids */

/* === Subcategory Cards === */
.subcategory-card {
  background: var(--card-bg);
  border: 2px solid var(--card-bd);
  border-color: var(--cat-color, var(--card-bd));
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  box-sizing: border-box;

  height: 100%;
  width: 100%;
  /* no explicit height; let grid decide row height */
  /* no flex: 0 1 220px; no width/max-width here */
}

.subcategory-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}

.subcategory-card img {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: .5em;
  display: block;
  background: #fff;
}

.subcategory-title {
  font-size: .98rem;
  color: #333;
  display: block;

  /* push title to bottom of the card */
  margin: auto 0 0.3rem;    /* top: auto, sides: 0, bottom: 0.3rem */

  white-space: normal;
  word-wrap: break-word;
  font-weight: 700;
  overflow-wrap: break-word;
  text-align: center;
}

/* === Product Cards === */
.product-card {
  position: relative;
  box-sizing: border-box;
  padding: 6px;
  border-radius: 8px;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.12);
  background: #ffffff;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  height: 100%;     /* fill the grid row */
  width: 100%;      /* fill the 220px column */

  /* IMPORTANT: remove any height: 100%, min-height, flex-basis from here */
  /* No flex: 0 1 220px; here – grid already gives us 220px columns */
}

.f:hover { transform: translateY(-2px); }

.image-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.image-container img:not(.overlay-icon) {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Title under image */
.product-card h3 {
  margin: auto 8px 12px;    /* top: auto, sides: 8px, bottom: 12px */
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 600;
  text-align: center;
}

/* Products: fixed row height */
.product-preview .product-grid {
  grid-auto-rows: 300px;   /* pick your product-card height */
}

/* Subcategories: fixed row height */
.subcategory-preview .product-grid {
  grid-auto-rows: 240px;   /* pick your subcategory-card height */
}

/* === Overlay Icons === */
.overlay-icon {
  width: 30px !important; height: 30px !important;
  border-radius: 50%; border: 1px solid #ccc; background: #fff;
  object-fit: contain; pointer-events: auto;
}

/* Fixed top-corner positions */
.top-left { position: absolute; top: 6px; left: 6px; }
.top-right { position: absolute; top: 6px; right: 6px; }
.top-center { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); }

/* Icon rows placed inside image */
.icon-row {
  position: absolute; display: flex; gap: 4px; flex-wrap: nowrap;
  justify-content: center; align-items: center; left: 50%; transform: translateX(-50%);
  pointer-events: none; z-index: 2;
}
.icon-row img,
.icon-row img.overlay-icon {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid #ccc; background: #fff; object-fit: contain; pointer-events: auto;
}
.line-top { top: 40px; }
.line-above { top: 66px; }
.line-middle { bottom: 40px; }
.line-bottom { bottom: 8px; }

/* Tag labels (if you use text tags somewhere) */
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: .4em; }
.tag { background: #2980b9; color: #fff; padding: .3em .6em; font-size: .75em; border-radius: 5px; }

/* === Back button (hidden) === */
.back-button { display: none; }

/* === Breadcrumb === */
.breadcrumb { font-size: .95em; margin: 0 1em 1em; color: var(--muted); }
.breadcrumb span { display: inline; margin-right: .5em; }
.breadcrumb a { color: #007b99; text-decoration: none; transition: color .2s; }
.breadcrumb a:hover { color: #004f66; }

/* === Product Detail Backdrop (click-outside area) === *//* NEW */
.product-detail-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 1999; display: none;
}
.product-detail-backdrop.show { display: block; }

/* === Product Detail Panel === */
.product-detail-panel {
  position: fixed; top: 5%; left: 50%; transform: translateX(-50%); /* CHANGED: centered */
  width: min(100vw - 40px, 1100px); height: 90vh;
  background: #fff; box-shadow: 0 20px 40px rgba(0,0,0,.35); z-index: 2000;
  overflow: hidden; border-radius: 14px; display: flex; flex-direction: column; /* CHANGED */
}
.product-detail-panel.hidden { display: none; }

/* Panel header (optional title/actions area) *//* NEW */
.panel-header {
  display: flex; align-items: center; justify-content: flex-end;
  padding: .5rem .75rem; border-bottom: 1px solid #eee;
}

/* Content */
.panel-content { display: flex; width: 100%; height: 100%; gap: 2rem; padding: 1rem; overflow: hidden; }

/* Gallery */
.images-container {
  width: 50%; display: flex; flex-direction: column; align-items: center;
  height: 100%; position: relative; padding-bottom: 60px;
}
#main-product-image {
  max-height: 80%; max-width: 100%; object-fit: contain; height: 80%;
  border-radius: 12px; will-change: transform; transition: transform .2s ease; /* NEW */
}
#main-product-image.zoomable:hover { transform: scale(1.02); } /* NEW subtle zoom */
.images-container img { max-width: 100%; height: auto; border-radius: 12px; }

/* Tags row under main image */
.product-tags {
  position: absolute; bottom: 0; left: 0; right: 0; padding: .5rem;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  background: #fff; border-top: 1px solid #eee;
}
.product-tags img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #ccc; background: #fff; object-fit: contain; }

/* Thumbnails */
.additional-images {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: center;
  padding: 8px 0 10px;          /* a touch more vertical breathing room */
  scrollbar-gutter: stable both-edges;
}

.additional-images img {
  height: 92px;                 /* smaller base so 1.05x fits under ~97px */
  flex: 0 0 auto;
  object-fit: contain;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, outline-color .2s;
  border: 0;
}

.additional-images img.active {
  transform: scale(1.05);       /* gentle zoom */
  outline: 2px solid #0284c7;
  outline-offset: 2px;
  box-shadow: 0 0 5px rgba(2,132,199,.6);
}

.additional-images img:focus-visible { outline: 2px solid #0284c7; outline-offset: 2px; } /* NEW accessibility */

/* Optional scrollbar polish for horizontal thumbs *//* NEW */
.additional-images::-webkit-scrollbar { height: 10px; }
.additional-images::-webkit-scrollbar-thumb { background: #cfd8dc; border-radius: 6px; }
.additional-images:hover::-webkit-scrollbar-thumb { background: #b0bec5; }

/* Info column */
.product-info {
 flex: 1;
 padding-left: 20px;
 display: flex;
 flex-direction: column;
 overflow: auto;
}

#product-name {
 margin-top: 0;
}

/* Description friendly formatting *//* NEW */
#product-description {
  line-height: 1.55;
  color: #333;
  white-space: pre-line; /* respects \n from JSON */
}
#product-description a { color: var(--brand); text-decoration: underline; }

/* CTA */
.product-tags .tag-icon { width: 30px; height: 30px; cursor: default; }
/* Button always at the very bottom */
#add-to-cart {
  margin-top: auto;       /* pushes the button to the bottom */
}
.add-to-cart-btn {
  margin-top: auto;
  width: 100%;
  padding: 12px 20px;
  font-size: 1.1rem;
  background-color: #0284c7;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.add-to-cart-btn:hover { background-color: #0369a1; }

/* Close button */
.close-btn {
  position: absolute; top: 10px; right: 12px; background: transparent; border: none;
  font-size: 2rem; cursor: pointer; color: #333; z-index: 2100; line-height: 1;
}
.close-btn:focus-visible { outline: 2px solid #0284c7; border-radius: 6px; } /* NEW */

/* Tooltip for icons */
.icon-tooltip { position: relative; }
.icon-tooltip:hover::after,
.icon-tooltip:focus-visible::after {  /* NEW: also on keyboard focus */
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 4px 8px; font-size: 0.75rem;
  border-radius: 4px; white-space: nowrap; z-index: 100;
}

/* Gallery next/prev buttons (if you add them) *//* NEW */
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; gap: .5rem; width: 100%; justify-content: space-between; pointer-events: none;
}
.gallery-nav button {
  pointer-events: auto; border: none; background: rgba(255,255,255,.9);
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px;
  box-shadow: var(--shadow); cursor: pointer;
}
.gallery-nav button:hover { background: #fff; }

/* Responsive tweaks */
@media (max-width: 900px) {
  .panel-content { flex-direction: column; gap: 1rem; }       /* CHANGED */
  .images-container { width: 100%; padding-bottom: 12px; }    /* CHANGED */
  #main-product-image { height: auto; max-height: 60vh; }     /* NEW */
  .product-info { padding-left: 0; }
}

/* === Category / Banner Section === */
/* --- HARD RESET for banner layout --- */
#categoryBanner,
#categoryBanner * {
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
}

/* Container for the banner */
#categoryBanner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

/* Frame around the image (aligns with menu width) */
#categoryBanner .banner-frame {
  width: 100%;
  max-width: 2000px;      /* same as .top-menu-inner */
  position: relative;     /* so arrows can be positioned inside */
}

/* Arrows on the main banner */
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  outline: none;
}

.banner-arrow-left {
  left: 12px;
}

.banner-arrow-right {
  right: 12px;
}

.banner-arrow:hover {
  background: rgba(0, 0, 0, 0.65);
}

/* The actual banner image */
#categoryBannerImage {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;    /* keep proportions */
  box-shadow:
       0 6px 12px rgba(0, 0, 0, 0.20),   /* bottom */
      -4px 0 10px rgba(0, 0, 0, 0.20),   /* left */
       4px 0 10px rgba(0, 0, 0, 0.20);   /* right */
}

/* Bottom-right price block */
.card-price {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;      /* stack: main on top, tiers under */
  align-items: flex-end;       /* align right edge */
  text-align: right;
  gap: 2px;
  pointer-events: none;        /* keeps the whole card clickable */
  background: rgba(255,255,255,0.9);  /* improves legibility over images */
  padding: 6px 8px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Main price line (caption + amount inline) */
.card-price .main {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.price-caption { font-weight: 500; opacity: .85; font-size: .94em; }
.price-amount  { font-weight: 700; font-size: 1.05rem; }

/* Smaller stacked tiers */
.card-price .tiers {
  font-size: 0.84rem;
  color: #444;
}
.card-price .tiers span + span { margin-left: 8px; }

/* Bottom footer that holds price + button together */
#product-purchase {
  margin-top: auto;                 /* ⬅️ pushes this whole block to the bottom */
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;            /* price aligns right */
  gap: 8px;                         /* space between price and button */
}

#product-price {
  text-align: right;
  align-self: flex-end;   /* hug the right edge */
  margin-top: 12px;       /* breathing room from description */
  background: transparent;
  padding: 0;
  border: 0;
}

/* Keep the inline caption style you already added */
.product-price { display: inline-flex; align-items: baseline; gap: 6px; }
.product-price-tiers { margin-top: 2px; }

/* === Page visibility (single-page behaviour) === */
.page {
  display: none;
}
.page.page-active {
  display: block;
}

/* Make sure the main content has some top margin for the fixed header */
.page-content {
  max-width: 1800px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

/* === Modals (sign-in, track order, etc.) === */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}
.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal-content {
  position: relative;
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* Small generic form tweaks */
.generic-page-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.generic-page-wrapper h1 {
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.form-row-inline {
  display: flex;
  gap: 0.75rem;
}

.form-row-inline > div {
  flex: 1;
}

.form-row input,
.form-row textarea {
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.btn.primary {
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #336699;
  color: #fff;
  font-weight: 600;
}

.btn.primary:hover {
  background: #28527a;
}

.form-status {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #336699;
}

/* === Cart layout basics === */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}
.cart-table th,
.cart-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #ddd;
  font-size: 0.9rem;
  text-align: left;
}
.cart-total-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-weight: 600;
}
.cart-user-section,
.cart-items-section {
  margin-top: 1rem;
}

/* === Overview: category rectangles with circular items === */

/* When we are in overview mode, .product-list becomes a grid of category cards */
.product-list.overview-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  justify-items: center;
  padding: 1.5rem 0 2rem;
}

/* Category rectangle */
.category-card {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: flex;
  flex-direction: column;

  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);

  /* IMPORTANT: remove padding so the hero image can truly be full width */
  padding: 0;

  display: flex;
  flex-direction: column;

  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* Top part of category card: logo + title */
/*.category-card-top {
  width: 100%;
  flex: 0 0 50%;
  width: 100%;
  position: relative;
  overflow: hidden;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: #fff;
}*/
.category-card-top{
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: #fff;
}

.category-card-title{
  margin: 0;
  padding: 4px 6px 2px;
  line-height: 1.2;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--cat-color);
  background: transparent;
}

.category-card-top img.category-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* fully visible image */
  display: block;
}

/* The logo container expands to fill leftover vertical space */
.category-logo-wrap {
  flex: 1 1 auto;              /* this makes it fill all remaining height */
  width: 100%;
  display: flex;
  align-items: center;         /* vertically center if logo is shorter */
  justify-content: center;
  overflow: hidden;            /* prevent spill */
}

/* Logo image grows to fill as much as possible without distortion */
.category-logo-wrap img {
  max-width: 95%;              /* horizontal padding */
  max-height: 100%;            /* fill the entire available vertical space */
  object-fit: contain;         /* don't distort */
  display: block;
}

/* Category title stays below logo, takes minimal space */

/* Bottom 40% */
.category-card-bottom {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px 12px;
  gap: 8px;
}

/* Circles inside the category rectangle */
.category-card-items {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.category-card-bottom .category-circle {
  flex: 0 0 auto;
  width: 28%;
  max-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-card-bottom .circle-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 0.75;       /* rectangle: wider than tall (change if needed) */
  border-radius: 12px;          /* rounded corners */
  overflow: hidden;
  position: relative;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card-bottom .circle-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;          /* 👈 fully visible image */
  display: block;
  position: static;             /* remove absolute positioning from round design */
}

.category-card-bottom .circle-name {
  margin-top: 0.25rem;
  font-size: 0.6rem;
  line-height: 1.2;
  text-align: center;
  max-height: 2.4em;
  overflow: hidden;
}

/* Item name under the circle */
.circle-name {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  line-height: 1.15;
  word-break: break-word;
}

/* Hide burger on large screens */
@media (min-width: 801px) {
  .menu-toggle {
    display: none;
  }
}
/* === RESPONSIVE NAV (line 2) === */
@media (max-width: 800px) {
  /* Hide nav items by default on small screens */
  .nav-items {
    display: none;
  }

  /* When nav is "open", show items as a popup under the blue bar */
  body.nav-open .nav-items {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%; /* just below the blue bar */
    background: rgb(51, 102, 153);
    padding: 0.5rem 0.75rem 0.75rem;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  }

  body.nav-open .nav-items li {
    padding: 0.2rem 0;
  }

  /* Make sure the container of nav is positioned for absolute dropdown */
  .top-menu-line-2 {
    position: relative;
  }

  .main-nav {
    flex: 0 1 auto; /* let Track+Lang have enough room */
    margin-left: 0.4rem;
  }

  /* Keep Track order compact on small screens */
  .track-order-btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
  }
}

/* Main content + side banner layout */
.content-with-sidebar {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  max-width: 2000px;        /* match your new max width */
  margin: 1.5rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* Product list fills remaining space */
.content-with-sidebar .product-list {
  flex: 1 1 auto;
  min-width: 0;
}

/* Right-hand category side banner */
.category-side-banner {
  flex: 0 0 280px;          /* ~250–300px column, tweak as you like */
  max-width: 280px;
}

/* Side banner image */
.category-side-banner img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: none;
  border: none;
}

/* On smaller screens, stack below products */
@media (max-width: 900px) {
  .content-with-sidebar {
    flex-direction: column;
    gap: 1rem;
  }
  /* Products first */
  .content-with-sidebar .product-list {
    order: 1;
    width: 100%;
  }

  /* Banner second, full width */
  .category-side-banner {
    order: 2;
    width: 100%;
    max-width: 100%;
  }

  .category-side-banner img {
    max-width: 100%;
    margin: 0 auto;
  }
}

/* About page formatting */
#about-content h2 { font-size: 1.45rem; margin-top: 2.4rem; margin-bottom: 0.9rem; }
#about-content h3 { font-size: 1.15rem; margin-top: 1.6rem; margin-bottom: 0.6rem; }
#about-content p  { margin: 0.55rem 0; line-height: 1.55; }
#about-content ul { margin: 0.4rem 0 0.8rem 1.2rem; }
#about-content li { margin: 0.25rem 0; }

/* Two-column block (desktop), stacks on mobile */
/* About page – two-column company details (aligned) */
#about-content .about-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: stretch;   /* equal height */
}
#about-content .about-two-col h3 {
  break-inside: avoid;
}
#about-content .about-two-col p,
#about-content .about-two-col ul,
#about-content .about-two-col .about-card {
  break-inside: avoid;
}

/* Visually separate Legal section */
#about-content h2 + .about-two-col {
  margin-top: 1.8rem;
}

#about-content h2:has(+ .about-two-col),
#about-content h2:has(+ p) {
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 1.6rem;
}

.about-three-col{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.about-cert-card{
  display: flex;
  flex-direction: column;
}

.about-cert-card p{
  flex: 1; /* pushes the image to the bottom */
}

.about-cert-image{
  text-align: center;
  margin-top: 16px;
}

.about-cert-image img{
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  display: inline-block;
}

@media (max-width: 1000px){
  .about-three-col{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px){
  .about-three-col{ grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  #about-content .about-two-col {
    grid-template-columns: 1fr;
  }
}
/* Optional: a subtle “card” look for company blocks */
#about-content .about-card {
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  margin: 0.7rem 0;
  background: rgba(255,255,255,0.7);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.search-empty, .search-header {
  max-width: 900px;
  margin: 20px auto;
  text-align: center;
}

.search-section-title {
  margin: 26px 0 10px 0;
}

.category-cta {
  display: inline-block;
  align-self: center;
  padding: .45rem .85rem;
  border-radius: 999px;
  background: var(--cat-color, #2b67a0);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .01em;
  user-select: none;
  margin: .6rem .8rem .4rem .8rem; /* sits above random items */
  margin-top: auto;
  text-align: center;
}

.category-desc {
  margin: .6rem .8rem .8rem .8rem;
  padding: .45rem .75rem;
  border-radius: 14px;
  border: 1px solid var(--cat-color, #2b67a0);
  background: transparent;
  color: var(--cat-color, #2b67a0);
  font-size: .92rem;
  line-height: 1.25;
}
/* --- Overview card bottom layout: CTA (top), preview row, desc (bottom) --- */
.category-card-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 8px 10px 10px;
}

/* the 3 preview items must be side-by-side */
.category-preview-row {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
}

/* preview item sizing so 3 fit comfortably */
.category-preview-row .category-circle {
  flex: 1 1 0;
  max-width: 110px;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-preview-row .circle-name {
  margin-top: 6px;
  font-size: 0.74rem;
  line-height: 1.2;
  text-align: center;
  color: var(--cat-color);
  font-weight: 600;
}

/* keep images contained nicely */
.category-preview-row .circle-image-wrap {
  width: 100%;
  height: 72px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
}
.category-preview-row .circle-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* colors from meta.json via --cat-color */
.category-card { --cat-color: #888; }

.category-cta {
  background: var(--cat-color);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  margin-top: 2px;
  font-weight: 700;
  text-align: center;
  width: fit-content;
}

.category-desc {
  color: var(--cat-color);
  border: 1px solid var(--cat-color);
  background: transparent;
  border-radius: 14px;
  padding: 8px 12px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

/* Radio icon: pinned to right in the lower menu bar */
/* Radio container styled like language selector */
.radio-player {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 32px;
  padding: 0.3rem 0.6rem;

  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);

  /* 👇 background matches TOP menu line */
  background: rgb(230, 231, 232);

  cursor: pointer;
}

/* Hover effect consistent with other controls */
.radio-player:hover {
  background: rgba(255, 255, 255, 0.6);
}

/*.radio-player {*/
/*  position: relative;*/
/*  display: inline-flex;*/
/*  align-items: center;*/
/*  margin-left: 10px;*/
/*}*/

.radio-player #radio-icon {
  width: 34px;
  height: 34px;
  cursor: pointer;
  user-select: none;
}

/* Put it to the far right: apply to the container holding Track order + language selector */
.navbar-bottom-right, /* if you have one */
#nav-bottom-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Popup */
/* Ensure nothing in the header clips the popup */
.header,
.top-menu,
.navbar,
.navbar-bottom,
.menu-line-2,
#menu-line-2 {
  overflow: visible !important;
}

/* Popup BELOW the icon */
.radio-popup {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);   /* below icon */
  bottom: auto !important; /* override old bottom */
  min-width: 260px;
  padding: 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  z-index: 999999;         /* above header */
}

/* If you want it flush to the edge */
.radio-player { position: relative; }

.radio-popup.hidden { display: none; }

.radio-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.radio-track label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  opacity: 0.8;
}

.radio-track select {
  width: 100%;
  padding: 8px;
}

/* Force radio popup buttons to be visible and clickable */
.radio-popup .radio-controls button,
.radio-popup button.btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(0,0,0,0.25);
  background: #f6f6f6;
  color: #222;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.radio-popup .radio-controls button:hover,
.radio-popup button.btn:hover {
  background: #ffffff;
}

.radio-popup {
  pointer-events: auto;
}

.radio-controls {
  display: flex;
  justify-content: center; 
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.radio-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(0,0,0,0.2);
  background: #fafafa;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}

.radio-btn:hover {
  background: #ffffff;
}

.radio-btn:active {
  transform: scale(0.98);
}

.radio-ic svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: #222;
}

/* Optional: show "muted" state visually */
.radio-btn.is-active {
  background: #ececec;
}

.radio-ic-img { width: 18px; height: 18px; display: block; }
