

:root{
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: rgba(255,255,255,0.75);
  --line: rgba(15, 23, 42, 0.14);
  --text: #0b1220;
  --muted: #475569;
  --accent: #16a34a;
  --accent-2: #065f46;
  --accent-soft: rgba(22, 163, 74, 0.10);
  --shadow: 0 18px 50px rgba(2, 6, 23, 0.10);
  --shadow-soft: 0 10px 28px rgba(2, 6, 23, 0.08);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html, body{ max-width:100%; overflow-x:hidden; }

body{
  margin:0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 10% 0%, rgba(34, 197, 94, 0.18), transparent 55%),
    radial-gradient(900px 600px at 90% 10%, rgba(59, 130, 246, 0.10), transparent 55%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 55%, #f8fafc 100%);
}

a{ color: inherit; text-decoration:none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible{
  outline: 2px solid rgba(22, 163, 74, 0.55);
  outline-offset: 2px;
}

.page{ min-height:100vh; display:flex; flex-direction:column; }
main{ flex:1; }

.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}


.nav-store{
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(22, 163, 74, 0.55);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.95), rgba(6, 95, 70, 0.98));
  box-shadow: 0 14px 28px rgba(22, 163, 74, 0.30);
  color: #ecfdf5 !important;
  display:inline-flex;
  align-items:center;
  gap: 0.4rem;
}
.nav-store:hover, .nav-store:focus-visible{
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(22, 163, 74, 0.34);
}


.store-hero{
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  background:
    radial-gradient(900px 380px at 15% 10%, rgba(22, 163, 74, 0.20), transparent 60%),
    radial-gradient(760px 420px at 85% 0%, rgba(14, 165, 233, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.75));
  backdrop-filter: blur(6px);
}

.store-hero-inner{
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.6rem 1.5rem 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 1.2rem;
  align-items: center;
}

.store-hero-copy h1{
  margin:0 0 0.4rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
}
.store-hero-copy p{
  margin:0 0 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}
.store-hero-badges{
  display:flex;
  flex-wrap:wrap;
  gap:0.45rem;
}
.badge{
  display:inline-flex;
  align-items:center;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.08);
  color: var(--accent-2);
}


.badge[data-tone="warn"]{
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.10);
  color: #9f1239;
}
.badge[data-tone="cool"]{
  border-color: rgba(59, 130, 246, 0.30);
  background: rgba(59, 130, 246, 0.10);
  color: #1d4ed8;
}
.store-hero-actions{
  display:grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
  justify-items: stretch;
}

.search-wrap{ display:block; }
.search-input{
  width:100%;
  padding: 0.75rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
  font-size: 0.95rem;
}

.cart-header-btn{
  display:flex;
  align-items:center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
  font-size: 0.9rem;
  font-weight: 700;
  cursor:pointer;
}
.cart-count{
  min-width: 2ch;
  text-align:center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.22);
  color: var(--accent-2);
  font-weight: 800;
}


.store-layout{
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.6rem 1.5rem 3.2rem;
  display:grid;
  grid-template-columns: minmax(0, 290px) minmax(0, 1fr);
  gap: 1.4rem;
}
.sidebar-card{
  background: var(--surface-2);
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: calc(var(--radius) + 2px);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}
.sidebar-card h2{
  margin: 0 0 0.6rem;
  font-size: 1rem;
}
@media (min-width: 901px){
  .sidebar-card{ position: sticky; top: 92px; }
}

.mobile-cat-bar{ display:none; flex-direction:column; gap:0.55rem; margin:0.2rem 0 0.85rem; }
.mobile-cat-bar[hidden]{ display:none !important; }

.mobile-cat-btn{
  width:100%;
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: rgba(255,255,255,0.90);
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--text);
  cursor: pointer;
  text-align:left;
}
.mobile-cat-btn.current{
  background: rgba(22, 163, 74, 0.10);
  border-color: rgba(22, 163, 74, 0.40);
  color: var(--accent-2);
  cursor: default;
  opacity: 0.95;
}

