/* =========================================================
   Storefront design system — shared by shop.html & product.html
   ========================================================= */
*{box-sizing:border-box;margin:0;padding:0}
:root{
  /* Brand */
  --green:#14532d;--green-mid:#166534;--green-600:#16a34a;--green-light:#ecfdf3;--green-100:#dcfce7;
  --amber:#b45309;--amber-light:#fef3c7;
  --red:#b91c1c;--red-light:#fee2e2;
  /* Neutrals */
  --gray-50:#f8fafc;--gray-100:#f1f5f9;--gray-200:#e2e8f0;--gray-300:#cbd5e1;
  --gray-400:#94a3b8;--gray-500:#64748b;--gray-600:#475569;--gray-800:#1e293b;--gray-900:#0f172a;
  --white:#ffffff;
  /* Type */
  --font-display:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-body:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  /* Elevation */
  --shadow-sm:0 1px 2px rgba(15,23,42,.06);
  --shadow:0 1px 3px rgba(15,23,42,.08),0 1px 2px rgba(15,23,42,.04);
  --shadow-md:0 4px 12px rgba(15,23,42,.07),0 2px 4px rgba(15,23,42,.04);
  --shadow-lg:0 16px 40px rgba(15,23,42,.12),0 4px 10px rgba(15,23,42,.05);
  --radius:8px;--radius-lg:12px;--radius-xl:16px;
  --container:1240px;
}
html{scroll-behavior:smooth}
body{font-family:var(--font-body);background:var(--gray-50);color:var(--gray-800);min-height:100vh;-webkit-font-smoothing:antialiased;line-height:1.5}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button{cursor:pointer;border:none;background:none;font-family:inherit;color:inherit}
input,select,textarea{font-family:inherit;color:inherit}
:focus-visible{outline:2px solid var(--green-600);outline-offset:2px}
.icon{width:20px;height:20px;flex-shrink:0;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.icon-sm{width:16px;height:16px}
.container{max-width:var(--container);margin:0 auto;padding:0 1.5rem}
.page{display:none}.page.active{display:block;animation:fadeIn .25s ease}
@keyframes fadeIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

/* ---------- ANNOUNCEMENT BAR ---------- */
.topbar{background:var(--gray-900);color:#e2e8f0;font-size:.8rem}
.topbar-inner{max-width:var(--container);margin:0 auto;padding:.5rem 1.5rem;display:flex;align-items:center;justify-content:space-between;gap:1rem}
.topbar a{color:#fff;font-weight:500}
.topbar a:hover{text-decoration:underline}
.topbar-item{display:inline-flex;align-items:center;gap:.4rem}

/* ---------- NAV ---------- */
nav{background:rgba(255,255,255,.92);backdrop-filter:saturate(180%) blur(10px);-webkit-backdrop-filter:saturate(180%) blur(10px);border-bottom:1px solid var(--gray-200);position:sticky;top:0;z-index:100}
.nav-inner{max-width:var(--container);margin:0 auto;padding:0 1.5rem;display:flex;align-items:center;justify-content:space-between;height:68px;gap:1rem}
.logo{display:inline-flex;align-items:center;gap:.6rem;font-size:1.35rem;color:var(--gray-900);font-weight:800;letter-spacing:-.03em}
.logo img{height:36px;width:auto;border-radius:6px}
.logo-mark{width:34px;height:34px;border-radius:9px;background:var(--green);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:1rem;font-weight:800}
.nav-actions{display:flex;align-items:center;gap:.5rem}
.nav-link{display:inline-flex;align-items:center;gap:.45rem;padding:.55rem .9rem;border-radius:var(--radius);font-size:.9rem;font-weight:500;color:var(--gray-600);transition:background .15s,color .15s}
.nav-link:hover{background:var(--gray-100);color:var(--gray-900)}
.cart-btn{position:relative;background:var(--gray-900);color:#fff;padding:.6rem 1.1rem;border-radius:var(--radius);font-size:.9rem;font-weight:600;display:inline-flex;align-items:center;gap:.5rem;transition:background .15s,transform .15s}
.cart-btn:hover{background:var(--green)}
.cart-btn:active{transform:scale(.97)}
.cart-count{background:var(--green-600);color:#fff;border-radius:999px;min-width:20px;height:20px;padding:0 6px;font-size:.72rem;font-weight:700;display:inline-flex;align-items:center;justify-content:center}
.cart-count.bump{animation:bump .35s ease}
@keyframes bump{50%{transform:scale(1.3)}}

/* ---------- HERO ---------- */
.hero{position:relative;overflow:hidden;isolation:isolate;color:#fff;
  background:
    radial-gradient(900px 520px at 88% 8%,rgba(52,211,153,.32),transparent 60%),
    radial-gradient(700px 480px at 8% 110%,rgba(20,184,166,.28),transparent 60%),
    radial-gradient(500px 300px at 55% 50%,rgba(250,204,21,.07),transparent 70%),
    linear-gradient(160deg,#03200f 0%,#064e3b 48%,#065f46 100%)}
/* soft grid lines, faded toward the edges */
.hero::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background-image:linear-gradient(rgba(255,255,255,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.06) 1px,transparent 1px);
  background-size:56px 56px;
  -webkit-mask-image:radial-gradient(ellipse 75% 70% at 60% 40%,#000 20%,transparent 75%);mask-image:radial-gradient(ellipse 75% 70% at 60% 40%,#000 20%,transparent 75%)}
/* blurred glow orbs */
.hero-glow{position:absolute;border-radius:50%;filter:blur(70px);z-index:-1;pointer-events:none;animation:drift 14s ease-in-out infinite alternate}
.hero-glow.g1{width:380px;height:380px;background:rgba(16,185,129,.45);top:-120px;right:8%}
.hero-glow.g2{width:300px;height:300px;background:rgba(45,212,191,.25);bottom:-140px;left:-60px;animation-delay:-5s}
@keyframes drift{to{transform:translate(-30px,25px) scale(1.08)}}
/* thin bottom highlight line */
.hero::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:linear-gradient(90deg,transparent,rgba(110,231,183,.5),transparent)}
.hero-inner{position:relative;z-index:1;max-width:var(--container);margin:0 auto;padding:4.5rem 1.5rem 6rem;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:3rem;align-items:center}
.hero-text{min-width:0}

/* Floating product showcase */
.hero-visual{position:relative;height:340px}
.hv-card{position:absolute;width:190px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.18);border-radius:18px;padding:.6rem;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);box-shadow:0 20px 50px rgba(0,0,0,.35);animation:float 7s ease-in-out infinite;transition:transform .3s}
.hv-card:hover{animation-play-state:paused}
.hv-card .hv-img{aspect-ratio:1;border-radius:12px;overflow:hidden;background:linear-gradient(145deg,rgba(255,255,255,.18),rgba(255,255,255,.05));display:flex;align-items:center;justify-content:center;font-size:3.2rem}
.hv-card .hv-img img{width:100%;height:100%;object-fit:cover}
.hv-card .hv-meta{display:flex;justify-content:space-between;align-items:center;gap:.5rem;padding:.55rem .25rem .15rem;font-size:.78rem}
.hv-card .hv-name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:.95}
.hv-card .hv-price{font-weight:700;color:#6ee7b7;white-space:nowrap}
.hv-card.c1{left:4%;top:40px;transform:rotate(-6deg);animation-delay:0s}
.hv-card.c2{left:36%;top:0;z-index:2;width:210px;animation-delay:-2.3s}
.hv-card.c3{right:0;top:110px;transform:rotate(6deg);animation-delay:-4.6s}
.hv-card.sk-card .hv-img{background:linear-gradient(90deg,rgba(255,255,255,.06) 25%,rgba(255,255,255,.14) 37%,rgba(255,255,255,.06) 63%);background-size:400% 100%;animation:shimmer 1.6s ease infinite}
@keyframes float{0%,100%{translate:0 0}50%{translate:0 -12px}}
.hv-ring{position:absolute;border:1px dashed rgba(255,255,255,.18);border-radius:50%;pointer-events:none}
.hv-ring.r1{width:360px;height:360px;left:50%;top:50%;transform:translate(-50%,-50%)}
.hv-ring.r2{width:240px;height:240px;left:50%;top:50%;transform:translate(-50%,-50%);border-style:solid;border-color:rgba(110,231,183,.15)}
.hero-badge{display:inline-flex;align-items:center;gap:.5rem;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.2);border-radius:999px;padding:.35rem .9rem;font-size:.8rem;font-weight:500;letter-spacing:.02em;margin-bottom:1.25rem}
.hero-badge::before{content:"";width:6px;height:6px;border-radius:50%;background:#4ade80;box-shadow:0 0 0 3px rgba(74,222,128,.25)}
.hero h1{font-size:clamp(1.9rem,4.5vw,3.25rem);font-weight:800;line-height:1.1;letter-spacing:-.035em;max-width:760px;margin-bottom:1.75rem}
.hero-cta{display:flex;gap:.75rem;flex-wrap:wrap}
.btn-hero{display:inline-flex;align-items:center;gap:.5rem;background:#fff;color:var(--green);padding:.8rem 1.4rem;border-radius:var(--radius);font-weight:600;font-size:.95rem;transition:transform .15s,box-shadow .15s}
.btn-hero:hover{transform:translateY(-1px);box-shadow:0 8px 24px rgba(0,0,0,.2)}
.btn-hero-ghost{display:inline-flex;align-items:center;gap:.5rem;color:#fff;padding:.8rem 1.2rem;border-radius:var(--radius);border:1px solid rgba(255,255,255,.3);font-weight:500;font-size:.95rem;transition:background .15s}
.btn-hero-ghost:hover{background:rgba(255,255,255,.1)}

/* ---------- TRUST STRIP ---------- */
.trust{position:relative;z-index:2;max-width:var(--container);margin:-2.5rem auto 0;padding:0 1.5rem}
.trust-inner{background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-xl);box-shadow:var(--shadow-md);display:grid;grid-template-columns:repeat(3,1fr)}
.trust-item{display:flex;align-items:center;gap:.85rem;padding:1.15rem 1.4rem}
.trust-item+.trust-item{border-left:1px solid var(--gray-200)}
.trust-icon{width:40px;height:40px;border-radius:10px;background:var(--green-light);color:var(--green-mid);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.trust-title{font-weight:600;font-size:.9rem;color:var(--gray-900)}
.trust-sub{font-size:.8rem;color:var(--gray-500)}

/* ---------- MAIN / TOOLBAR ---------- */
.main-content{max-width:var(--container);margin:0 auto;padding:3rem 1.5rem 2rem;scroll-margin-top:80px}
.section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;margin-bottom:1.25rem;flex-wrap:wrap}
.section-title{font-size:1.6rem;font-weight:800;letter-spacing:-.025em;color:var(--gray-900)}
.section-sub{font-size:.9rem;color:var(--gray-500);margin-top:.15rem}
.toolbar{display:flex;gap:.75rem;align-items:center;background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-xl);padding:.6rem;box-shadow:var(--shadow-sm);margin-bottom:1rem}
/* The search box is the styled container; the input and the inline sort sit inside it */
.search-bar{position:relative;flex:1;min-width:0;display:flex;align-items:center;height:44px;border:1px solid transparent;border-radius:var(--radius);background:var(--gray-50);transition:border-color .15s,background .15s,box-shadow .15s}
.search-bar:focus-within{background:var(--white);border-color:var(--green-600);box-shadow:0 0 0 3px rgba(22,163,74,.12)}
.search-bar input{flex:1;min-width:0;width:100%;height:100%;padding:0 .75rem 0 2.75rem;border:none;background:transparent;font-size:.95rem;outline:none}
.search-icon{position:absolute;left:.9rem;top:50%;transform:translateY(-50%);color:var(--gray-400);display:flex;pointer-events:none}
.sort-inline{position:relative;flex:none;display:flex;align-items:center;height:28px;margin-right:.35rem;padding-left:.35rem;border-left:1px solid var(--gray-200)}
.sort-inline .sort-icon{position:absolute;left:.85rem;width:16px;height:16px;color:var(--gray-500);pointer-events:none}
.sort-inline select{height:32px;padding:0 1.9rem 0 2.1rem;border:none;border-radius:6px;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .55rem center;appearance:none;-webkit-appearance:none;font-size:.88rem;font-weight:500;color:var(--gray-600);cursor:pointer;outline:none;transition:background-color .15s,color .15s}
.sort-inline select:hover,.sort-inline select:focus-visible{background-color:var(--gray-100);color:var(--gray-900)}
.sort-inline select option{color:var(--gray-800)}
.sort-inline.active select{color:var(--green)}
.sort-inline.active .sort-icon{color:var(--green-600)}
.filter-bar{display:flex;gap:.6rem}
.filter-select{height:44px;min-width:180px;padding:0 2.25rem 0 .9rem;border:1px solid var(--gray-200);border-radius:var(--radius);font-size:.9rem;font-weight:500;background:var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .7rem center;appearance:none;-webkit-appearance:none;cursor:pointer;outline:none;transition:border-color .15s,box-shadow .15s}
.filter-select:hover{border-color:var(--gray-300)}
.filter-select:focus{border-color:var(--green-600);box-shadow:0 0 0 3px rgba(22,163,74,.12)}

/* Category chips (mirror of #categoryFilter) */
.category-tabs{display:flex;gap:.5rem;overflow-x:auto;padding:.25rem 0 .75rem;margin-bottom:1rem;scrollbar-width:none}
.category-tabs::-webkit-scrollbar{display:none}
.cat-tab{padding:.5rem 1rem;border-radius:999px;border:1px solid var(--gray-200);background:var(--white);font-size:.85rem;font-weight:500;color:var(--gray-600);transition:all .15s;white-space:nowrap;flex-shrink:0}
.cat-tab:hover{border-color:var(--gray-400);color:var(--gray-900)}
.cat-tab.active{background:var(--gray-900);color:#fff;border-color:var(--gray-900)}

/* ---------- PRODUCT GRID / CARD ---------- */
.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:1.25rem}
.product-card{position:relative;display:flex;flex-direction:column;background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-xl);overflow:hidden;transition:box-shadow .2s,transform .2s,border-color .2s}
.product-card:hover{box-shadow:var(--shadow-lg);transform:translateY(-3px);border-color:var(--gray-300)}
.product-card .product-media{position:relative;display:block}
.product-card .product-img{width:100%;aspect-ratio:1/1;background:linear-gradient(180deg,var(--gray-50),var(--gray-100));display:flex;align-items:center;justify-content:center;font-size:4.5rem;overflow:hidden}
.product-card .product-img img{width:100%;height:100%;object-fit:cover;transition:transform .5s ease}
.product-card:hover .product-img img{transform:scale(1.05)}
.product-card .badge-wrap{position:absolute;top:.75rem;left:.75rem;display:flex;gap:.35rem}
.stock-badge{font-size:.7rem;font-weight:600;padding:.25rem .55rem;border-radius:6px;background:var(--amber-light);color:var(--amber);letter-spacing:.01em;box-shadow:var(--shadow-sm)}
.stock-badge.out{background:var(--gray-900);color:#fff}
.product-card .product-body{display:flex;flex-direction:column;flex:1;padding:1rem 1rem 1.1rem}
.product-card .product-category{font-size:.7rem;font-weight:600;color:var(--green-600);text-transform:uppercase;letter-spacing:.06em;margin-bottom:.3rem}
.product-card .product-name{font-weight:600;font-size:.98rem;line-height:1.35;color:var(--gray-900);margin-bottom:.3rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.product-card .product-name:hover{color:var(--green)}
.product-card .product-desc{font-size:.82rem;color:var(--gray-500);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:.9rem}
.product-card .product-footer{margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.product-card .product-price{font-size:1.15rem;font-weight:700;color:var(--gray-900);letter-spacing:-.01em}
.product-card .product-unit{font-size:.75rem;color:var(--gray-500);font-weight:500}
.add-btn{display:inline-flex;align-items:center;gap:.35rem;background:var(--green);color:#fff;border-radius:var(--radius);padding:.55rem .9rem;font-size:.85rem;font-weight:600;transition:background .15s,transform .15s;white-space:nowrap}
.add-btn:hover{background:var(--green-mid)}
.add-btn:active{transform:scale(.96)}
.add-btn:disabled,.add-btn.out-of-stock{background:var(--gray-200);color:var(--gray-500);cursor:not-allowed;transform:none}
.qty-control{display:inline-flex;align-items:center;gap:.15rem;background:var(--green-light);border:1px solid var(--green-100);border-radius:var(--radius);padding:.2rem}
.qty-btn{width:30px;height:30px;border-radius:6px;color:var(--green);font-size:1.1rem;font-weight:600;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s}
.qty-btn:hover{background:var(--green);color:#fff}
.qty-num{font-weight:700;font-size:.9rem;min-width:24px;text-align:center;color:var(--gray-900)}
.product-card.out-of-stock .product-img{filter:grayscale(.7);opacity:.7}
.product-card.out-of-stock .product-price{color:var(--gray-400)}

/* Skeleton */
/* load more */
#gridSentinel{height:1px}
.load-more{display:flex;flex-direction:column;align-items:center;gap:.75rem;margin:2.25rem auto 1rem;text-align:center}
.load-more:empty{display:none}
.load-more-text{font-size:.88rem;color:var(--gray-500)}
.load-more-bar{width:220px;max-width:70vw;height:4px;border-radius:999px;background:var(--gray-200);overflow:hidden}
.load-more-bar span{display:block;height:100%;background:var(--green-600);border-radius:inherit;transition:width .3s}
.load-more-btn{margin-top:.35rem;display:inline-flex;align-items:center;gap:.5rem;background:var(--white);color:var(--gray-800);border:1px solid var(--gray-300);border-radius:var(--radius);padding:.75rem 1.6rem;font-size:.92rem;font-weight:600;box-shadow:var(--shadow-sm);transition:border-color .15s,color .15s,background .15s}
.load-more-btn:hover{border-color:var(--green);color:var(--green);background:var(--green-light)}
.load-more-end{font-size:.82rem;color:var(--gray-400);font-weight:500}
.skeleton-card{background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-xl);overflow:hidden}
.skeleton-card .sk-img{aspect-ratio:1/1}
.skeleton-card .sk-body{padding:1rem;display:flex;flex-direction:column;gap:.55rem}
.sk{background:linear-gradient(90deg,var(--gray-100) 25%,var(--gray-200) 37%,var(--gray-100) 63%);background-size:400% 100%;animation:shimmer 1.4s ease infinite;border-radius:6px}
.sk-line{height:12px}.sk-line.w40{width:40%}.sk-line.w80{width:80%}.sk-line.w60{width:60%}
@keyframes shimmer{0%{background-position:100% 50%}100%{background-position:0 50%}}

.empty-state{text-align:center;padding:4.5rem 1rem;color:var(--gray-500);grid-column:1/-1;background:var(--white);border:1px dashed var(--gray-300);border-radius:var(--radius-xl)}
.empty-state-icon{width:56px;height:56px;margin:0 auto 1rem;border-radius:50%;background:var(--gray-100);display:flex;align-items:center;justify-content:center;color:var(--gray-400)}
.empty-state h3{font-size:1.05rem;color:var(--gray-900);margin-bottom:.25rem}
.loading-spinner{text-align:center;padding:2rem;color:var(--gray-400);grid-column:1/-1}

/* ---------- CART SIDEBAR ---------- */
.cart-overlay{position:fixed;inset:0;background:rgba(15,23,42,.45);backdrop-filter:blur(2px);z-index:200;opacity:0;pointer-events:none;transition:opacity .25s}
.cart-overlay.open{opacity:1;pointer-events:auto}
.cart-sidebar{position:fixed;top:0;right:0;bottom:0;width:min(440px,100vw);background:var(--white);z-index:201;transform:translateX(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);display:flex;flex-direction:column;box-shadow:-10px 0 40px rgba(15,23,42,.15)}
.cart-sidebar.open{transform:translateX(0)}
.cart-header{padding:1.15rem 1.5rem;border-bottom:1px solid var(--gray-200);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
.cart-header h2{font-size:1.15rem;font-weight:700;letter-spacing:-.01em;display:flex;align-items:center;gap:.5rem}
.close-btn{width:36px;height:36px;border-radius:var(--radius);display:flex;align-items:center;justify-content:center;color:var(--gray-500);transition:background .15s,color .15s}
.close-btn:hover{background:var(--gray-100);color:var(--gray-900)}
.clear-cart-btn{display:inline-flex;align-items:center;gap:.35rem;font-size:.8rem;font-weight:500;color:var(--gray-500);padding:.4rem .6rem;border-radius:6px;transition:background .15s,color .15s}
.clear-cart-btn:hover{background:var(--red-light);color:var(--red)}
.cart-body{flex:1;overflow-y:auto;padding:.5rem 1.5rem;-webkit-overflow-scrolling:touch}
.cart-empty{text-align:center;padding:4rem 1rem;color:var(--gray-500)}
.cart-empty-icon{width:64px;height:64px;margin:0 auto 1rem;border-radius:50%;background:var(--gray-100);display:flex;align-items:center;justify-content:center;color:var(--gray-400)}
.cart-empty h3{font-size:1rem;color:var(--gray-900);margin-bottom:.25rem}
.cart-item{display:flex;align-items:center;gap:.9rem;padding:1rem 0;border-bottom:1px solid var(--gray-100)}
.cart-item:last-child{border-bottom:none}
.cart-item-icon{width:60px;height:60px;border-radius:var(--radius);background:var(--gray-100);display:flex;align-items:center;justify-content:center;font-size:1.6rem;flex-shrink:0;overflow:hidden}
.cart-item-icon img{width:100%;height:100%;object-fit:cover}
.cart-item-info{flex:1;min-width:0}
.cart-item-name{font-weight:600;font-size:.9rem;color:var(--gray-900);margin-bottom:.15rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cart-item-price{font-size:.8rem;color:var(--gray-500)}
.cart-item-line{font-size:.88rem;font-weight:700;color:var(--gray-900);margin-top:.2rem}
.cart-item-qty{display:inline-flex;align-items:center;gap:.15rem;border:1px solid var(--gray-200);border-radius:var(--radius);padding:.15rem;flex-shrink:0}
.cart-item-qty .qty-btn{width:28px;height:28px;color:var(--gray-600)}
.cart-item-qty .qty-btn:hover{background:var(--gray-100);color:var(--gray-900)}
.cart-footer{padding:1.25rem 1.5rem 1.5rem;border-top:1px solid var(--gray-200);background:var(--gray-50);flex-shrink:0}
.cart-total-row{display:flex;justify-content:space-between;margin-bottom:.6rem;font-size:.9rem;color:var(--gray-600)}
.cart-total-row.big{font-weight:700;font-size:1.15rem;color:var(--gray-900);padding-top:.6rem;border-top:1px dashed var(--gray-300);margin-bottom:1rem}
.cart-note{font-size:.78rem;color:var(--gray-500);text-align:center;margin-top:.75rem}
.checkout-btn{width:100%;min-height:48px;display:flex;align-items:center;justify-content:center;gap:.5rem;background:var(--green);color:#fff;padding:.9rem 1rem;border-radius:var(--radius);font-size:.98rem;font-weight:600;transition:background .15s,transform .15s;text-align:center}
.checkout-btn:hover{background:var(--green-mid)}
.checkout-btn:active{transform:scale(.99)}

/* ---------- CHECKOUT ---------- */
.checkout-wrap{max-width:1080px;margin:0 auto;padding:2.5rem 1.5rem 3rem}
.back-btn{display:inline-flex;align-items:center;gap:.4rem;color:var(--gray-600);font-weight:500;font-size:.9rem;margin-bottom:1.5rem;padding:.35rem .1rem;transition:color .15s}
.back-btn:hover{color:var(--green)}
.steps{display:flex;align-items:center;gap:.6rem;margin-bottom:1.75rem;font-size:.82rem;font-weight:500;color:var(--gray-400);flex-wrap:wrap}
.step{display:inline-flex;align-items:center;gap:.45rem}
.step-dot{width:24px;height:24px;border-radius:50%;border:1.5px solid var(--gray-300);display:inline-flex;align-items:center;justify-content:center;font-size:.72rem;font-weight:700}
.step.done{color:var(--green-mid)}
.step.done .step-dot{background:var(--green-mid);border-color:var(--green-mid);color:#fff}
.step.current{color:var(--gray-900)}
.step.current .step-dot{border-color:var(--gray-900);background:var(--gray-900);color:#fff}
.step-sep{width:32px;height:1px;background:var(--gray-300)}
.checkout-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:1.5rem;align-items:start}
.checkout-card{background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-xl);box-shadow:var(--shadow-sm);padding:2rem}
.checkout-card h2{font-size:1.4rem;font-weight:800;letter-spacing:-.02em;color:var(--gray-900);margin-bottom:.35rem}
.checkout-card .card-sub{font-size:.9rem;color:var(--gray-500);margin-bottom:1.75rem}
.form-group{margin-bottom:1.15rem}
.form-group label{display:block;font-size:.83rem;font-weight:600;color:var(--gray-800);margin-bottom:.4rem}
.form-group label .req{color:var(--red)}
.form-group input,.form-group textarea{width:100%;padding:.75rem .9rem;border:1px solid var(--gray-300);border-radius:var(--radius);font-size:.95rem;transition:border-color .15s,box-shadow .15s;outline:none;background:var(--white);resize:vertical}
.form-group input::placeholder,.form-group textarea::placeholder{color:var(--gray-400)}
.form-group input:focus,.form-group textarea:focus{border-color:var(--green-600);box-shadow:0 0 0 3px rgba(22,163,74,.12)}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.order-summary{position:sticky;top:88px;background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-xl);padding:1.5rem;box-shadow:var(--shadow-sm)}
.order-summary h3{font-size:.8rem;font-weight:700;color:var(--gray-500);margin-bottom:1rem;text-transform:uppercase;letter-spacing:.08em}
#summaryItems{max-height:340px;overflow-y:auto}
.summary-item{display:flex;justify-content:space-between;gap:1rem;font-size:.9rem;padding:.6rem 0;color:var(--gray-600);border-bottom:1px solid var(--gray-100)}
.summary-item span:last-child{font-weight:600;color:var(--gray-900);white-space:nowrap}
.summary-total{display:flex;justify-content:space-between;font-weight:800;padding-top:1rem;margin-top:.5rem;font-size:1.15rem;color:var(--gray-900)}
.summary-assure{margin-top:1.25rem;padding-top:1.25rem;border-top:1px solid var(--gray-200);display:flex;flex-direction:column;gap:.7rem}
.summary-assure div{display:flex;align-items:center;gap:.6rem;font-size:.83rem;color:var(--gray-600)}
.summary-assure .icon{color:var(--green-600)}
.place-order-btn{width:100%;min-height:52px;display:flex;align-items:center;justify-content:center;gap:.5rem;background:var(--green);color:#fff;padding:1rem;border-radius:var(--radius);font-size:1rem;font-weight:600;transition:background .15s,transform .15s;margin-top:.5rem}
.place-order-btn:hover{background:var(--green-mid)}
.place-order-btn:active{transform:scale(.99)}
.place-order-btn:disabled{opacity:.6;cursor:wait;transform:none}
.form-hint{font-size:.78rem;color:var(--gray-500);text-align:center;margin-top:.75rem}

/* OTP */
.otp-wrap{max-width:480px;margin:0 auto;padding:2.5rem 1.5rem 3rem}
.otp-wrap .checkout-card{text-align:center}
.otp-icon{width:56px;height:56px;margin:0 auto 1rem;border-radius:50%;background:var(--green-light);color:var(--green-mid);display:flex;align-items:center;justify-content:center}
#otp-input{font-size:clamp(1.5rem,5vw,2rem)!important;letter-spacing:clamp(.3rem,2vw,.6rem)!important;text-align:center;font-weight:700;padding:.75rem .5rem!important}
#otpTimer{text-align:center;color:var(--gray-400);font-size:.85rem;margin-bottom:1.5rem}

/* ---------- SUCCESS ---------- */
.success-wrap{max-width:520px;margin:4rem auto;padding:2.5rem 2rem;text-align:center;background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-xl);box-shadow:var(--shadow-md)}
.success-icon{width:76px;height:76px;background:var(--green-light);color:var(--green-600);border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 1.5rem;box-shadow:0 0 0 8px rgba(22,163,74,.08);animation:pop .4s cubic-bezier(.2,1.4,.4,1)}
.success-icon .icon{width:36px;height:36px;stroke-width:2.5}
@keyframes pop{from{transform:scale(.5);opacity:0}to{transform:none;opacity:1}}
.success-wrap h2{font-size:1.75rem;font-weight:800;letter-spacing:-.02em;color:var(--gray-900);margin-bottom:.6rem}
.success-wrap p{color:var(--gray-600);line-height:1.6;margin-bottom:.5rem}
.success-order-id{background:var(--gray-50);border:1px dashed var(--gray-300);color:var(--gray-900);font-weight:700;font-size:1.05rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;padding:.6rem 1.4rem;border-radius:var(--radius);display:inline-block;margin:1rem 0}
.success-note{display:inline-flex;align-items:center;gap:.4rem;font-size:.85rem;color:var(--gray-500)}
.continue-btn{display:inline-flex;align-items:center;gap:.5rem;background:var(--gray-900);color:#fff;padding:.85rem 1.75rem;border-radius:var(--radius);font-size:.95rem;font-weight:600;margin-top:1.5rem;transition:background .15s}
.continue-btn:hover{background:var(--green)}

/* ---------- TOAST ---------- */
.toast{position:fixed;bottom:2rem;left:50%;transform:translateX(-50%) translateY(20px);background:var(--gray-900);color:#fff;padding:.8rem 1.25rem;border-radius:var(--radius-lg);font-size:.88rem;font-weight:500;opacity:0;pointer-events:none;transition:all .3s;z-index:500;max-width:min(92vw,420px);box-shadow:var(--shadow-lg)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* ---------- BACK TO TOP ---------- */
.to-top{position:fixed;right:1.25rem;bottom:1.25rem;width:44px;height:44px;border-radius:50%;background:var(--white);border:1px solid var(--gray-200);box-shadow:var(--shadow-md);display:flex;align-items:center;justify-content:center;color:var(--gray-700,#334155);opacity:0;pointer-events:none;transform:translateY(10px);transition:all .25s;z-index:90}
.to-top.show{opacity:1;pointer-events:auto;transform:none}
.to-top:hover{color:var(--green)}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px){
  .hv-card{width:160px}
  .hv-card.c2{width:180px}
}
@media (max-width: 900px){
  .hero-inner{grid-template-columns:1fr}
  .hero-visual{display:none}
  .checkout-grid{grid-template-columns:1fr}
  .order-summary{position:static;order:-1}
  .toolbar{flex-wrap:wrap}
  .search-bar{flex-basis:100%}
  .filter-bar{flex:1}
  .filter-select{flex:1;min-width:0}
}
@media (max-width: 768px){
  .topbar-hide-sm{display:none}
  .topbar-inner{justify-content:center}
  .trust-inner{grid-template-columns:1fr}
  .trust-item+.trust-item{border-left:none;border-top:1px solid var(--gray-200)}
  .trust-item{padding:.85rem 1.1rem}
  .product-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:.85rem}
}
@media (max-width: 600px){
  .container,.nav-inner,.hero-inner,.trust,.main-content,.checkout-wrap,.otp-wrap{padding-left:1rem;padding-right:1rem}
  .nav-inner{height:60px}
  .logo{font-size:1.15rem}
  .logo-mark{width:30px;height:30px}
  .nav-link .label,.cart-btn .label{display:none}
  .cart-btn{padding:.55rem .8rem}
  .hero-inner{padding-top:3rem;padding-bottom:4.5rem}
  .main-content{padding-top:2rem}
  .section-title{font-size:1.3rem}
  .filter-bar{flex-direction:row;gap:.5rem;width:100%}
  .filter-select{font-size:.85rem;padding-left:.7rem}
  /* Category chips already cover category on phones, so drop the duplicate dropdown */
  body:has(#categoryTabs) .toolbar .filter-bar{display:none}
  .toolbar{padding:.5rem}
  /* Sort collapses to an icon button inside the search box; the native picker still opens on tap */
  .sort-inline{padding-left:0;margin-right:.2rem}
  .sort-inline .sort-icon{left:50%;transform:translateX(-50%);width:18px;height:18px}
  .sort-inline select{width:40px;height:36px;padding:0;color:transparent;background-image:none}
  .sort-inline select:hover,.sort-inline select:focus-visible{color:transparent}
  .sort-inline.active select{color:transparent}
  .sort-inline.active::after{content:"";position:absolute;top:2px;right:6px;width:7px;height:7px;border-radius:50%;background:var(--green-600);box-shadow:0 0 0 2px var(--gray-50);pointer-events:none}
  .checkout-card{padding:1.35rem}
  .form-row{grid-template-columns:1fr;gap:0}
  .success-wrap{margin:2rem 1rem;padding:2rem 1.25rem}
  .toast{bottom:1.25rem}
}
@media (max-width: 480px){
  .product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}
  .product-card{border-radius:var(--radius-lg)}
  .product-card .product-body{padding:.7rem .7rem .8rem}
  .product-card .product-desc{display:none}
  .product-card .product-name{font-size:.86rem}
  .product-card .product-price{font-size:1rem}
  .product-card .product-footer{flex-direction:column;align-items:stretch;gap:.5rem}
  .product-card .add-btn{justify-content:center;width:100%;min-height:38px}
  .product-card .qty-control{justify-content:space-between;width:100%}
  .product-card .badge-wrap{top:.5rem;left:.5rem}
  .cart-header,.cart-body,.cart-footer{padding-left:1rem;padding-right:1rem}
  .cart-item-icon{width:50px;height:50px}
}
/* ---------- Mobile polish ---------- */
/* Long company names shouldn't push the cart button off screen */
.logo{min-width:0}
.logo > span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Stop the page behind the cart / contact popup from scrolling */
body:has(.cart-sidebar.open),body:has(.contact-modal.open){overflow:hidden}
/* Notched phones: keep buttons clear of the home indicator */
.cart-footer{padding-bottom:calc(1.5rem + env(safe-area-inset-bottom))}
.to-top{bottom:calc(1.25rem + env(safe-area-inset-bottom))}
@media (max-width: 600px){
  /* iPhone zooms in on inputs smaller than 16px — keep them at 16px */
  .search-bar input,.filter-select,.sort-inline select,.form-group input,.form-group textarea{font-size:16px}
  .hero h1{font-size:clamp(1.5rem,6.5vw,2rem);margin-bottom:1.25rem}
  .hero-cta a,.hero-cta button{flex:1;justify-content:center}
  .trust{margin-top:-2rem}
  .trust-sub{display:none}
  .trust-inner{grid-template-columns:repeat(3,1fr)}
  .trust-item{flex-direction:column;text-align:center;gap:.4rem;padding:.8rem .4rem}
  .trust-item+.trust-item{border-top:none;border-left:1px solid var(--gray-200)}
  .trust-icon{width:34px;height:34px}
  .trust-title{font-size:.72rem;line-height:1.25}
  /* Bigger tap targets */
  .qty-btn{width:34px;height:34px}
  .cart-item-qty .qty-btn{width:32px;height:32px}
  .close-btn{width:40px;height:40px}
  .to-top{right:1rem;width:40px;height:40px}
}
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}
