/* ==========================================================================
   Storefront — light theme
   ========================================================================== */
body.shop {
  --bg: #F5F7FA; --card: #FFFFFF; --line: #E4E8EE; --text: #1B2433; --muted: #667085;
  --primary: #1565D8; --primary-dark: #0F4FAD; --primary-soft: #EAF2FD;
  --sale: #E5483D; --price: #111827; --star: #F5A524;
  --copper: #1565D8;
  background: var(--bg); color: var(--text);
}
.shop .btn-primary { background: var(--primary); }
.shop .btn-primary:hover { background: var(--primary-dark); }
.shop .btn-dark { background: #1B2433; }
.shop .link { color: var(--primary); }
.shop .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21, 101, 216, .15); }
.shop .check input { accent-color: var(--primary); }
.shop .panel { border-color: var(--line); }

/* Top bar */
.topbar { background: #EEF2F7; color: var(--muted); font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; flex-wrap: wrap; }
.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--primary); }
.topbar .links { display: flex; gap: 16px; }
@media (max-width: 700px) { .topbar .links { display: none; } .topbar .wrap { justify-content: center; text-align: center; } }

/* Header */
.shop-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.shop-header .bar { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.shop-header .brand { color: var(--text); }
.shop-search { flex: 1; display: flex; max-width: 640px; }
.shop-search input { flex: 1; min-width: 0; height: 44px; border: 2px solid var(--primary); border-right: 0; border-radius: 8px 0 0 8px; padding: 0 14px; font: 15px var(--font); color: var(--text); }
.shop-search input:focus { outline: none; }
.shop-search button { height: 44px; padding: 0 20px; border: 0; background: var(--primary); color: #fff; font: 600 14px var(--font); border-radius: 0 8px 8px 0; cursor: pointer; }
.shop-search button:hover { background: var(--primary-dark); }
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.hact { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; font-weight: 500; position: relative; white-space: nowrap; }
.hact:hover { background: var(--bg); }
button.hact { border: 0; background: none; cursor: pointer; font: inherit; }
.hact svg { width: 22px; height: 22px; flex-shrink: 0; }
.hact small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; line-height: 1.1; }
.hact .count { position: absolute; top: 2px; left: 24px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sale); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.shop-nav { background: var(--card); border-bottom: 1px solid var(--line); }
.shop-nav .wrap { display: flex; align-items: center; gap: 2px; min-height: 46px; }
.shop-nav .menu-item { position: relative; }
.shop-nav .menu-item > a { display: block; padding: 12px 12px; text-decoration: none; color: var(--text); font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.shop-nav .menu-item > a:hover, .shop-nav .menu-item:focus-within > a { color: var(--primary); }
.shop-nav .all > a { background: var(--primary); color: #fff !important; border-radius: 6px; padding: 8px 14px; margin-right: 8px; }
.shop-nav .sub { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgba(16, 24, 40, .12); padding: 6px; z-index: 50; }
.shop-nav .menu-item:hover .sub, .shop-nav .menu-item:focus-within .sub { display: block; }
.shop-nav .sub a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text); font-size: 14px; }
.shop-nav .sub a:hover { background: var(--primary-soft); color: var(--primary); }
.shop-nav .more { margin-left: auto; display: flex; }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .shop-header .bar { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; min-height: 0; }
  .shop-search { order: 3; flex-basis: 100%; max-width: none; }
  .hact span.lbl { display: none; }
  .menu-toggle { display: flex; }
  .shop-nav { display: none; }
  .shop-nav.open { display: block; }
  .shop-nav .wrap { flex-direction: column; align-items: stretch; padding: 8px 20px 14px; }
  .shop-nav .all > a { margin: 0 0 6px; text-align: center; }
  .shop-nav .sub { display: block; position: static; border: 0; box-shadow: none; padding: 0 0 0 14px; }
  .shop-nav .more { margin-left: 0; flex-direction: column; }
}

/* Hero */
.shop-hero { background: linear-gradient(120deg, #EAF2FD 0%, #F7FAFF 55%, #FFF4EC 100%); border-bottom: 1px solid var(--line); }
.shop-hero .wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: center; padding-top: 48px; padding-bottom: 48px; }
.shop-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.08; margin-bottom: 14px; color: #0F1B33; }
.shop-hero p { color: var(--muted); font-size: 1.08rem; max-width: 52ch; margin-bottom: 24px; }
.hero-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-cats a { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 14px; }
.hero-cats a:hover { border-color: var(--primary); color: var(--primary); }
.hero-cats img, .hero-cats .ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--bg); flex-shrink: 0; }
@media (max-width: 860px) { .shop-hero .wrap { grid-template-columns: 1fr; padding-top: 28px; padding-bottom: 28px; } }

.perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.perk { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.perk svg { width: 30px; height: 30px; color: var(--primary); flex-shrink: 0; }
.perk strong { display: block; font-size: 14px; }
.perk span { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .perks { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .perks { grid-template-columns: 1fr; } }

.shop-section { padding-top: 40px; }
.shop-section .head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.shop-section .head h2 { font-size: 1.45rem; margin: 0; }

.cat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.cat-tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px; text-align: center; text-decoration: none; color: var(--text); font-weight: 600; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.cat-tile:hover { border-color: var(--primary); box-shadow: 0 6px 18px rgba(21, 101, 216, .10); color: var(--primary); }
.cat-tile img, .cat-tile .ph { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 8px; margin-bottom: 8px; background: var(--bg); }
@media (max-width: 1000px) { .cat-tiles { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .cat-tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; } .cat-tile { font-size: 12.5px; padding: 8px 6px; } }

/* Product grid & card */
.pgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.pgrid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1150px) { .pgrid, .pgrid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .pgrid, .pgrid.cols-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .pgrid, .pgrid.cols-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; position: relative; transition: box-shadow .15s, border-color .15s; min-width: 0; }
.pcard:hover { box-shadow: 0 10px 28px rgba(16, 24, 40, .10); border-color: #D0D7E2; }
.pcard .img { display: block; aspect-ratio: 1; background: #fff; padding: 10px; }
.pcard .img img, .ph-img { width: 100%; height: 100%; object-fit: contain; }
.ph-img { display: grid; place-items: center; background: var(--bg); border-radius: 8px; color: #AEB7C4; }
.ph-img svg { width: 40%; height: 40%; }
.pcard .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard .brand-name { font-size: 12px; color: var(--muted); text-transform: none; }
.pcard .name { font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.pcard .name:hover { color: var(--primary); }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font-size: 1.15rem; font-weight: 700; color: var(--price); font-variant-numeric: tabular-nums; }
.price.sale { color: var(--sale); }
.was { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.stock { font-size: 12.5px; font-weight: 600; }
.stock.ok { color: #16803C; } .stock.warn { color: #B45309; } .stock.bad { color: var(--sale); } .stock.info { color: var(--primary); }
.pcard form.add { margin-top: auto; }
.pcard .add .btn { width: 100%; min-height: 36px; font-size: 13.5px; }
.tag-sale { position: absolute; top: 10px; left: 10px; background: var(--sale); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; z-index: 2; }
.tag-feat { position: absolute; top: 10px; right: 10px; background: #FFF4EC; color: #C2410C; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }

.brand-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.brand-strip a { background: #fff; border: 1px solid var(--line); border-radius: 10px; height: 72px; display: grid; place-items: center; text-decoration: none; color: var(--text); font-weight: 700; padding: 10px; }
.brand-strip a:hover { border-color: var(--primary); color: var(--primary); }
.brand-strip img { max-height: 44px; max-width: 100%; object-fit: contain; }
@media (max-width: 800px) { .brand-strip { grid-template-columns: repeat(3, 1fr); } }

/* Catalog */
.crumbs-line { font-size: 13px; color: var(--muted); margin: 18px 0 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs-line a { color: var(--muted); text-decoration: none; }
.crumbs-line a:hover { color: var(--primary); }
.catalog { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; }
.filters-side { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; position: sticky; top: 132px; }
.filters-side h3 { font-size: 14px; margin: 16px 0 8px; }
.filters-side h3:first-child { margin-top: 0; }
.filters-side .check { font-size: 14px; margin: 5px 0; }
.filters-side .cat-links a { display: block; padding: 5px 0; text-decoration: none; color: var(--text); font-size: 14px; }
.filters-side .cat-links a:hover, .filters-side .cat-links a.on { color: var(--primary); }
.filters-side .price-inputs { display: flex; gap: 6px; align-items: center; }
.filters-side .price-inputs .input { min-height: 36px; padding: 6px 8px; }
.list-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.list-top h1 { font-size: 1.5rem; margin: 0; }
.list-top .input { min-height: 38px; width: auto; }
.filters-toggle { display: none; }
@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; }
  .filters-side { display: none; position: static; }
  .filters-side.open { display: block; }
  .filters-toggle { display: inline-flex; }
}
.shop .pagination { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-top: 16px; }
.shop .pagination span.cur { background: var(--primary); border-color: var(--primary); }

/* Product page */
.pdp { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.gallery .main { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: #fff; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery .thumbs button { width: 68px; height: 68px; border: 2px solid var(--line); border-radius: 8px; padding: 3px; background: #fff; cursor: pointer; }
.gallery .thumbs button.on { border-color: var(--primary); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pdp h1 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-bottom: 8px; }
.pdp .meta-line { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.pdp .meta-line a { color: var(--primary); text-decoration: none; }
.pdp .price-box { background: var(--bg); border-radius: 12px; padding: 16px; margin: 14px 0; }
.pdp .price-box .price { font-size: 2rem; }
.pdp .short { color: #384253; }
.buy-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 48px; }
.qty button { width: 42px; border: 0; background: var(--bg); font-size: 20px; cursor: pointer; color: var(--text); }
.qty input { width: 56px; border: 0; text-align: center; font: 600 16px var(--font); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy-row .btn { min-height: 48px; padding: 0 22px; }
.btn-buy { background: #F26B1D; color: #fff; }
.btn-buy:hover { background: #D95A10; }
.btn-heart { width: 48px; padding: 0; }
.btn-heart svg { width: 22px; height: 22px; }
.btn-heart.on svg { fill: var(--sale); color: var(--sale); }
.assure { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: #384253; }
.assure div { display: flex; gap: 8px; align-items: center; }
.assure svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.desc { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin-top: 20px; }
.desc .text { max-width: 90ch; line-height: 1.7; }
@media (max-width: 860px) { .pdp { grid-template-columns: 1fr; padding: 14px; gap: 18px; } .desc { padding: 16px; } }

/* Cart & checkout */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-line { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line:last-child { border-bottom: 0; }
.cart-line .thumb { width: 84px; height: 84px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-line .name { font-weight: 600; text-decoration: none; color: var(--text); }
.cart-line .name:hover { color: var(--primary); }
.cart-line .right { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.cart-line .qty { height: 36px; }
.cart-line .qty input { width: 48px; font-size: 14px; }
.cart-line .qty button { width: 32px; font-size: 16px; }
@media (max-width: 560px) { .cart-line { grid-template-columns: 64px 1fr; } .cart-line .thumb { width: 64px; height: 64px; } .cart-line .right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; } }
.summary { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; position: sticky; top: 132px; }
.summary .row-between { padding: 6px 0; font-size: 14.5px; }
.summary .total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 1.2rem; font-weight: 700; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 400; }
.opt + .opt { margin-top: 8px; }
.opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.opt input { margin-top: 4px; accent-color: var(--primary); }
.opt .grow { flex: 1; }
.opt strong { display: block; font-size: 14.5px; }
.opt .muted { font-size: 13px; }
.steps-note { font-size: 13px; color: var(--muted); }
.pay-box { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 12px; padding: 16px; }
.pay-box pre { white-space: pre-wrap; font: 14px/1.6 var(--font); margin: 8px 0 0; }
.order-steps { display: flex; gap: 0; margin: 10px 0 20px; }
.order-steps div { flex: 1; text-align: center; font-size: 12.5px; color: var(--muted); position: relative; padding-top: 22px; }
.order-steps div::before { content: ""; position: absolute; top: 6px; left: 50%; width: 12px; height: 12px; border-radius: 50%; background: #D0D7E2; transform: translateX(-50%); z-index: 1; }
.order-steps div::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #D0D7E2; }
.order-steps div:first-child::after { display: none; }
.order-steps div.done { color: var(--text); font-weight: 600; }
.order-steps div.done::before, .order-steps div.done::after { background: var(--primary); }

/* Footer */
.shop-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 56px; padding: 40px 0 24px; font-size: 14px; color: var(--muted); }
.shop-footer h4 { color: var(--text); font-family: var(--font); font-size: 14.5px; margin-bottom: 12px; }
.shop-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shop-footer a { color: var(--muted); text-decoration: none; }
.shop-footer a:hover { color: var(--primary); }
.shop-footer .brand { color: var(--text); }
.shop-footer .base { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.pay-icons { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-icons span { border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; color: var(--text); font-weight: 600; }

.shop .account .side-nav a.on { box-shadow: inset 3px 0 0 var(--primary); }
.shop .auth-card { border-color: var(--line); }
.page-content { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; max-width: 880px; line-height: 1.75; }
.toast-cart { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
