/* ===================== Shop ===================== */
:root { --price: #ef4a23; --save: #6e2594; }
[data-theme="dark"] { --price: #ff7a55; }

.shop-page .site-main, .product-page .site-main { padding-top: 1rem; }
.shop-breadcrumb { font-size: .85rem; margin-bottom: .75rem; }
.shop-breadcrumb a { color: var(--text); }
.shop-breadcrumb .active { color: var(--muted); text-decoration: underline; }

.shop-head { margin-bottom: 1.25rem; }
.shop-head h1 { font-size: 1.45rem; font-weight: 700; color: var(--primary); margin-bottom: .35rem; }
.shop-head p { font-size: .9rem; color: var(--text); opacity: .85; margin-bottom: .9rem; }
.shop-chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.shop-chips a { border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 999px; padding: .4rem 1.1rem; font-size: .85rem; transition: all .15s; }
.shop-chips a:hover { border-color: var(--primary); color: var(--primary); }

/* Filters */
.filter-box { display: block; background: var(--card); border-radius: var(--radius-sm, 8px); padding: 1rem 1.1rem; margin-bottom: .9rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); border: 1px solid var(--border); }
.filter-title { font-weight: 600; font-size: 1rem; margin: -.1rem 0 .75rem; list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.filter-title::-webkit-details-marker { display: none; }
details.filter-box > .filter-title::after { content: '\F286'; font-family: 'bootstrap-icons'; font-size: .8rem; transition: transform .2s; }
details.filter-box:not([open]) > .filter-title { margin-bottom: -.1rem; border-bottom: 0; padding-bottom: 0; }
details.filter-box:not([open]) > .filter-title::after { transform: rotate(180deg); }
.filter-check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; padding: .3rem 0; cursor: pointer; }
.filter-check small { color: var(--muted); margin-left: auto; }
.filter-scroll { max-height: 230px; overflow-y: auto; margin-right: -.4rem; padding-right: .4rem; }
.filter-cat { display: block; padding: .3rem .5rem; font-size: .88rem; color: var(--text); border-radius: 6px; }
.filter-cat:hover, .filter-cat.active { background: var(--primary-soft); color: var(--primary); }
.filter-search { position: relative; }
.filter-search input { padding-right: 2.6rem; }
.filter-search button { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 34px; border: 0; background: var(--primary); color: #fff; border-radius: 6px; }

.range-slider { position: relative; height: 22px; }
.range-track { position: absolute; left: 8px; right: 8px; top: 9px; height: 4px; background: var(--border); border-radius: 4px; }
.range-fill { position: absolute; top: 0; bottom: 0; background: var(--price); border-radius: 4px; }
.range-slider input[type=range] { position: absolute; left: 0; right: 0; top: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 22px; }
.range-slider input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--price); cursor: pointer; }
.range-slider input[type=range]::-moz-range-thumb { pointer-events: auto; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 4px solid var(--price); cursor: pointer; }

@media (max-width: 991.98px) {
    .shop-filters .offcanvas-body { background: var(--bg); }
}

/* Toolbar + grid */
.shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); padding: .7rem 1rem; margin-bottom: .9rem; }
.shop-toolbar h2 { font-size: 1rem; font-weight: 700; margin: 0 auto 0 0; }
.shop-toolbar h2 small { color: var(--muted); font-weight: 400; }
.toolbar-selects { display: flex; gap: 1rem; flex-wrap: wrap; }
.toolbar-selects label { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.toolbar-selects select { width: auto; font-size: .85rem; background-color: var(--bg); }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.product-grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1199.98px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .product-grid, .product-grid.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } }

