/* ============================================================
   shop.css — NetPix Shop Module
   BEM methodology, uses Netpix CSS custom properties throughout.
   Load via loadCss() helper in shop/index.php.
   ============================================================ */

/* ── Shop page layout ──────────────────────────────────────── */
.shop-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* ── Sticky header block (title + search + chips) ──────────── */
.shop-sticky-header {
  margin-bottom: 24px;
  transition: box-shadow 0.35s ease, background 0.35s ease, padding 0.35s ease;
}
.shop-sticky-header--sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 64px; /* sits flush beneath the main navbar */
  z-index: 100;
  background: var(--color-surface, #fff);
  /* Bleed to page edges so it fills full width under the nav */
  margin-left: -16px;
  margin-right: -16px;
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.09);
  transition: box-shadow 0.35s ease, background 0.35s ease, padding 0.35s ease;
}

/* ── Row 1: back arrow · title · cart ──────────────────────── */
.shop-page__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.shop-page__back {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text, #1a1a1a);
  /* Use the global touch-target variable so this stays consistent if the value changes */
  min-width: var(--touch-target-min, 44px);
  min-height: var(--touch-target-min, 44px);
  padding: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.shop-page__back:hover { background: rgba(0,0,0,0.06); }

.shop-page__title {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
  margin: 0;
  flex: 1; /* absorbs space, pushes cart to far right */
}

.shop-page__cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  flex-shrink: 0;
}

/* ── Row 2: full-width search ──────────────────────────────── */
.shop-page__search-row {
  margin-bottom: 12px;
}

.shop-page__search-wrap {
  position: relative;
}

.shop-page__search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 24px;
  font-size: 14px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #1a1a1a);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.shop-page__search:focus {
  border-color: var(--color-primary, #2ECC71);
  box-shadow: 0 0 0 3px rgba(46,204,113,0.15);
}
.shop-page__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted, #888);
  pointer-events: none;
}

/* ── Row 3: category chip scroll nav ───────────────────────── */
.shop-category-nav-wrap {
  /* Fade colour matches page bg; updates to surface white when sticky */
  --chip-fade-color: var(--color-bg, #f5f5f5);
  position: relative;
  /* Vertical breathing room around chips */
  padding-top: 4px;
  padding-bottom: 6px;
}
.shop-sticky-header--sticky .shop-category-nav-wrap {
  --chip-fade-color: var(--color-surface, #fff);
}

/* Left and right gradient fades dissolving the chip row at the edges */
.shop-category-nav-wrap::before,
.shop-category-nav-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 28px;
  z-index: 1;
  pointer-events: none;
}
.shop-category-nav-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--chip-fade-color), transparent);
}
.shop-category-nav-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--chip-fade-color), transparent);
}

.shop-category-nav {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 0.75rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Inner horizontal padding so first/last chip clears the fade */
  padding-left: 4px;
  padding-right: 4px;
}
.shop-category-nav::-webkit-scrollbar { display: none; }

