:root{
  --shop-gap:16px;
}

/* Ecommerce themes provide extra accent palettes (UI is shared across themes). */
body.theme-ecommerce-1{
  --bg0:#f8fafc;
  --bg1:#f8fafc;
  --gold:#16a34a;
  --gold2:#22c55e;
  --gold-rgb:22,163,74;
  --gold2-rgb:34,197,94;
}
body.theme-ecommerce-2{
  --bg0:#f7fbff;
  --bg1:#f7fbff;
  --gold:#2563eb;
  --gold2:#60a5fa;
  --gold-rgb:37,99,235;
  --gold2-rgb:96,165,250;
}
body.theme-ecommerce-3{
  --bg0:#fbf7ff;
  --bg1:#fbf7ff;
  --gold:#7c3aed;
  --gold2:#a78bfa;
  --gold-rgb:124,58,237;
  --gold2-rgb:167,139,250;
}

body.ui-modern .bg-graph{
  display:none;
}

body.ui-modern .slideshow{
  margin-top:14px;
}
body.ui-modern .slideshow-slide img{
  height: clamp(220px, 32vw, 380px);
}

body.theme-soft.ui-modern .slideshow{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow-soft);
}
body.theme-soft.ui-modern .slideshow-slide::after{
  background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.42));
}
body.theme-soft.ui-modern .slideshow-caption{
  background: rgba(255,255,255,.78);
  border:1px solid var(--stroke);
}
body.theme-soft.ui-modern .slideshow-text{
  color: var(--muted);
}
body.theme-soft.ui-modern .slideshow-nav{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.65);
  color: var(--text);
}
body.theme-soft.ui-modern .slideshow-nav:hover{
  background: rgba(255,255,255,.92);
  border-color: rgba(var(--gold-rgb),.30);
}
body.theme-soft.ui-modern .slideshow-dot{
  border:1px solid var(--stroke);
  background: rgba(15,23,42,.12);
}

.nav-links.shop-nav{
  gap:14px;
}
.shop-search-toggle{
  display:none;
}
.shop-search-icon{
  width:18px;
  height:18px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.shop-search-icon svg{
  width:18px;
  height:18px;
  display:block;
}
.shop-search-text{white-space:nowrap}
.shop-nav-search{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 340px;
  max-width:540px;
}
@media (min-width: 941px){
  .shop-nav-search{display:none}
  .shop-search-toggle{display:inline-flex}
}
.shop-nav-search-input{
  flex:1 1 auto;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:var(--panel2);
  color:var(--text);
  font-size:14px;
}
.shop-nav-search-input:focus{
  outline:2px solid rgba(var(--gold-rgb),.35);
  outline-offset:2px;
  background:var(--panel2);
}

.shop-search-popup{
  position:fixed;
  top:0;
  right:0;
  bottom:0;
  left:0;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:1200;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
}
.shop-search-popup.is-open{display:flex}
.shop-search-popup .popup-backdrop{
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  left:0;
  inset:0;
  background: rgba(6,9,19,.65);
  backdrop-filter: blur(6px);
}
.shop-search-popup .popup-card{
  position:relative;
  width:92vw;
  max-width:560px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  padding:20px;
  z-index:1;
  display:flex;
  flex-direction:column;
}
.shop-search-popup-form{
  display:grid;
  gap:12px;
}
.shop-search-popup-actions{
  display:flex;
  justify-content:flex-end;
}

.shop-hero{
  padding:28px 0 8px;
}
.shop-hero-head{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:0 0 14px;
}
.shop-title{
  margin:0;
  font-family: var(--font-display);
  font-weight:700;
  letter-spacing:.2px;
  line-height:1.06;
  font-size:46px;
}
.shop-sub{
  margin:0;
  color: var(--muted);
  max-width: 58ch;
}

.shop-search{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 0 0;
}
.shop-search-input{
  flex:1 1 360px;
  padding:14px 16px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:var(--panel2);
  color:var(--text);
  font-size:15px;
  outline:none;
}
.shop-search-input:focus{
  outline:2px solid rgba(var(--gold-rgb),.35);
  outline-offset:2px;
  background:var(--panel2);
}

.shop-categories{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:14px 0 0;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:var(--panel);
  color:var(--text);
  font-size:13px;
  font-weight:600;
  letter-spacing:.2px;
  text-decoration:none;
}
.chip:hover{
  text-decoration:none;
  background:var(--panel2);
}
.chip.active{
  border-color: rgba(var(--gold-rgb),.28);
  background: linear-gradient(135deg, rgba(var(--gold-rgb),.16), rgba(var(--gold2-rgb),.10));
}
.chip.is-empty{
  opacity:.55;
}
.chip-count{
  font-variant-numeric: tabular-nums;
  opacity:.75;
}

.shop-pagination{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  margin:18px 0 0;
}
.shop-pagination .chip{
  min-width:40px;
  justify-content:center;
}

.shop-results-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:0 0 18px;
}
.shop-kicker{
  color: var(--muted);
  font-size:13px;
  margin:0 0 4px;
}
.shop-h2{
  margin:0;
  font-size:28px;
  letter-spacing:.2px;
}
.shop-meta{
  color: var(--muted);
  font-size:13px;
  font-variant-numeric: tabular-nums;
}

