:root {
  --store-ink: #252821;
  --store-muted: #64685e;
  --store-line: rgba(55, 65, 42, 0.17);
  --store-card: #fbfaf6;
  --store-soft: #f0efe7;
  --store-accent: #6f8f27;
  --store-accent-dark: #4f691d;
  --store-shadow: 0 18px 44px rgba(39, 43, 32, 0.08);
}

.shop-hero {
  margin: 2rem 0 2.5rem;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid var(--store-line);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(111, 143, 39, 0.13), transparent 36%),
    var(--store-card);
}

.shop-hero h1 {
  max-width: 900px;
  margin: 0.2rem 0 1rem;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.95;
}

.shop-hero-lead {
  max-width: 760px;
  color: var(--store-muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.shop-search {
  display: block;
  max-width: 680px;
  margin-top: 1.6rem;
}

.shop-search input {
  width: 100%;
  min-height: 54px;
  padding: 0 1.15rem;
  border: 1px solid var(--store-line);
  border-radius: 999px;
  background: white;
  font: inherit;
}

.catalog-section,
.selected-collection,
.search-results-section {
  scroll-margin-top: 1rem;
}

.catalog-heading,
.category-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.catalog-heading h2,
.category-heading h2 {
  margin: 0;
}

.quiet-button {
  border: 1px solid var(--store-line);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--store-ink);
  cursor: pointer;
  font-weight: 700;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.collection-card {
  min-width: 0;
}

.collection-card-button {
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--store-line);
  border-radius: 26px;
  background: var(--store-card);
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--store-shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.collection-card-button:hover,
.collection-card-button:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(39, 43, 32, 0.14);
}

.collection-card-media {
  aspect-ratio: 4 / 3;
  padding: 1rem;
  background: white;
}

.collection-card-media img,
.collection-hero-media img,
.category-folder-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.collection-card-body {
  padding: 1.25rem;
}

.collection-card-body h3,
.category-folder-copy h3 {
  margin: 0.35rem 0 0.65rem;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.collection-card-body p,
.category-folder-copy p,
.collection-hero-copy p {
  color: var(--store-muted);
}

.collection-count {
  display: inline-flex;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  background: var(--store-soft);
  color: var(--store-muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.card-action,
.folder-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--store-accent-dark);
  font-weight: 800;
}

.collection-hero-card {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 420px;
  margin-bottom: 2rem;
  overflow: hidden;
  border: 1px solid var(--store-line);
  border-radius: 30px;
  background: var(--store-card);
  box-shadow: var(--store-shadow);
}

.collection-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.collection-hero-copy h2 {
  margin: 0.2rem 0 1rem;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: 0.98;
}

.collection-hero-media {
  min-height: 320px;
  padding: clamp(1rem, 3vw, 2rem);
  background: white;
}

.category-accordion {
  display: grid;
  gap: 1rem;
}

.category-folder {
  overflow: hidden;
  border: 1px solid var(--store-line);
  border-radius: 24px;
  background: var(--store-card);
}

.category-folder.open {
  box-shadow: var(--store-shadow);
}

.category-folder-summary {
  display: grid;
  grid-template-columns: minmax(150px, 260px) 1fr;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.category-folder-media {
  min-height: 220px;
  padding: 1rem;
  background: white;
}

.category-folder-copy {
  align-self: center;
  padding: 1.4rem clamp(1.3rem, 4vw, 3rem);
}

.category-folder-content {
  padding: 1.25rem;
  border-top: 1px solid var(--store-line);
}

.category-secondary {
  max-width: 900px;
  margin: 0 auto 1.25rem;
  color: var(--store-muted);
  text-align: center;
}

.category-guide {
  display: grid;
  gap: 0.25rem;
  max-width: 760px;
  margin: 0 auto 1.4rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(111, 143, 39, 0.28);
  border-radius: 18px;
  background: rgba(111, 143, 39, 0.08);
  color: inherit;
  text-decoration: none;
}

.guide-label {
  color: var(--store-accent-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.family-card {
  overflow: hidden;
  border: 1px solid var(--store-line);
  border-radius: 22px;
  background: white;
}

.family-media {
  display: block;
  aspect-ratio: 1 / 1;
  padding: 0.8rem;
  background: #fff;
}

.family-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.family-body {
  padding: 1.1rem;
}

.family-body h3 {
  margin: 0 0 0.7rem;
  font-size: 1.35rem;
}

.family-body h3 a {
  color: inherit;
  text-decoration: none;
}

.family-description {
  min-height: 3.8em;
  color: var(--store-muted);
}

.variant-label {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
  font-weight: 700;
}

.variant-label select {
  width: 100%;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--store-line);
  border-radius: 12px;
  background: white;
}

.family-price {
  margin-top: 1rem;
  font-size: 1.35rem;
  font-weight: 900;
}

.family-price small {
  color: var(--store-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.stock-badge {
  display: inline-flex;
  margin-top: 0.45rem;
  color: var(--store-accent-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

.stock-badge.out {
  color: #8a3f34;
}

.buy-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.quantity-control {
  display: grid;
  grid-template-columns: 38px 48px 38px;
}

.quantity-control button,
.quantity-control input {
  min-height: 44px;
  border: 1px solid var(--store-line);
  background: white;
  text-align: center;
}

.quantity-control button:first-child {
  border-radius: 12px 0 0 12px;
}

.quantity-control button:last-child {
  border-radius: 0 12px 12px 0;
}

.quantity-control input {
  width: 48px;
  border-left: 0;
  border-right: 0;
}

.add-button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--store-accent);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.add-button:disabled,
.quantity-control button:disabled,
.quantity-control input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.cart-notice {
  margin: 0.7rem 0 0;
  color: var(--store-accent-dark);
  font-weight: 800;
}

.loading-panel,
.empty-panel,
.catalog-message,
.media-placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 1.5rem;
  color: var(--store-muted);
  text-align: center;
}

.search-results-section {
  margin-top: 1.5rem;
}

@media (max-width: 980px) {
  .collection-grid,
  .family-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-hero-card {
    grid-template-columns: 1fr;
  }

  .collection-hero-media {
    order: -1;
  }
}

@media (max-width: 680px) {
  .catalog-heading,
  .category-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .collection-grid,
  .family-grid {
    grid-template-columns: 1fr;
  }

  .category-folder-summary {
    grid-template-columns: 1fr;
  }

  .category-folder-media {
    min-height: 190px;
  }

  .buy-row {
    grid-template-columns: 1fr;
  }

  .quantity-control {
    width: max-content;
  }
}

.collection-switcher{position:sticky;top:.5rem;z-index:20;display:grid;grid-template-columns:48px 1fr 48px;align-items:center;max-width:720px;margin:0 auto 1rem;padding:.35rem;border:1px solid var(--store-line);border-radius:999px;background:rgba(251,250,246,.95);box-shadow:0 12px 30px rgba(39,43,32,.09);backdrop-filter:blur(12px)}
.switcher-arrow,.active-collection-button{border:0;background:transparent;color:inherit;cursor:pointer}
.switcher-arrow{min-height:44px;border-radius:50%;font-size:1.7rem}
.active-collection-button{display:grid;gap:.05rem;padding:.35rem .8rem;text-align:center}
.switcher-label{color:var(--store-muted);font-size:.7rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.explorer-layout{display:grid;grid-template-columns:minmax(210px,260px) minmax(0,1fr);gap:1.25rem;align-items:start}
.explorer-sidebar{position:sticky;top:5rem;display:grid;gap:1.15rem;padding:1rem;border:1px solid var(--store-line);border-radius:22px;background:var(--store-card)}
.sidebar-block,.sidebar-collections,.sidebar-categories{display:grid;gap:.4rem}
.sidebar-link{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.72rem .78rem;border:0;border-radius:12px;background:transparent;color:var(--store-muted);text-align:left;cursor:pointer;font:inherit}
.sidebar-link:hover{background:var(--store-soft);color:var(--store-ink)}
.sidebar-link.active{background:rgba(111,143,39,.11);color:var(--store-accent-dark);font-weight:900}
.sidebar-category-link{padding-left:1rem;font-size:.94rem}
.sidebar-all-button{width:100%}
.explorer-content{min-width:0}
.explorer-content .collection-hero-card{grid-template-columns:.9fr 1.1fr;min-height:300px}
.explorer-content .collection-hero-copy{padding:clamp(1.3rem,4vw,2.6rem)}
.explorer-content .collection-hero-copy h2{font-size:clamp(2rem,4vw,3.6rem)}
.explorer-content .collection-hero-media{min-height:280px}
.explorer-content .category-folder-summary{grid-template-columns:minmax(230px,310px) minmax(0,1fr)}
.explorer-content .category-folder-media{grid-column:1;grid-row:2;min-height:190px;padding:.8rem 1.2rem 1.2rem}
.explorer-content .category-folder-copy{grid-column:2;grid-row:1/span 2;align-self:stretch;display:flex;flex-direction:column;justify-content:center;min-height:250px}
.explorer-content .category-folder-summary::before{content:"";grid-column:1;grid-row:1;min-height:74px}
@media(max-width:900px){.explorer-layout{grid-template-columns:1fr}.explorer-sidebar{position:static;grid-template-columns:1fr 1fr}.sidebar-all-button{grid-column:1/-1}}
@media(max-width:680px){.explorer-sidebar{display:none}.explorer-content .collection-hero-card{grid-template-columns:1fr}.explorer-content .category-folder-summary{grid-template-columns:130px minmax(0,1fr)}.explorer-content .category-folder-summary::before{display:none}.explorer-content .category-folder-media{grid-column:1;grid-row:1;min-height:150px;padding:.7rem}.explorer-content .category-folder-copy{grid-column:2;grid-row:1;min-height:150px;padding:1rem}}


/* R2.3: clearer assortment carousel and category-first navigation */
.collection-switcher {
  max-width: none;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.25fr) minmax(180px, 1fr);
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
}

.switcher-arrow {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1rem;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 700;
}

#previousCollection {
  justify-content: flex-start;
  text-align: left;
}

#nextCollection {
  justify-content: flex-end;
  text-align: right;
}

.switcher-neighbour {
  color: var(--store-muted);
  font-size: 0.9rem;
}

.switcher-direction {
  color: var(--store-accent-dark);
  font-size: 2rem;
  line-height: 1;
}

.active-collection-button {
  min-height: 68px;
  border-right: 1px solid var(--store-line);
  border-left: 1px solid var(--store-line);
}

.active-collection-button strong {
  font-size: 1.15rem;
}

.explorer-layout {
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
}

.explorer-sidebar {
  top: 5.5rem;
}

.sidebar-category-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
}

.sidebar-category-link.active {
  box-shadow: inset 4px 0 0 var(--store-accent);
}

.sidebar-count {
  color: var(--store-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-category-link.active .sidebar-count {
  color: var(--store-accent-dark);
}

.explorer-content .category-folder {
  display: none;
}

.explorer-content .category-folder.open {
  display: block;
}

.explorer-content .category-folder-summary {
  cursor: default;
}

.explorer-content .category-folder-summary .folder-action {
  display: none;
}

.explorer-content .category-folder-summary {
  pointer-events: none;
}

.explorer-content .category-folder-content {
  display: block !important;
}

.explorer-content .category-folder.open {
  border-radius: 24px;
}

.explorer-content .category-folder-copy {
  min-height: 220px;
}

.explorer-content .category-secondary {
  margin-top: 0.25rem;
}

@media (max-width: 900px) {
  .collection-switcher {
    grid-template-columns: 58px minmax(0, 1fr) 58px;
  }

  .switcher-neighbour {
    display: none;
  }

  .switcher-arrow {
    justify-content: center !important;
    padding: 0;
  }

  .explorer-layout {
    grid-template-columns: 1fr;
  }

  .explorer-sidebar {
    position: static;
    display: block;
    padding: 0.75rem;
  }

  .sidebar-block {
    display: block;
  }

  .sidebar-categories {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x proximity;
  }

  .sidebar-category-link {
    min-width: max-content;
    grid-template-columns: auto;
    scroll-snap-align: start;
  }

  .sidebar-count {
    display: none;
  }

  .sidebar-all-button {
    margin-top: 0.6rem;
  }
}

@media (max-width: 680px) {
  .explorer-sidebar {
    display: block;
  }

  .explorer-content .category-folder-summary {
    pointer-events: none;
  }
}


/* R2.3.2 compact product cards */
.family-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.family-body {
  display: flex;
  flex-direction: column;
}

.family-description {
  min-height: 0;
  margin: 0 0 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--store-muted);
  line-height: 1.45;
}

.family-body h3 {
  margin-bottom: 0.45rem;
}

.variant-label {
  margin-top: auto;
}

.family-media {
  aspect-ratio: 4 / 3;
}

.family-card .buy-row {
  margin-top: 0.8rem;
}

.family-card .family-price {
  margin-top: 0.75rem;
}


/* R1 Design Review — purchase-first category flow */
.catalog-section {
  margin-bottom: 1rem;
}

.catalog-heading {
  margin-bottom: 0.75rem;
}

.collection-grid {
  margin-top: 0.25rem;
}

.selected-collection,
.category-folder {
  scroll-margin-top: 6.5rem;
}

.shop-hero h1 {
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 1.02;
}

.collection-hero-copy h2 {
  font-size: clamp(1.9rem, 3.7vw, 3.35rem);
}

.category-folder-copy h3 {
  font-size: clamp(1.35rem, 2.1vw, 1.8rem);
}

.category-folder-copy p {
  display: -webkit-box;
  max-width: 62ch;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-height: 1.5;
}

.category-folder-content {
  padding: 1rem;
}

.category-folder-content > .family-grid:first-child {
  margin-top: 0;
}

.category-guide {
  margin: 1.4rem auto 0;
}

.category-secondary {
  max-width: 900px;
  margin: 1rem auto 0;
  padding: 1.15rem;
  border-top: 1px solid var(--store-line);
  color: var(--store-muted);
  text-align: left;
}

.category-secondary h4 {
  margin: 0 0 0.45rem;
  color: var(--store-ink);
  font-size: 1rem;
}

.category-secondary p {
  margin: 0;
  line-height: 1.65;
}

.family-body h3 {
  font-size: 1.2rem;
}

.family-purchase-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.family-purchase-meta .family-price {
  margin-top: 0;
  font-size: 1.2rem;
}


.variant-label,
.variant-label select,
.family-card,
.family-body {
  min-width: 0;
}

.variant-label select {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 680px) {
  .shop-hero {
    margin-top: 1rem;
    padding: 1.2rem;
  }

  .shop-hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    line-height: 1.05;
  }

  .shop-hero-lead {
    font-size: 0.98rem;
  }

  .catalog-heading h2,
  .category-heading h2 {
    font-size: 1.55rem;
  }

  .collection-switcher {
    position: sticky;
    top: 0.35rem;
  }

  .selected-collection,
  .category-folder {
    scroll-margin-top: 5.75rem;
  }

  .explorer-content .collection-hero-card {
    min-height: 0;
    margin-bottom: 1rem;
  }

  .explorer-content .collection-hero-copy {
    padding: 1.15rem;
  }

  .explorer-content .collection-hero-copy h2 {
    font-size: 1.85rem;
  }

  .explorer-content .collection-hero-media {
    min-height: 190px;
  }

  .explorer-content .category-folder-summary {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .explorer-content .category-folder-media,
  .explorer-content .category-folder-copy {
    min-height: 132px;
  }

  .explorer-content .category-folder-copy {
    padding: 0.85rem;
  }

  .category-folder-copy h3 {
    margin: 0.2rem 0 0.35rem;
    font-size: 1.3rem;
  }

  .category-folder-copy p {
    -webkit-line-clamp: 3;
    font-size: 0.91rem;
    line-height: 1.4;
  }

  .category-folder-content {
    padding: 0.75rem;
  }

  .family-body {
    padding: 0.95rem;
  }

  .family-description {
    -webkit-line-clamp: 2;
    font-size: 0.94rem;
  }

  .variant-label select {
    width: 100%;
    font-size: 0.93rem;
  }

  .buy-row {
    grid-template-columns: 1fr;
  }

  .quantity-control {
    width: 100%;
    grid-template-columns: 44px minmax(48px, 1fr) 44px;
  }

  .quantity-control input {
    width: 100%;
  }

  .add-button {
    width: 100%;
  }

  .family-price {
    font-size: 1.15rem;
  }

  .stock-badge {
    font-size: 0.8rem;
  }
}


/* R1.1 — strict family-slug grouping and mobile card containment */
.family-card,
.family-body,
.variant-label,
.variant-label select,
.buy-row,
.quantity-control,
.add-button {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.family-card {
  width: 100%;
}

.variant-label select {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buy-row {
  width: 100%;
}

@media (max-width: 760px) {
  .buy-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }

  .quantity-control {
    width: 100%;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .quantity-control input {
    width: 100%;
    min-width: 0;
  }

  .add-button {
    display: block;
    width: 100%;
  }
}


/* R1.2 — mobile containment and safe product-family presentation */
.family-purchase-meta {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.family-purchase-meta > * {
  min-width: 0;
}


.variant-label {
  width: 100%;
  overflow: hidden;
}

.variant-label select {
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 760px) {
  .family-card {
    overflow: hidden;
  }

  .family-body {
    width: 100%;
    overflow: hidden;
  }

  .family-purchase-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }

  .buy-row {
    width: 100%;
    max-width: 100%;
  }
}


/* R1.4 — corrected product-family grouping UX and mobile containment */
.catalog-section {
  margin-bottom: 0.35rem;
}

.catalog-heading {
  margin-bottom: 0.45rem;
}

.collection-grid {
  margin-top: 0;
}

.shop-hero h1 {
  font-size: clamp(1.9rem, 3.8vw, 3.25rem);
  line-height: 1.04;
}

.category-folder,
.selected-collection {
  scroll-margin-top: 7.25rem;
}

.family-card,
.family-body,
.variant-label,
.variant-label select,
.family-purchase-meta,
.buy-row {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.variant-label {
  overflow: hidden;
}

.variant-label select {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  padding-right: 2rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-card,
.family-body {
  overflow: hidden;
}

.add-button {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 760px) {
  .shop-hero h1 {
    font-size: clamp(1.65rem, 7vw, 2.1rem);
    line-height: 1.05;
  }

  .shop-hero-lead {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .catalog-section {
    margin-bottom: 0;
  }

  .selected-collection,
  .category-folder {
    scroll-margin-top: 6.25rem;
  }

  .family-body h3 {
    font-size: 1.08rem;
  }

  .family-description {
    font-size: 0.9rem;
  }

  .variant-label {
    font-size: 0.92rem;
  }

  .variant-label select {
    font-size: 0.86rem;
  }

  .buy-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .quantity-control,
  .add-button {
    width: 100%;
  }

  .quantity-control {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }
}


/* R1.5 — family grouping now follows the proven production shop.js field priority.
   Category slugs are explicitly rejected as product-family grouping keys. */


/* R1.6 — grouping restored to familyName-first, matching the working production shop. */


/* R1.8 — V1-style mobile product cards only.
   Navigation, category menu and product-family grouping are untouched. */

.family-card,
.family-body,
.family-media,
.variant-label,
.variant-label select,
.family-purchase-meta,
.buy-row,
.quantity-control,
.add-button {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.family-card {
  width: 100%;
  overflow: hidden;
}

.family-body {
  width: 100%;
  overflow: hidden;
}

.variant-label {
  width: 100%;
  overflow: hidden;
}

.variant-label select {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-purchase-meta {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}


@media (max-width: 760px) {
  .family-grid {
    grid-template-columns: 1fr;
  }

  .family-card {
    display: grid;
    grid-template-rows: auto 1fr;
    border-radius: 22px;
  }

  .family-media {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0.8rem;
    background: #fff;
  }

  .family-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .family-body {
    display: flex;
    flex-direction: column;
    padding: 1.1rem;
  }

  .family-body h3 {
    margin: 0 0 0.7rem;
    font-size: 1.35rem;
    line-height: 1.15;
  }

  .family-description {
    min-height: 0;
    margin: 0 0 0.9rem;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: var(--store-muted);
    font-size: 1rem;
    line-height: 1.45;
  }

  .variant-label {
    margin-top: 0.8rem;
    font-size: 1rem;
  }

  .variant-label select {
    min-height: 44px;
    font-size: 0.95rem;
  }

  .family-purchase-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
    margin-top: 0.8rem;
  }

  .family-price,
  .family-purchase-meta .family-price {
    margin-top: 0;
    font-size: 1.35rem;
  }

  .stock-badge {
    margin-top: 0.55rem;
    font-size: 0.9rem;
  }

  .buy-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    margin-top: 1rem;
  }

  .quantity-control {
    width: min(100%, 230px);
    grid-template-columns: 48px minmax(48px, 1fr) 48px;
  }

  .quantity-control input {
    width: 100%;
    min-width: 0;
  }

  .add-button {
    display: block;
    width: 100%;
    min-height: 52px;
  }
}


/* R1.9 — production-style store header restored.
   No catalogue, category or product-family rules are changed. */

.store-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 0;
}

.store-header .brand {
  display: block;
  flex: 0 0 auto;
}

.store-header .brand img {
  display: block;
  width: 185px;
  height: auto;
}

.store-nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.store-nav a {
  color: var(--store-ink);
  text-decoration: none;
  font-weight: 800;
}

.store-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: flex;
  gap: 5px;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #ccd7b5;
  border-radius: 7px;
  color: var(--store-accent-dark);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 900;
}

.lang-switch a.active {
  border-color: var(--store-accent);
  background: var(--store-accent);
  color: #fff;
}

.cart-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--store-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.cart-count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--store-accent-dark);
}

@media (max-width: 700px) {
  .store-header {
    gap: 10px;
    padding: 14px 0;
  }

  .store-header .brand img {
    width: 145px;
  }

  .store-nav {
    display: none;
  }

  .store-actions {
    gap: 7px;
    margin-left: auto;
  }

  .lang-switch a {
    min-width: 32px;
    min-height: 32px;
    padding: 4px 7px;
  }

  .cart-pill {
    padding: 8px 11px;
  }
}