.shop-category-nav__btn {
  padding: 7px 18px;
  border-radius: 24px;
  border: 1.5px solid var(--color-border, #ddd);
  background: var(--color-surface, #fff);
  color: var(--color-text-muted, #666);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.shop-category-nav__btn:hover {
  border-color: #27ae60;
  color: #27ae60;
}
.shop-category-nav__btn--active {
  background: #27ae60;
  border-color: #27ae60;
  color: #fff;
}

/* ── Product grid ──────────────────────────────────────────── */
.shop-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.shop-product-grid__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 0;
  color: var(--color-text-muted, #888);
  font-size: 16px;
}

/* ── Product card ──────────────────────────────────────────── */
.shop-product-card {
  background: var(--color-surface, #fff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
/* Only apply hover lift on real pointer devices — not touch screens */
@media (hover: hover) {
  .shop-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  }
  .shop-product-card:hover .shop-product-card__img {
    transform: scale(1.04);
  }
  .shop-product-card:hover .shop-product-card__quick-view {
    bottom: 0;
  }
}

.shop-product-card__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-bg-alt, #f4f4f4);
}
.shop-product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.shop-product-card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shop-product-card__badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: var(--color-error, #e74c3c);
  color: #fff;
}
.shop-product-card__badge--featured {
  background: var(--color-primary, #2ECC71);
}
.shop-product-card__quick-view {
  position: absolute;
  bottom: -40px;
  left: 0; right: 0;
  background: rgba(0,0,0,0.72);
  color: #fff;
  border: none;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: bottom 0.2s;
}

.shop-product-card__info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.shop-product-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #1a1a1a);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-product-card__rating {
  display: flex;
  align-items: center;
  gap: 3px;
}
.shop-product-card__rating-count {
  font-size: 12px;
  color: var(--color-text-muted, #888);
  margin-left: 2px;
}
.shop-product-card__pricing {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.shop-product-card__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
}
.shop-product-card__price--sale {
  color: var(--color-error, #e74c3c);
}
.shop-product-card__price--original {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-muted, #888);
  text-decoration: line-through;
}
.shop-product-card__stock {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}
.shop-product-card__stock--in  { background: #e8f9f1; color: #1a7a4a; }
.shop-product-card__stock--low { background: #fff4e5; color: #b45309; }
.shop-product-card__stock--out { background: #fef2f2; color: #b91c1c; }

/* Skeleton loader */
.shop-product-card--skeleton {
  pointer-events: none;
  animation: shop-shimmer 1.4s infinite;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  min-height: 320px;
}
@keyframes shop-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Stars ─────────────────────────────────────────────────── */
.shop-star path { fill: #ddd; }
.shop-star--filled path { fill: #f59e0b; }

/* ── Pagination ────────────────────────────────────────────── */
.shop-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.shop-pagination__btn {
  padding: 7px 13px;
  border: 1.5px solid var(--color-border, #ddd);
  border-radius: 8px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #1a1a1a);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s;
}
.shop-pagination__btn:hover          { border-color: var(--color-primary,#2ECC71); color:var(--color-primary,#2ECC71); }
.shop-pagination__btn--active        { background:var(--color-primary,#2ECC71); border-color:var(--color-primary,#2ECC71); color:#fff; }

/* ── Cart badge (in nav) ───────────────────────────────────── */
.shop-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-error, #e74c3c);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Cart drawer ───────────────────────────────────────────── */
.shop-cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1100;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.shop-cart-overlay--visible { opacity:1; pointer-events:all; }

.shop-cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 360px; max-width: 92vw;
  background: var(--color-surface, #fff);
  box-shadow: -4px 0 32px rgba(0,0,0,0.15);
  z-index: 1110;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
.shop-cart-drawer--open { transform: translateX(0); }

.shop-cart-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--color-border,#eee);
  font-size: 18px; font-weight: 700;
}
.shop-cart-drawer__close {
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: var(--color-text-muted, #888);
  line-height: 1; padding: 4px;
}
.shop-cart-drawer__list {
  flex: 1; overflow-y: auto;
  list-style: none; margin: 0; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.shop-cart-drawer__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
  color: var(--color-text-muted, #888);
}
.shop-cart-drawer__footer {
  padding: 16px;
  position: relative;
}
.shop-cart-drawer__footer::before {
  content: '';
  position: absolute;
  top: 0; left: 5px; right: 5px;
  height: 1px;
  background: var(--color-border, #eee);
}
.shop-cart-drawer__total {
  display: flex; justify-content: space-between;
  font-size: 16px; font-weight: 700; margin-bottom: 14px;
}
.shop-cart-drawer__checkout-btn {
  width: 100%; padding: 13px;
  background: var(--color-primary,#2ECC71);
  color: #fff; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: opacity 0.18s;
}
.shop-cart-drawer__checkout-btn:hover { opacity: 0.88; }

/* ── Cart item ─────────────────────────────────────────────── */
.shop-cart-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}
.shop-cart-item__img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-bg-alt, #f4f4f4);
}
.shop-cart-item__body { flex: 1; min-width: 0; }
.shop-cart-item__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.shop-cart-item__name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-cart-item__variant { font-size: 11px; color: var(--color-text-muted,#888); display: block; margin-top: 2px; }
.shop-cart-item__price { font-size: 13px; font-weight: 700; color: #27ae60; white-space: nowrap; flex-shrink: 0; }
.shop-cart-item__controls {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
}
.shop-cart-item__qty-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1.5px solid var(--color-border,#ddd);
  background: none; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.shop-cart-item__qty { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }
.shop-cart-item__remove {
  background: none; border: none;
  color: var(--color-text-muted,#aaa); font-size: 14px;
  cursor: pointer; margin-left: 4px;
}

/* ── Product detail modal ──────────────────────────────────── */
.shop-detail-modal {
  position: fixed; inset: 0;
  z-index: 1200;
  /* Always display:flex — never display:none.
     Hiding via display:none prevents CSS transitions from firing because
     the element is removed from the layout tree. Instead keep it in the tree
     and rely on pointer-events:none + the inner's translateY(100%) to make
     it invisible and inert when closed. */
  display: flex; align-items: flex-end;
  pointer-events: none;
}
@media (min-width: 768px) {
  .shop-detail-modal { align-items: center; justify-content: center; }
}

.shop-detail-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.shop-detail-modal--open { pointer-events: all; }
.shop-detail-modal--open .shop-detail-modal__backdrop { opacity: 1; pointer-events: all; }

.shop-detail-modal__inner {
  position: relative; z-index: 1;
  background: var(--color-surface,#fff);
  border-radius: 20px 20px 0 0;
  width: 100%; max-height: 93vh;
  /* On mobile, fix the panel to near-full height (92vh) so the loading state
     and the rendered state are the same height. Without this the first press
     opens at 60vh (empty body) then jumps to ~90vh once content renders —
     subsequent presses are fine because the previous product's DOM still fills
     the body and preserves height during loading. */
  min-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
}
@media (min-width: 768px) {
  .shop-detail-modal__inner {
    border-radius: 20px;
    width: 92vw; max-width: 980px;
    max-height: 90vh;
    /* Desktop: centred dialog, let content determine height */
    min-height: 0;
    transform: translateY(24px) scale(0.97);
  }
}
.shop-detail-modal--open .shop-detail-modal__inner {
  transform: translateY(0) scale(1);
}

.shop-detail-modal__topbar {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 16px 20px 0; flex-shrink: 0;
}
.shop-detail-modal__close {
  background: none; border: none;
  font-size: 26px; cursor: pointer;
  color: var(--color-text-muted,#888);
  line-height: 1;
}
.shop-detail-modal__loader {
  text-align: center; padding: 80px 0;
  color: var(--color-primary,#2ECC71);
}
.shop-detail-modal__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  flex: 1;
  overflow-y: auto;
}
@media (min-width: 768px) {
  .shop-detail-modal__body {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ── Detail gallery ────────────────────────────────────────── */
.shop-detail-gallery {
  display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px;
}
@media (min-width: 768px) {
  .shop-detail-gallery { padding: 20px; position: sticky; top: 0; }
}
.shop-detail-gallery__main {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 12px; overflow: hidden;
  background: var(--color-bg-alt,#f4f4f4);
}
.shop-detail-gallery__main-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.shop-detail-gallery__placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--color-text-muted,#aaa); font-size: 14px;
}
.shop-detail-gallery__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.85); border: none;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.18s;
}
.shop-detail-gallery__nav:hover { background: rgba(255,255,255,1); }
.shop-detail-gallery__nav--prev { left: 10px; }
.shop-detail-gallery__nav--next { right: 10px; }
.shop-detail-gallery__counter {
  position: absolute; bottom: 10px; right: 12px;
  background: rgba(0,0,0,0.5); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
}
.shop-detail-gallery__thumbs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
}
.shop-detail-gallery__thumb {
  flex-shrink: 0; width: 58px; height: 58px;
  border-radius: 8px; border: 2px solid transparent;
  overflow: hidden; cursor: pointer; padding: 0;
  background: none; transition: border-color 0.18s;
}
.shop-detail-gallery__thumb img { width:100%; height:100%; object-fit:cover; }
.shop-detail-gallery__thumb--active { border-color: var(--color-primary,#2ECC71); }

/* ── Detail info ───────────────────────────────────────────── */
.shop-detail-info {
  padding: 0 16px 32px;
  display: flex; flex-direction: column; gap: 16px;
}
@media (min-width: 768px) {
  .shop-detail-info { padding: 20px 24px 32px 8px; overflow-y: auto; }
}
.shop-detail-info__name {
  font-size: 22px; font-weight: 700; margin: 0;
  color: var(--color-text,#1a1a1a);
}
.shop-detail-info__meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.shop-detail-info__rating {
  display: flex; align-items: center; gap: 4px;
}
.shop-detail-info__rating-score {
  font-weight: 700; font-size: 14px;
}
.shop-detail-info__rating-count {
  font-size: 13px; color: var(--color-text-muted,#888);
}
.shop-detail-info__stock {
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.shop-detail-info__stock--in  { background:#e8f9f1; color:#1a7a4a; }
.shop-detail-info__stock--low { background:#fff4e5; color:#b45309; }
.shop-detail-info__stock--out { background:#fef2f2; color:#b91c1c; }

.shop-detail-info__pricing {
  display: flex; align-items: baseline; gap: 10px;
}
.shop-detail-info__price {
  font-size: 28px; font-weight: 800; color: var(--color-text,#1a1a1a);
}
.shop-detail-info__price--sale  { color: var(--color-error,#e74c3c); }
.shop-detail-info__price--original {
  font-size: 18px; font-weight: 400;
  text-decoration: line-through;
  color: var(--color-text-muted,#888);
}
.shop-detail-info__discount {
  background: #fef2f2; color: #b91c1c;
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}
.shop-detail-info__short-desc {
  font-size: 14px; line-height: 1.7;
  color: var(--color-text-muted,#555); margin: 0;
}

/* ── Variants ──────────────────────────────────────────────── */
.shop-detail-variants { display: flex; flex-direction: column; gap: 12px; }
.shop-detail-variants__group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shop-detail-variants__label {
  font-size: 13px; font-weight: 600;
  color: var(--color-text,#1a1a1a); min-width: 56px;
  text-transform: capitalize;
}
.shop-detail-variants__options { display: flex; gap: 8px; flex-wrap: wrap; }
.shop-detail-variants__chip {
  padding: 6px 14px; border-radius: 8px;
  border: 1.5px solid var(--color-border,#ddd);
  background: var(--color-surface,#fff);
  font-size: 13px; cursor: pointer; transition: all 0.18s;
}
.shop-detail-variants__chip:hover,
.shop-detail-variants__chip--selected {
  border-color: var(--color-primary,#2ECC71);
  background: #e8f9f1; color: #1a7a4a;
}
.shop-detail-variants__chip[data-stock="0"] {
  opacity: 0.4; cursor: not-allowed;
  text-decoration: line-through;
}

/* ── Add to cart CTA ───────────────────────────────────────── */
.shop-detail-cta {
  display: flex; align-items: center; gap: 12px;
}
.shop-detail-cta__qty {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--color-border,#ddd);
  border-radius: 10px; padding: 6px 12px;
}
.shop-detail-cta__qty-btn {
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--color-text,#1a1a1a); line-height: 1;
}
.shop-detail-cta__qty-val {
  font-size: 16px; font-weight: 700; min-width: 22px; text-align: center;
}
.shop-detail-cta__add-btn {
  flex: 1; padding: 13px 20px;
  border-radius: 10px; border: none;
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.shop-detail-cta__add-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.shop-detail-cta__share-btn {
  width: 46px; height: 46px;
  border-radius: 10px; border: 1.5px solid var(--color-border,#ddd);
  background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted,#888); flex-shrink: 0;
  transition: border-color 0.18s, color 0.18s;
}
.shop-detail-cta__share-btn:hover {
  border-color: var(--color-primary,#2ECC71);
  color: var(--color-primary,#2ECC71);
}

/* ── Detail tabs ───────────────────────────────────────────── */
.shop-detail-tabs { border-top: 1px solid var(--color-border,#eee); padding-top: 16px; }
.shop-detail-tabs__nav {
  display: flex; border-bottom: 1px solid var(--color-border,#eee);
  margin-bottom: 16px; gap: 0;
}
.shop-detail-tabs__tab {
  padding: 10px 18px; border: none; background: none;
  font-size: 14px; font-weight: 600;
  color: var(--color-text-muted,#888); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.18s, border-color 0.18s;
}
.shop-detail-tabs__tab:hover { color: var(--color-text,#1a1a1a); }
.shop-detail-tabs__tab--active {
  color: var(--color-primary,#2ECC71);
  border-bottom-color: var(--color-primary,#2ECC71);
}
.shop-detail-tabs__content {
  font-size: 14px; line-height: 1.8;
  color: var(--color-text,#444);
}
.shop-detail-tabs__row {
  font-size: 14px; margin: 0 0 8px;
  color: var(--color-text,#444);
}
.shop-detail-tabs__empty {
  font-size: 14px; color: var(--color-text-muted,#888);
  padding: 8px 0;
}

/* ── Reviews ───────────────────────────────────────────────── */
.shop-review {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border,#eee);
}
.shop-review:last-of-type { border-bottom: none; }
.shop-review__header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 6px;
}
.shop-review__name { font-size: 14px; font-weight: 700; }
.shop-review__verified {
  display: block; font-size: 11px;
  color: var(--color-primary,#2ECC71); margin-top: 2px;
}
.shop-review__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.shop-review__date { font-size: 11px; color: var(--color-text-muted,#aaa); }
.shop-review__title { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.shop-review__body  { font-size: 14px; color: var(--color-text,#555); margin: 0; line-height: 1.7; }

/* ── Review form ───────────────────────────────────────────── */
.shop-detail-review-form {
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--color-border,#eee);
}
.shop-detail-review-form__title { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.shop-detail-review-form__stars { display: flex; gap: 6px; margin-bottom: 12px; }
.shop-detail-review-form__star {
  background: none; border: none;
  font-size: 26px; cursor: pointer; color: #ddd;
  line-height: 1; padding: 0;
  transition: color 0.15s;
}
.shop-detail-review-form__star--hover,
.shop-detail-review-form__star--selected { color: #f59e0b; }
.shop-detail-review-form__input,
.shop-detail-review-form__textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--color-border,#ddd);
  border-radius: 8px; font-size: 14px;
  background: var(--color-surface,#fff);
  color: var(--color-text,#1a1a1a);
  outline: none; margin-bottom: 10px;
  transition: border-color 0.18s;
  font-family: inherit;
}
.shop-detail-review-form__input:focus,
.shop-detail-review-form__textarea:focus { border-color: var(--color-primary,#2ECC71); }
.shop-detail-review-form__textarea { resize: vertical; min-height: 80px; }
.shop-detail-review-form__submit { padding: 10px 24px; border-radius: 8px; }
.shop-detail-review-form__note {
  font-size: 11px; color: var(--color-text-muted,#aaa); margin: 8px 0 0;
}

/* ── Checkout modal ────────────────────────────────────────── */
.shop-checkout-modal {
  position: fixed; inset: 0; z-index: 1300;
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
}
.shop-checkout-modal--open { display: flex; pointer-events: all; }
.shop-checkout-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.shop-checkout-modal--open .shop-checkout-modal__backdrop { opacity:1; pointer-events:all; }
.shop-checkout-modal__inner {
  position: relative; z-index: 1;
  background: var(--color-surface,#fff);
  border-radius: 16px;
  width: 94%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  padding: 28px 24px;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 8px 48px rgba(0,0,0,0.2);
}
.shop-checkout-modal--open .shop-checkout-modal__inner { transform: none; }
.shop-checkout-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.shop-checkout-modal__title { font-size: 20px; font-weight: 700; margin: 0; }
.shop-checkout-modal__close {
  background: none; border: none;
  font-size: 24px; cursor: pointer;
  color: var(--color-text-muted,#888);
}
.shop-checkout-modal__error {
  background: #fef2f2; color: #b91c1c;
  border-radius: 8px; padding: 10px 14px;
  font-size: 13px; margin-bottom: 12px;
}
.shop-checkout-summary__list {
  list-style: none; padding: 0; margin: 0 0 12px;
  font-size: 13px;
  display: flex; flex-direction: column; gap: 6px;
}
.shop-checkout-summary__item {
  display: flex; justify-content: space-between;
  color: var(--color-text-muted,#555);
}
.shop-checkout-summary__total {
  display: flex; justify-content: space-between;
  font-size: 16px; padding: 10px 0;
  border-top: 1.5px solid var(--color-border,#eee);
  margin-bottom: 20px;
}

/* ── Checkout form ─────────────────────────────────────────── */
.shop-checkout-form { display: flex; flex-direction: column; gap: 12px; }
.shop-checkout-form__field { display: flex; flex-direction: column; gap: 4px; }
.shop-checkout-form__label { font-size: 12px; font-weight: 600; color: var(--color-text-muted,#666); }
.shop-checkout-form__input,
.shop-checkout-form__textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--color-border,#ddd);
  border-radius: 8px; font-size: 14px;
  background: var(--color-surface,#fff);
  color: var(--color-text,#1a1a1a);
  outline: none; font-family: inherit;
  transition: border-color 0.18s;
}
.shop-checkout-form__input:focus,
.shop-checkout-form__textarea:focus { border-color: var(--color-primary,#2ECC71); }
.shop-checkout-form__textarea { resize: vertical; min-height: 70px; }
.shop-checkout-form__optin {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; background: var(--color-bg-alt,#f9f9f9);
  border-radius: 8px;
}
.shop-checkout-form__optin input[type="checkbox"] {
  margin-top: 2px; accent-color: var(--color-primary,#2ECC71);
  width: 16px; height: 16px; flex-shrink: 0;
}
.shop-checkout-form__optin-label { font-size: 13px; line-height: 1.6; color: var(--color-text,#444); }
.shop-checkout-form__optin-label small { display: block; color: var(--color-text-muted,#888); font-size: 11px; }

#co-pay-btn {
  margin-top: 8px; width: 100%;
  padding: 14px; border-radius: 10px; border: none;
  font-size: 16px; font-weight: 700; cursor: pointer;
}

/* ── Toast ─────────────────────────────────────────────────── */
.shop-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a; color: #fff;
  padding: 12px 24px; border-radius: 24px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
  pointer-events: none; z-index: 2000; white-space: nowrap;
}
.shop-toast--visible {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ── Order success page ────────────────────────────────────── */
.shop-success-page {
  max-width: 560px; margin: 60px auto; padding: 0 20px;
  text-align: center;
}
.shop-success-page__icon { font-size: 72px; margin-bottom: 16px; }
.shop-success-page__title { font-size: 28px; font-weight: 800; margin: 0 0 8px; }
.shop-success-page__ref {
  font-family: monospace; font-size: 18px;
  color: var(--color-primary,#2ECC71); margin: 0 0 16px;
}
.shop-success-page__msg { color: var(--color-text-muted,#666); margin-bottom: 28px; }

/* ── Utility ───────────────────────────────────────────────── */
.u-hidden { display: none !important; }

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 480px) {
  .shop-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .shop-page__title { font-size: 20px; }
  .shop-detail-info__name { font-size: 18px; }
  .shop-detail-info__price { font-size: 22px; }
}