.category-list{ list-style:none; padding:0; margin:0; font-size:0.9rem; }
.category-group{ margin-top: 0.4rem; }
.category-group-btn{
  width:100%;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.40);
  background: rgba(255,255,255,0.85);
  text-align:left;
  cursor:pointer;
  font-weight: 800;
  color: var(--text);
  display:flex;
  align-items:center;
  justify-content: space-between;
}
.category-group-btn:hover{ border-color: rgba(22, 163, 74, 0.45); }
.category-group-btn .chev{ color: var(--muted); font-weight: 900; margin-left: 0.75rem; }

.subcategory-list{ list-style:none; margin: 0.35rem 0 0.85rem; padding: 0 0 0 0.5rem; }
.subcategory-list li{ margin: 0.25rem 0; }

.category-btn{
  width:100%;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  text-align:left;
  cursor:pointer;
  color: var(--muted);
}
.category-btn:hover{ background: rgba(15, 23, 42, 0.03); }
.category-btn.active{
  border-color: rgba(22, 163, 74, 0.40);
  background: rgba(22, 163, 74, 0.10);
  color: var(--accent-2);
}
.category-btn span.count{ float:right; color: rgba(100,116,139,0.9); }


.store-main{ display:flex; flex-direction:column; gap: 0.9rem; min-width:0; }
.results-header{
  display:flex;
  align-items:center;
  gap: 0.75rem;
  flex-wrap:wrap;
}
.results-header h2{
  margin:0;
  font-size: 1.1rem;
}
.results-meta{
  margin-left:auto;
  font-size: 0.9rem;
  color: var(--muted);
}
.sort-select{
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  font-size: 0.88rem;
  background: rgba(255,255,255,0.92);
}

.store-grid{
  margin-top: 0.25rem;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}

.card{
  background: rgba(255,255,255,0.92);
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(148, 163, 184, 0.34);
  box-shadow: var(--shadow-soft);
}


.product-card{
  padding:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height: 100%;
  transform: translateZ(0);
  transition: transform 140ms ease-out, box-shadow 140ms ease-out, border-color 140ms ease-out;
}
.product-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(22, 163, 74, 0.30);
}

.product-thumb{
  position:relative;
  width:100%;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(500px 260px at 25% 20%, rgba(22, 163, 74, 0.14), transparent 60%),
    radial-gradient(420px 220px at 90% 10%, rgba(59, 130, 246, 0.10), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.95));
  border-bottom: 1px solid rgba(148, 163, 184, 0.30);
  overflow:hidden;
}
.product-thumb img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
  transition: transform 160ms ease-out, filter 160ms ease-out;
}
.product-card:hover .product-thumb img{
  transform: scale(1.03);
}

.product-thumb-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  background: linear-gradient(180deg, rgba(2,6,23,0.10), rgba(2,6,23,0.25));
  transition: opacity 140ms ease-out;
}
.product-thumb:focus-within .product-thumb-overlay,
.product-thumb:hover .product-thumb-overlay{
  opacity:1;
}

.product-thumb-cta{
  border-radius: 999px;
}

.product-body{
  display:flex;
  flex-direction:column;
  gap: 0.35rem;
  padding: 0.95rem 1rem 1rem;
  flex:1;
  min-width:0;
}

.product-title{
  display:inline-block;
  font-weight: 850;
  letter-spacing: -0.01em;
}
.product-card h3{
  margin:0;
  font-size: 1.0rem;
  line-height: 1.25;
}

.product-meta{
  font-size: 0.82rem;
  color: var(--muted);
}

.product-badges{
  display:flex;
  flex-wrap:wrap;
  gap: 0.35rem;
  margin-top: 0.1rem;
}
.product-badges .badge{
  font-size: 0.72rem;
  padding: 0.22rem 0.55rem;
}

