/* Catalog Layout & Suggestions */
.catalog-layout { display: grid; grid-template-columns: 265px 1fr; gap: 1.5rem; align-items: start; }
.filter-panel { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 1rem; }
.filter-group label { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.4rem; }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.catalog-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.15rem; }
.search-suggest-wrap { position: relative; flex: 1; min-width: 240px; }
.suggest-box { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; display: none; }
.suggest-box.open { display: block; }
.suggest-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0.85rem; background: transparent; border: 0; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer; font-size: 0.86rem; color: var(--text); }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover { background: var(--surface-2); color: var(--accent-ink); }
.toolbar-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.view-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; }
.view-btn { border: 0; background: transparent; padding: 0.4rem 0.65rem; border-radius: 6px; cursor: pointer; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; }
.view-btn.active { background: var(--accent); color: var(--accent-text); }
.product-grid.list-view { grid-template-columns: 1fr; }
.product-grid.list-view .product-card { flex-direction: row; align-items: center; gap: 1.25rem; }
.product-grid.list-view .product-media { width: 180px; height: 130px; flex-shrink: 0; }
.product-grid.list-view .product-body { flex: 1; }
.product-grid.list-view .product-footer { margin-top: 0; border-top: 0; flex-direction: column; align-items: flex-end; min-width: 170px; }
.wish-btn.active { color: var(--accent-ink); border-color: var(--accent-border); background: var(--accent-soft); }

/* Product Page, Image Gallery & Reviews */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 0.45rem; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.breadcrumbs a:hover { color: var(--accent-ink); }
.product-detail { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2rem; align-items: start; margin-bottom: 2.5rem; }

.product-gallery { display: flex; flex-direction: column; gap: 0.85rem; outline: none; }
.product-stage {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  min-height: 360px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}
.gallery-main-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  transition: opacity 0.16s ease, transform 0.2s ease;
}
.gallery-main-img.is-switching { opacity: 0.35; }
.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  box-shadow: var(--shadow-sm);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.gallery-nav-btn:hover,
.gallery-nav-btn:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  outline: none;
}
.gallery-nav-btn.prev { left: 0.75rem; }
.gallery-nav-btn.next { right: 0.75rem; }
.gallery-counter {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  pointer-events: none;
}
.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.gallery-thumb {
  width: 74px;
  height: 74px;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.14s ease, transform 0.14s ease, background 0.14s ease;
}
.gallery-thumb:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.gallery-thumb.active {
  border-color: var(--accent);
  background: var(--bg-elev);
}
.gallery-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.gallery-lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  min-height: 320px;
  max-height: 74vh;
}
.gallery-lightbox-stage img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  display: block;
}

.buy-bar { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; margin: 1.25rem 0; }
.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-elev); }
.qty-box button { width: 34px; height: 38px; border: 0; background: transparent; cursor: pointer; font-weight: 700; color: var(--text); }
.qty-box button:hover { color: var(--accent-ink); }
.qty-box span { min-width: 34px; text-align: center; font-weight: 600; font-size: 0.9rem; }
.stars { color: var(--accent-ink); letter-spacing: 1px; font-size: 0.95rem; }
.reviews-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1.5rem; align-items: start; }
.review-card { padding: 1rem; border-bottom: 1px solid var(--border); }
.review-card:last-child { border-bottom: 0; }

/* Cart & Checkout */
.cart-layout, .checkout-layout { display: grid; grid-template-columns: 1.45fr 0.85fr; gap: 1.5rem; align-items: start; }
.cart-item { display: grid; grid-template-columns: 84px 1fr auto auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: 0; }
.cart-thumb { width: 84px; height: 70px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); display: grid; place-items: center; padding: 0.4rem; }
.ship-bar { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 0.45rem 0 0.25rem; }
.ship-bar-fill { height: 100%; background: var(--accent); transition: width 0.25s; }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.45rem 0; font-size: 0.9rem; }
.summary-total { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; border-top: 1px solid var(--border); margin-top: 0.5rem; padding-top: 0.75rem; }
.promo-row { display: flex; gap: 0.5rem; margin: 0.85rem 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.form-field { display: flex; flex-direction: column; gap: 0.35rem; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.field-error { font-size: 0.76rem; color: var(--danger-ink); min-height: 1em; }
.input.invalid, .select.invalid { border-color: var(--danger-border); }
.radio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.65rem; }
.radio-card { display: flex; align-items: center; gap: 0.55rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); cursor: pointer; font-size: 0.86rem; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.confirm-box { max-width: 720px; margin: 0 auto; text-align: center; }

@media (max-width: 960px) {
  .catalog-layout, .product-detail, .reviews-grid, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
}
@media (max-width: 640px) {
  .product-stage { min-height: 270px; height: 300px; padding: 1rem; }
  .gallery-thumbs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; -webkit-overflow-scrolling: touch; }
  .gallery-thumb { width: 64px; height: 64px; }
  .gallery-nav-btn { width: 34px; height: 34px; }
  .form-grid { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 64px 1fr; }
  .product-grid.list-view .product-card { flex-direction: column; align-items: stretch; }
  .product-grid.list-view .product-media { width: 100%; }
  .product-grid.list-view .product-footer { align-items: center; flex-direction: row; }
}