.shop-category-description{
  margin:6px 0 0;
  max-width: 72ch;
  color: var(--muted);
  font-size:13px;
  line-height:1.7;
}

.shop-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--shop-gap);
}
.shop-grid.shop-grid-wide{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-card{
  border-radius: var(--radius2);
  overflow:hidden;
  background: var(--panel2);
  border:1px solid rgba(var(--gold-rgb),.14);
  box-shadow: var(--shadow-soft);
  display:flex;
  flex-direction:column;
  min-height: 100%;
}
body.theme-ecommerce-2 .shop-card{
  border-radius: 20px;
}
body.theme-ecommerce-3 .shop-card{
  box-shadow: 0 18px 50px rgba(var(--gold-rgb),.10);
}

.shop-card-media{
  display:block;
  aspect-ratio: 16 / 9;
  background: rgba(var(--gold-rgb),.06);
}
.shop-card-media img,
.shop-card-placeholder{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}
.shop-card-placeholder{
  background:
    radial-gradient(600px 240px at 20% 20%, rgba(var(--gold-rgb),.14), transparent 60%),
    linear-gradient(135deg, rgba(var(--gold-rgb),.08), rgba(var(--gold2-rgb),.06));
}
.shop-card-body{
  padding:14px 14px 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.shop-card-top{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
}
.shop-card-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.shop-card-price{
  text-align:right;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.shop-card-price .num{
  font-family: var(--font-number);
  font-weight:800;
}
.shop-card-price .per{
  font-size:12px;
  color: var(--muted);
}
.shop-card-title{
  margin:0;
  font-size:18px;
  line-height:1.25;
}
.shop-card-title a{
  color:inherit;
  text-decoration:none;
}
.shop-card-title a:hover{
  text-decoration:underline;
}
.shop-card-features{
  margin:0;
  padding-left:18px;
  color: var(--muted);
  font-size:13px;
}
.shop-card-features li{
  margin:0 0 6px;
}
.shop-card-actions{
  margin-top:auto;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
}

.shop-layout{
  display:grid;
  grid-template-columns: 260px 1fr;
  gap:18px;
  align-items:start;
}
.shop-sidebar{
  position:sticky;
  top: calc(88px + env(safe-area-inset-top) + 12px);
  align-self:start;
}
.shop-side-title{
  margin:0 0 10px;
  font-size:13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing:.14em;
}
.shop-side-links{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.shop-side-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:var(--panel);
  color:var(--text);
  text-decoration:none;
  font-weight:600;
  font-size:14px;
}
.shop-side-link:hover{
  background:var(--panel2);
  text-decoration:none;
}
.shop-side-link.active{
  border-color: rgba(var(--gold-rgb),.28);
  background: linear-gradient(135deg, rgba(var(--gold-rgb),.14), rgba(var(--gold2-rgb),.10));
}
.shop-side-link.is-empty{
  opacity:.55;
}
.shop-side-link .count{
  color: var(--muted);
  font-weight:700;
  font-variant-numeric: tabular-nums;
}
.shop-main-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:0 0 12px;
}
.shop-main-head .shop-sub{
  margin-top:6px;
}
.shop-main .shop-title{
  font-size:40px;
}

.shop-category-cards{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
  margin:14px 0 0;
}
.shop-cat-card{
  border:1px solid var(--stroke);
  border-radius: var(--radius2);
  background:var(--panel);
  padding:14px 14px 16px;
  text-decoration:none;
  color:var(--text);
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height: 96px;
}
.shop-cat-card:hover{
  background:var(--panel2);
  text-decoration:none;
}
.shop-cat-card.active{
  border-color: rgba(var(--gold-rgb),.28);
  background: linear-gradient(135deg, rgba(var(--gold-rgb),.14), rgba(var(--gold2-rgb),.10));
}
.shop-cat-card.is-empty{
  opacity:.55;
}
.shop-cat-card .name{
  font-weight:700;
}
.shop-cat-card .count{
  margin-top:auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.shop-breadcrumb{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin:0 0 14px;
  color: var(--muted);
  font-size:13px;
}
.shop-breadcrumb a{
  color:inherit;
  opacity:.9;
  text-decoration:none;
}
.shop-breadcrumb a:hover{
  opacity:1;
  text-decoration:underline;
}
.shop-breadcrumb .sep{
  opacity:.6;
}
.shop-breadcrumb .current{
  color: var(--text);
  font-weight:600;
}

.product-grid{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap:18px;
  align-items:start;
}
.product-media{
  border-radius: var(--radius2);
  overflow:hidden;
  background: var(--panel2);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow-soft);
}
.product-media img{
  width:100%;
  height:auto;
  display:block;
  aspect-ratio: 16 / 10;
  object-fit:cover;
}
.product-media-placeholder{
  width:100%;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(700px 280px at 20% 20%, rgba(var(--gold-rgb),.18), transparent 60%),
    linear-gradient(135deg, rgba(var(--gold-rgb),.08), rgba(var(--gold2-rgb),.06));
}
.product-thumbs{
  display:flex;
  gap:10px;
  padding:12px;
  border-top:1px solid var(--stroke);
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  background: var(--panel);
}
.product-thumb{
  width:86px;
  height:60px;
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--stroke);
  flex:0 0 auto;
  background: var(--panel);
}
.product-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.product-info{
  padding:6px 0;
}
.product-title{
  margin:0 0 10px;
  font-size:38px;
  line-height:1.08;
  font-family: var(--font-display);
}
.product-meta-line{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.product-price-row{
  display:flex;
  gap:14px;
  align-items:baseline;
  margin:14px 0 6px;
}
.product-price-row .num{
  font-family: var(--font-number);
  font-weight:900;
  font-size:30px;
}
.product-price-row .per{
  color: var(--muted);
  font-size:14px;
}
.product-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:14px 0 12px;
}
.product-h{
  margin:0 0 10px;
  font-size:14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing:.12em;
}
.product-section{
  margin-top:18px;
}

@media (max-width: 980px){
  .shop-grid{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .shop-grid.shop-grid-wide{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .shop-layout{grid-template-columns: 1fr}
  .shop-sidebar{position:static}
  .shop-side-links{
    flex-direction:row;
    overflow:auto;
    padding-bottom:6px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .shop-side-link{
    flex:0 0 auto;
    white-space:nowrap;
    justify-content:flex-start;
    scroll-snap-align: start;
  }
  .shop-side-link .count{
    margin-left:8px;
  }
  .shop-category-cards{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .product-grid{grid-template-columns: 1fr}
  .product-title{font-size:34px}
}

@media (max-width: 560px){
  :root{--shop-gap:12px}
  .shop-title{font-size:38px}
  .shop-grid{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .shop-grid.shop-grid-wide{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .shop-category-cards{grid-template-columns: 1fr}
  .shop-results-head{flex-direction:column; align-items:flex-start}
  .product-title{font-size:32px}
  .shop-card-body{padding:12px}
  .shop-card-title{font-size:16px}
  .shop-card-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .shop-card-actions > a,
  .shop-card-actions > form{
    width:100%;
  }
  .shop-card-actions > a.btn{
    justify-content:center;
  }
  .shop-card-actions > form .btn{
    width:100%;
    justify-content:center;
  }
  .product-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .product-actions > a,
  .product-actions > form{
    width:100%;
  }
  .product-actions > a.btn{
    justify-content:center;
  }
  .product-actions > form .btn{
    width:100%;
    justify-content:center;
  }
  .product-thumbs{
    gap:8px;
    padding:10px;
  }
  .product-thumb{
    width:72px;
    height:50px;
    border-radius:12px;
  }
  body.ui-modern .slideshow-slide img{height: 220px}
}