.product-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .2s; }
.product-card:hover { box-shadow: 0 10px 28px -14px rgba(15, 23, 42, .3); }
.save-badge { position: absolute; top: 10px; left: 0; z-index: 2; background: var(--save); color: #fff; font-size: .74rem; font-weight: 600; padding: .22rem .6rem .22rem .5rem; border-radius: 0 999px 999px 0; }
.type-badge { position: absolute; top: 10px; right: 44px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.wish-btn { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.wish-btn:hover, .wish-btn.active { color: #e11d48; border-color: #fecdd3; }
.product-thumb { display: block; aspect-ratio: 1 / 1; padding: 1rem; background: #fff; border-bottom: 1px solid var(--border); }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s; }
.product-card:hover .product-thumb img { transform: scale(1.04); }
.product-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary-light); font-size: 2.5rem; border-radius: 6px; }
.product-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.product-name { font-size: .92rem; font-weight: 600; line-height: 1.4; margin: 0 0 .55rem; }
.product-name a { color: var(--text); }
.product-name a:hover { color: var(--primary); text-decoration: underline; }
.product-features { padding-left: 1rem; margin: 0 0 .6rem; font-size: .8rem; color: var(--muted); }
.product-features li { margin-bottom: .2rem; line-height: 1.35; }
.product-rating { font-size: .78rem; margin-bottom: .4rem; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.product-price { margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--border); text-align: center; }
.price-now { color: var(--price); font-weight: 700; font-size: 1.05rem; }
.price-old { color: var(--muted); font-size: .85rem; margin-left: .25rem; }
.stock-pill { text-align: center; font-size: .75rem; font-weight: 600; margin-top: .35rem; }
.stock-pill.out { color: #dc2626; }
.stock-pill.pre { color: #d97706; }
.product-actions { display: flex; gap: .4rem; margin-top: .7rem; }
.product-actions .btn { font-size: .8rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 575.98px) {
    .product-body { padding: .7rem; }
    .product-features { display: none; }
    .product-actions { flex-direction: column; }
}

/* Product page */
.product-main { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.gallery-main { aspect-ratio: 1 / 1; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); padding: 1rem; display: flex; align-items: center; justify-content: center; }
.gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.gallery-thumbs button { width: 68px; height: 68px; border: 2px solid var(--border); border-radius: 8px; background: #fff; padding: 4px; }
.gallery-thumbs button.active { border-color: var(--primary); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.product-title { font-size: 1.5rem; font-weight: 700; color: var(--primary); line-height: 1.35; margin-bottom: .9rem; }
.product-meta-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.meta-chip { background: var(--primary-soft); border-radius: 999px; padding: .3rem .85rem; font-size: .82rem; color: var(--muted); }
.meta-chip strong, .meta-chip a { color: var(--text); }
.stock-in { color: #16a34a !important; }
.stock-out { color: #dc2626 !important; }
.stock-pre { color: #d97706 !important; }
.product-rating-line { display: inline-flex; gap: .4rem; align-items: center; color: var(--muted); font-size: .88rem; margin-bottom: .8rem; }
.key-features h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; }
.key-features ul { padding-left: 1.1rem; font-size: .92rem; margin-bottom: .9rem; }
.key-features li { margin-bottom: .25rem; }
.product-type-note { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.buy-box { border-top: 1px solid var(--border); padding-top: 1rem; }
.buy-price { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.buy-price .price-now { font-size: 1.7rem; }
.save-pill { background: var(--save); color: #fff; font-size: .78rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; }
.option-group { margin-top: .8rem; }
.option-name { font-size: .88rem; font-weight: 600; margin-bottom: .4rem; }
.option-values { display: flex; flex-wrap: wrap; gap: .45rem; }
.option-btn { border: 1.5px solid var(--border); background: var(--card); color: var(--text); border-radius: 8px; padding: .4rem .9rem; font-size: .88rem; }
.option-btn:hover { border-color: var(--primary); }
.option-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.option-btn.unavailable { opacity: .4; text-decoration: line-through; }
.qty-box { display: inline-flex; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; height: 48px; }
.qty-box button { width: 42px; border: 0; background: var(--primary-soft); color: var(--primary); font-size: 1.2rem; font-weight: 700; }
.qty-box input { width: 56px; border: 0; text-align: center; font-weight: 700; background: var(--card); color: var(--text); -moz-appearance: textfield; }
.qty-box input::-webkit-inner-spin-button { -webkit-appearance: none; }
.wish-btn-lg.active i { color: #e11d48; }
.product-tabs { gap: .5rem; border-bottom: 0; }
.product-tabs .nav-link { background: var(--card); border: 1px solid var(--border); border-radius: 8px 8px 0 0; color: var(--text); font-weight: 600; }
.product-tabs .nav-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.product-tab-content { background: var(--card); border: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 1.5rem; }
.spec-table th { width: 35%; color: var(--muted); font-weight: 500; background: var(--primary-soft); }
.review { padding: .9rem 0; border-bottom: 1px solid var(--border); }
.review-summary { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.review-summary .big { font-size: 2rem; font-weight: 800; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: .2rem; }
.star-input input { display: none; }
.star-input label { font-size: 1.6rem; color: var(--border); cursor: pointer; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f59e0b; }
.related-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.related-box h3 { font-size: 1rem; font-weight: 700; margin-bottom: .6rem; }
.related-item { display: flex; gap: .7rem; padding: .6rem 0; border-bottom: 1px dashed var(--border); color: var(--text); }
.related-item:last-child { border-bottom: 0; }
.related-item .thumb { flex: 0 0 64px; height: 64px; background: #fff; border-radius: 8px; padding: 4px; border: 1px solid var(--border); }
.related-item .thumb img { width: 100%; height: 100%; object-fit: contain; }
.related-item .name { display: block; font-size: .85rem; font-weight: 600; line-height: 1.35; }
.related-item .price .price-now { font-size: .88rem; }
.related-item .price .price-old { font-size: .75rem; }

/* Cart / checkout / order */
.page-heading { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.2rem; }
.cart-box, .summary-box, .checkout-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.checkout-box { margin-bottom: 1rem; }
.checkout-box h2, .summary-box h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.step { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .9rem; display: inline-flex; align-items: center; justify-content: center; }
.cart-line { display: flex; align-items: center; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--border); }
.cart-thumb { flex: 0 0 76px; height: 76px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-info { flex: 1; min-width: 0; }
.cart-name { font-weight: 600; color: var(--text); }
.cart-unit { font-size: .88rem; color: var(--price); font-weight: 600; margin-top: .2rem; }
.cart-unit del { color: var(--muted); font-weight: 400; }
.cart-qty { width: 72px; }
.cart-total { width: 90px; text-align: right; font-weight: 700; }
@media (max-width: 575.98px) { .cart-line { flex-wrap: wrap; } .cart-info { flex-basis: calc(100% - 92px); } .cart-total { margin-left: auto; } }
.sum-row { display: flex; justify-content: space-between; padding: .45rem 0; font-size: .95rem; }
.sum-row.total { border-top: 2px solid var(--border); margin-top: .4rem; padding-top: .8rem; font-size: 1.15rem; font-weight: 800; }
.sum-row.total span:last-child { color: var(--price); }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; background: #f0fdf4; color: #166534; border-radius: 8px; padding: .5rem .8rem; margin-bottom: .8rem; }
.sum-item { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; font-size: .88rem; border-bottom: 1px dashed var(--border); }
.sum-item .thumb { position: relative; flex: 0 0 52px; height: 52px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.sum-item .thumb img { width: 100%; height: 100%; object-fit: contain; }
.sum-item .thumb b { position: absolute; top: -7px; right: -7px; background: var(--primary); color: #fff; font-size: .7rem; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.zone-list, .pay-list { display: grid; gap: .6rem; }
.zone-option, .pay-option { display: flex; align-items: center; gap: .8rem; border: 1.5px solid var(--border); border-radius: 10px; padding: .8rem 1rem; cursor: pointer; flex-wrap: wrap; }
.zone-option small { display: block; color: var(--muted); font-size: .78rem; }
.zone-rate { margin-left: auto; font-weight: 700; }
.zone-option:has(input:checked), .pay-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pay-head { font-weight: 600; }
.pay-body { display: none; flex-basis: 100%; padding-left: 1.7rem; }
.pay-option:has(input:checked) .pay-body { display: block; }
.copy-me { user-select: all; }

.order-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.order-head h1 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.order-steps { display: flex; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1rem; }
.order-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); position: relative; text-align: center; }
.order-step::before { content: ''; position: absolute; top: 14px; left: -50%; right: 50%; height: 3px; background: var(--border); z-index: 0; }
.order-step:first-child::before { display: none; }
.order-step .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--border); color: #fff; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.order-step.done { color: var(--text); font-weight: 600; }
.order-step.done .dot, .order-step.done::before { background: #16a34a; }
.order-item { display: flex; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--border); }
.order-item .thumb { flex: 0 0 60px; height: 60px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.order-item .thumb img { width: 100%; height: 100%; object-fit: contain; }
.order-totals { max-width: 320px; margin-left: auto; margin-top: .6rem; }
.deliver-box { margin-top: .6rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.copy-block { display: flex; align-items: center; gap: .5rem; width: 100%; background: var(--primary-soft); border: 1px dashed var(--primary-light); border-radius: 8px; padding: .5rem .6rem; }
.copy-block pre { flex: 1; margin: 0; font-size: .9rem; white-space: pre-wrap; word-break: break-all; color: var(--text); background: none; }
.pay-due { border-color: #fcd34d; background: #fffbeb; }
[data-theme="dark"] .pay-due { background: #2a2210; }
.order-log { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.order-log li { padding: 0 0 .8rem 1rem; position: relative; }
.order-log li::before { content: ''; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

/* Header cart */
.nav-cart { position: relative; overflow: visible; }
.cart-badge { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* ---- Home page product carousel ---- */
.product-carousel { margin-top: 2.5rem; }
.pc-tabs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: 1rem; scrollbar-width: none; }
.pc-tabs::-webkit-scrollbar { display: none; }
.pc-tabs button { flex: 0 0 auto; border: 1px solid var(--border); background: var(--card); color: var(--text, inherit); border-radius: 999px; padding: .38rem 1rem; font-size: .88rem; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.pc-tabs button:hover { border-color: var(--primary); color: var(--primary); }
.pc-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pc-frame { position: relative; container-type: inline-size; }
.pc-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 1 * .9rem) / 2); column-gap: .9rem;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding: 2px 2px 6px; transition: opacity .2s; }
.pc-track::-webkit-scrollbar { display: none; }
@container (min-width: 620px) { .pc-track { grid-auto-columns: calc((100% - 2 * .9rem) / 3); } }
@container (min-width: 900px) { .pc-track { grid-auto-columns: calc((100% - 3 * .9rem) / 4); } }
@container (min-width: 1150px) { .pc-track { grid-auto-columns: calc((100% - 4 * .9rem) / 5); } }
.pc-slide { scroll-snap-align: start; display: flex; min-width: 0; }
.pc-slide > .product-card { flex: 1; }
.pc-empty { grid-column: 1 / -1; padding: 2rem 0; text-align: center; margin: 0; }
.product-carousel.loading .pc-track { opacity: .45; pointer-events: none; }
.pc-arrow { position: absolute; top: 40%; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--card);
    color: var(--text, inherit); box-shadow: 0 4px 14px rgba(15, 23, 42, .15); display: grid; place-items: center; transition: opacity .2s, background .15s, color .15s; }
.pc-arrow:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); color: #fff; }
.pc-arrow:disabled { opacity: 0; pointer-events: none; }
.pc-prev { left: -12px; }
.pc-next { right: -12px; }
@media (max-width: 575.98px) { .pc-prev { left: -6px; } .pc-next { right: -6px; } .pc-arrow { width: 32px; height: 32px; } }