.product-desc{
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0.15rem 0 0.25rem;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.product-price{
  font-weight: 900;
  font-size: 1.02rem;
  margin-top:auto;
}
.product-price small{
  font-weight: 700;
  color: var(--muted);
}

.product-actions{
  display:flex;
  flex-wrap:wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}


.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.86rem;
  cursor:pointer;
  white-space:nowrap;
  user-select:none;
  transition: transform 120ms ease-out, background-color 140ms ease-out, border-color 140ms ease-out, box-shadow 140ms ease-out;
}
.btn-sm{ padding: 0.48rem 0.85rem; font-size: 0.84rem; }
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.98), rgba(6, 95, 70, 0.98));
  border-color: rgba(22, 163, 74, 0.65);
  color: #ecfdf5;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.20);
}
.btn-primary:hover{
  box-shadow: 0 14px 34px rgba(22, 163, 74, 0.26);
}
.btn-outline{
  background: rgba(255,255,255,0.92);
  border-color: rgba(148, 163, 184, 0.55);
  color: var(--text);
  font-weight: 800;
}
.btn-outline:hover{
  border-color: rgba(22, 163, 74, 0.45);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.08);
}

.btn[disabled]{ opacity:0.55; cursor:not-allowed; transform:none; }


.cart-panel{
  position:fixed;
  inset:0;
  background: rgba(2, 6, 23, 0.52);
  display:none;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 60;
}
.cart-panel.open{ display:flex; }

.cart-inner{
  width:100%;
  max-width: 460px;
  height: 100%;
  background: rgba(255,255,255,0.96);
  border-left: 1px solid rgba(148, 163, 184, 0.40);
  box-shadow: -24px 0 55px rgba(2, 6, 23, 0.40);
  padding: 1.2rem 1.1rem 1.3rem;
  display:flex;
  flex-direction:column;
  max-height: 100vh;
}
.cart-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}
.cart-header h2{
  margin:0;
  font-size: 1.1rem;
}

.cart-items{ flex:1; overflow:auto; padding-right: 0.3rem; margin-bottom: 0.65rem; }
.cart-row{
  display:flex;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 0.9rem;
}
.cart-name{ font-weight: 800; }
.cart-controls{ text-align:right; white-space:nowrap; }
.cart-qty{ display:inline-flex; align-items:center; gap:0.35rem; margin-top:0.25rem; }
.cart-qty button{
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: rgba(248,250,252,0.95);
  cursor:pointer;
}
.cart-remove{
  margin-top: 0.35rem;
  font-size: 0.8rem;
  background: transparent;
  border:none;
  color: #b91c1c;
  cursor:pointer;
}
.cart-footer{
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  padding-top: 0.75rem;
  font-size: 0.95rem;
}
.cart-footer-row{ display:flex; justify-content: space-between; margin-bottom: 0.55rem; }
.cart-checkout-note{ margin: 0.55rem 0 0; color: var(--muted); font-size: 0.85rem; line-height:1.35; }


.toast{
  position: fixed;
  left: 50%;
  bottom: calc(1.1rem + 72px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.92);
  color: #e5e7eb;
  font-size: 0.88rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.55);
  opacity: 0;
  pointer-events:none;
  transition: opacity 150ms ease-out, transform 150ms ease-out;
  z-index: 9999;
}
.toast.show, .toast.toast-show{
  opacity:1;
  transform: translateX(-50%) translateY(0);
}

.scroll-top{
  position:fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: rgba(255,255,255,0.92);
  font-size: 0.84rem;
  font-weight: 900;
  color: var(--text);
  cursor:pointer;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.18);
  opacity:0;
  transform: translateY(10px);
  pointer-events:none;
  transition: opacity 140ms ease-out, transform 140ms ease-out;
  z-index: 55;
}
.scroll-top.show{
  opacity:1;
  transform: translateY(0);
  pointer-events:auto;
}


@media (max-width: 900px){
  .store-hero-inner{ grid-template-columns: 1fr; padding: 1.25rem 1rem 1rem; }
  .store-layout{ grid-template-columns: 1fr; padding: 1.25rem 1rem 3rem; }
  .mobile-cat-bar{ display:flex; }
  .sidebar-card.mobile-collapsed h2{ display:none; }
  .sidebar-card.mobile-collapsed #category-list{ display:none; }
  .cart-inner{ max-width: 100%; }
}

@media (max-width: 520px){
  .product-actions{ gap: 0.4rem; }
  .btn{ width:100%; }
  #cart-toggle{ width: 100%; }
  .results-meta{ margin-left: 0; }
}
