/* ============================================================
   Hamidix — Minimal UI v2
   ============================================================ */
@font-face {
    src: url("../fonts/Vazirmatn-VariableFont_wght.a1837c4576e8.ttf");
    font-family: vazirmatn;
    font-display: swap;
}

:root {
    --primary:       #e63950;
    --primary-dark:  #c62b3d;
    --primary-light: #fff0f2;
    --secondary:     #1e2d3d;
    --bg:            #ffffff;
    --surface:       #f7f8fc;
    --border:        #edf0f7;
    --text:          #1a202c;
    --muted:         #8492a6;
    --success:       #27ae60;
    --success-bg:    #f0faf5;
    --warning-bg:    #fffbeb;
    --warning:       #b7791f;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow-sm:     0 1px 4px rgba(0,0,0,.06);
    --shadow:        0 6px 24px rgba(0,0,0,.08);
}

* { margin: 0; padding: 0; box-sizing: border-box;
    font-family: vazirmatn, Tahoma, sans-serif; font-weight: 400; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); line-height: 1.7;
    display: flex; flex-direction: column; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border: none; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff; cursor: pointer;
    font-size: 14px; font-weight: 500; transition: background .2s, transform .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(.98); }
.btn-outline {
    background: transparent; color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-outline.danger { color: #c62828; border-color: #c62828; }
.btn-outline.danger:hover { background: #fdecea; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.danger-btn { background: #c62828; color: #fff; }
.danger-btn:hover { background: #a31515; }

/* ─── Alerts / Messages ───────────────────────────────────── */
.messages { max-width: 1240px; margin: 14px auto 0; padding: 0 20px; }
.messages .msg {
    padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 8px;
    font-size: 14px; border-inline-start: 3px solid;
}
.msg.success { background: var(--success-bg); color: #1a6638; border-color: var(--success); }
.msg.error, .msg.danger { background: #fdecea; color: #c62828; border-color: #c62828; }
.msg.info  { background: #ebf4ff; color: #1565c0; border-color: #1565c0; }
.msg.warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }

.alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 20px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px;
}
.alert i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); border: 1px solid #b2dfdb; color: #1a6638; }
.alert-success a { color: #1a6638; font-weight: 600; text-decoration: underline; }
.alert-warning { background: var(--warning-bg); border: 1px solid #f6d860; color: var(--warning); }
.alert-warning a { color: var(--warning); font-weight: 600; text-decoration: underline; }

/* ─── Header ──────────────────────────────────────────────── */
.header {
    background: var(--bg); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.header-main { padding: 14px 0; }
.header-main .container { display: flex; align-items: center; gap: 18px; }

.logo { display: flex; align-items: center; gap: 8px;
    font-size: 18px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.logo img { height: 42px; width: auto; }

.search-box { flex: 1 1 280px; position: relative; }
.search-box input {
    width: 100%; padding: 10px 16px; padding-inline-start: 104px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; outline: none; background: var(--surface); transition: border-color .2s;
}
.search-box input:focus { border-color: var(--primary); background: #fff; }
.search-box button {
    position: absolute; inset-inline-start: 4px; top: 4px; bottom: 4px;
    display: flex; align-items: center; gap: 4px;
    background: var(--primary); color: #fff; border: none;
    border-radius: 6px; padding: 0 14px; cursor: pointer; font-size: 13px; font-weight: 500;
    transition: background .2s;
}
.search-box button:hover { background: var(--primary-dark); }

.user-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.user-action-item {
    display: flex; align-items: center; gap: 6px; padding: 8px 12px;
    font-size: 13px; color: var(--muted); border-radius: var(--radius-sm);
    transition: background .2s, color .2s;
}
.user-action-item:hover { background: var(--surface); color: var(--text); }
.cart-icon { position: relative; }
.cart-count {
    position: absolute; top: 0px; right: 0px;
    background: var(--primary); color: #fff; border-radius: 50%;
    width: 18px; height: 18px; font-size: 10px; font-weight: 700;
    display: flex !important; align-items: center; justify-content: center;
    transform: translate(40%, -30%);
    pointer-events: none;
}

/* ─── Nav ─────────────────────────────────────────────────── */
.main-nav { background: var(--secondary); }
.nav-list { display: flex; overflow-x: auto; scrollbar-width: none; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 13px 16px; color: rgba(255,255,255,.82); font-size: 13px;
    white-space: nowrap; transition: background .2s, color .2s;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.1); color: #fff; }

/* ─── Hero / Slider ───────────────────────────────────────── */
.hero { margin: 20px 0; }
.hero-slider {
    position: relative; margin: 20px 0; border-radius: var(--radius); overflow: hidden;
}
.hero-slider .slides { position: relative; aspect-ratio: 1920/600; }
.hero-slider .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.hero-slider .slide.active { opacity: 1; pointer-events: auto; }
.hero-slider .slide, .hero-slider .slide a { display: block; width: 100%; height: 100%; }
.hero-slider .slide img { width: 100%; height: 100%; object-fit: cover; }
.slider-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border: none; border-radius: 50%;
    background: rgba(255,255,255,.9); color: var(--secondary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 15px; box-shadow: 0 2px 10px rgba(0,0,0,.15); transition: background .2s;
}
.slider-btn:hover { background: #fff; }
.slider-btn.prev { inset-inline-end: 14px; }
.slider-btn.next { inset-inline-start: 14px; }
.slider-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.slider-dots .dot {
    width: 8px; height: 8px; border-radius: 50%; border: none;
    background: rgba(255,255,255,.5); cursor: pointer; transition: background .2s, width .2s;
}
.slider-dots .dot.active { background: #fff; width: 22px; border-radius: 4px; }

.banner-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.banner-row img { width: 100%; border-radius: var(--radius); display: block; }
.promo-banner { overflow: hidden; border-radius: var(--radius); }
.promo-banner img { transition: transform .4s; }
.promo-banner:hover img { transform: scale(1.03); }

/* ─── Products section ────────────────────────────────────── */
.products-section { margin: 40px 0; }
.section-title {
    font-size: 18px; font-weight: 700; margin-bottom: 22px;
    border-inline-start: 3px solid var(--primary); padding-inline-start: 14px;
    display: flex; justify-content: space-between; align-items: center;
}
.section-title a {
    font-size: 12px; font-weight: 500; color: var(--muted);
    border: 1px solid var(--border); padding: 5px 12px;
    border-radius: 20px; transition: border-color .2s, color .2s;
}
.section-title a:hover { border-color: var(--primary); color: var(--primary); }

/* grid layout برای صفحه لیست محصولات */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* ردیف افقی قابل اسکرول برای بخش‌های صفحه اصلی */
.row-wrap { position: relative; }

.products-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.products-row::-webkit-scrollbar { display: none; }
.products-row .product-card {
    flex: 0 0 210px;
    scroll-snap-align: start;
}
@media (max-width: 600px) { .products-row .product-card { flex: 0 0 160px; } }
@media (min-width: 601px) and (max-width: 900px) { .products-row .product-card { flex: 0 0 185px; } }

.row-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    transition: border-color .2s, color .2s, box-shadow .2s;
}
.row-arrow:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow); }
.row-arrow.row-prev { inset-inline-end: -16px; }
.row-arrow.row-next { inset-inline-start: -16px; }
@media (min-width: 700px) { .row-arrow { display: flex; } }

/* فضای کناری برای فلش‌ها */
.products-section .container,
.row-wrap { padding-inline: 2px; }

/* ─── Product Card ────────────────────────────────────────── */
.product-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); transition: box-shadow .25s, transform .25s;
    display: flex; flex-direction: column; position: relative;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }

.product-badge {
    position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2;
    background: var(--primary); color: #fff;
    font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
}
.product-image {
    aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: var(--surface); overflow: hidden; position: relative;
}
.product-image img { max-height: 100%; object-fit: contain; transition: transform .35s; }
.product-card:hover .product-image img { transform: scale(1.05); }

.product-overlay {
    position: absolute; inset: 0; background: rgba(30,45,61,.5);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .25s; z-index: 2;
}
.product-card:hover .product-overlay { opacity: 1; }
.product-overlay span {
    background: #fff; color: var(--secondary); font-size: 13px; font-weight: 600;
    padding: 8px 18px; border-radius: 20px; display: flex; align-items: center; gap: 6px;
    transform: translateY(6px); transition: transform .25s;
}
.product-card:hover .product-overlay span { transform: translateY(0); }

.product-info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-title { font-size: 13px; line-height: 1.7; height: 44px; overflow: hidden; font-weight: 400; color: var(--text); }
.product-title a:hover { color: var(--primary); }
.product-price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.current-price { font-size: 15px; font-weight: 700; color: var(--primary); }
.old-price { font-size: 12px; color: #bbb; text-decoration: line-through; }
.discount { background: var(--primary-light); color: var(--primary); padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.out-of-stock { color: #c0c0c0; font-size: 14px; }

.add-to-cart {
    width: 100%; padding: 10px; background: var(--primary); color: #fff; border: none;
    border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: background .2s;
}
.add-to-cart:hover { background: var(--primary-dark); }
.add-to-cart:disabled { background: #e9e9e9; color: #b0b0b0; cursor: not-allowed; }

/* ─── Gallery (Digikala-style) ────────────────────────────── */
.gallery-wrap {
    display: flex;
    flex-direction: row-reverse; /* main on right, thumbs on left */
    gap: 10px;
    align-items: flex-start;
    direction: ltr; /* keep layout LTR regardless of page dir */
}

/* Thumbnail column (left side) */
.gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 80px;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 430px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.gallery-thumbs::-webkit-scrollbar { width: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.gallery-thumb {
    width: 76px; height: 76px;
    border: 2px solid var(--border); border-radius: 8px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden;
    transition: border-color .18s, box-shadow .18s;
    flex-shrink: 0;
}
.gallery-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 4px; }
.gallery-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.gallery-thumb:hover:not(.active) { border-color: var(--primary); }

/* Main image box */
.gallery-main {
    flex: 1;
    position: relative;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1/1; overflow: hidden;
    cursor: zoom-in;
    min-width: 0;
}
.gallery-main img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    transition: transform .25s ease;
    transform-origin: var(--zoom-x, 50%) var(--zoom-y, 50%);
    pointer-events: none;
}
.gallery-main.zooming img { transform: scale(2.2); }

.gallery-main .gallery-badge {
    position: absolute; top: 12px; right: 12px;
    background: var(--primary); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 6px;
    z-index: 2;
}

/* Image counter (e.g. 2 / 5) */
.gallery-counter {
    position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.38); color: #fff; font-size: 12px;
    padding: 3px 12px; border-radius: 20px; letter-spacing: .5px;
    z-index: 3; pointer-events: none; direction: ltr;
}

/* Prev / Next arrows on main image */
.gallery-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.85); border: 1px solid var(--border);
    color: #333; width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px; z-index: 4;
    transition: background .18s, box-shadow .18s;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    opacity: 0; pointer-events: none;
}
.gallery-main:hover .gallery-nav { opacity: 1; pointer-events: auto; }
.gallery-nav:hover { background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.gallery-nav.g-prev { right: 10px; }
.gallery-nav.g-next { left: 10px; }

/* Lightbox */
.lightbox {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.9);
    z-index: 1000; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.lightbox-close {
    position: absolute; top: 20px; right: 24px;
    background: none; border: none; color: #fff; font-size: 28px;
    cursor: pointer; line-height: 1; opacity: .8; transition: opacity .2s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.12); border: none; color: #fff;
    width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    transition: background .2s;
}
.lightbox-arrow:hover { background: rgba(255,255,255,.24); }
.lightbox-arrow.lb-prev { right: 20px; }
.lightbox-arrow.lb-next { left: 20px; }

/* Responsive: stack vertically on small screens */
@media (max-width: 520px) {
    .gallery-wrap { flex-direction: column-reverse; }
    .gallery-thumbs { flex-direction: row; width: auto; max-height: none; overflow-x: auto; overflow-y: hidden; max-width: 100%; }
    .gallery-thumb { width: 64px; height: 64px; }
}

/* ─── Product Detail ──────────────────────────────────────── */
.breadcrumb {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    margin: 20px 0; font-size: 13px; color: var(--muted);
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i { font-size: 10px; }

.product-detail { display: grid; grid-template-columns: 1fr; gap: 32px; margin: 4px 0 28px; }
@media (min-width: 860px) { .product-detail { grid-template-columns: 1fr 1.1fr; align-items: start; } }

.product-detail .gallery {
    position: relative; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px; display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1/1; background: var(--surface);
}
.product-detail .gallery img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-badge {
    position: absolute; top: 12px; inset-inline-start: 12px;
    background: var(--primary); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 6px;
}

.product-detail h1 { font-size: 22px; font-weight: 700; line-height: 1.7; margin-bottom: 20px; }
.detail-meta-list {
    display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px;
    padding-bottom: 20px; border-bottom: 1px solid var(--border); font-size: 14px; color: #555;
}
.detail-meta-list i { color: var(--primary); width: 18px; }
.detail-meta-list a { color: var(--secondary); }
.stock-badge { font-weight: 600; }
.stock-badge.in { color: var(--success); }
.stock-badge.out { color: #c62828; }

.buy-box {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; background: var(--bg);
}
.buy-box-price { margin-bottom: 18px; }
.price-old-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.detail-price { font-size: 28px; font-weight: 700; color: var(--primary); }
.detail-price span { font-size: 16px; font-weight: 400; margin-inline-start: 2px; }
.detail-price.out-of-stock { color: #aaa; font-size: 20px; }

.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; font-size: 14px; }
.qty-control {
    display: inline-flex; align-items: center;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.qty-control button {
    width: 38px; height: 40px; border: none; background: var(--surface);
    font-size: 18px; cursor: pointer; color: var(--secondary); transition: background .2s;
}
.qty-control button:hover { background: var(--border); }
.qty-control input {
    width: 52px; height: 40px; border: none; border-inline: 1.5px solid var(--border);
    text-align: center; font-size: 15px; outline: none; -moz-appearance: textfield;
}
.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; }

.buy-assurances {
    display: flex; flex-direction: column; gap: 10px; margin-top: 20px;
    padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted);
}
.buy-assurances span { display: flex; align-items: center; gap: 8px; }
.buy-assurances i { color: var(--secondary); width: 18px; }

.detail-section { margin: 36px 0; }
.detail-desc { line-height: 2.1; color: #4a5568; font-size: 15px; }
.muted { color: var(--muted); font-size: 14px; }

/* ─── Reviews ─────────────────────────────────────────────── */
.review-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.review-item {
    border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
    background: var(--bg);
}
.review-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 6px; }
.review-item-head i { color: var(--muted); }
.review-product { color: var(--secondary); font-weight: 600; }
.stars { color: #f59e0b; font-size: 15px; letter-spacing: 2px; }
.review-text { color: #4a5568; line-height: 1.9; font-size: 14px; }
.review-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.review-date { color: var(--muted); font-size: 12px; }
.review-status { font-size: 12px; font-weight: 500; }
.review-status.approved { color: var(--success); }
.review-status.pending { color: var(--warning); }

.review-form-box {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; background: var(--surface);
}
.review-form-box h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* ─── Cart ────────────────────────────────────────────────── */
.page-wrap { margin: 30px auto; min-height: 50vh; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 24px; }

.cart-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 880px) { .cart-grid { grid-template-columns: 1fr 310px; } }

.cart-items-col { display: flex; flex-direction: column; gap: 10px; }
.cart-line {
    display: grid; grid-template-columns: 80px 1fr;
    gap: 14px; align-items: center;
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; background: var(--bg);
}
@media (min-width: 560px) { .cart-line { grid-template-columns: 80px 1fr auto; } }
.cart-line-img { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; }
.cart-line-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cart-line-body { display: flex; flex-direction: column; gap: 5px; }
.cart-line-name { font-size: 14px; line-height: 1.6; color: var(--text); }
.cart-line-name:hover { color: var(--primary); }
.cart-line-price { color: var(--muted); font-size: 13px; }
.cart-line-actions {
    grid-column: 1/-1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    padding-top: 12px; border-top: 1px solid var(--border); justify-content: space-between;
}
@media (min-width: 560px) { .cart-line-actions { grid-column: auto; border-top: none; padding-top: 0; } }
.cart-line-total { font-weight: 700; color: var(--primary); font-size: 15px; }
.cart-remove { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 16px; padding: 6px; border-radius: 6px; transition: color .2s, background .2s; }
.cart-remove:hover { color: #c62828; background: #fdecea; }

/* ─── Summary Box ─────────────────────────────────────────── */
.cart-summary-col { position: sticky; top: 80px; }
.summary-box {
    border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--bg);
}
.summary-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.summary-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; padding: 10px 0; color: #555; border-bottom: 1px solid var(--border);
}
.summary-row:last-of-type { border-bottom: none; }
.summary-row.discount-row { color: var(--success); }
.summary-row.total-row { font-weight: 700; font-size: 16px; color: var(--text); padding-top: 14px; }
.summary-row.total-row span:last-child { color: var(--primary); }
.summary-box .btn-block { margin-top: 16px; }
.summary-items { max-height: 200px; overflow-y: auto; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.summary-item-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 0; }

/* ─── Coupon ──────────────────────────────────────────────── */
.coupon-form { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.coupon-form label { display: block; font-size: 13px; margin-bottom: 8px; color: var(--muted); font-weight: 500; }
.coupon-input-row { display: flex; gap: 8px; }
.coupon-input-row input {
    flex: 1; min-width: 0; padding: 9px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; outline: none;
    transition: border-color .2s;
}
.coupon-input-row input:focus { border-color: var(--primary); }
.coupon-input-row .btn { padding: 9px 16px; }
.coupon-applied { background: var(--success-bg); color: #1a6638; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 4px 0; }
.link-btn.center { display: block; text-align: center; width: 100%; margin-top: 10px; }

/* ─── Checkout ────────────────────────────────────────────── */
.checkout-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 880px) { .checkout-grid { grid-template-columns: 1fr 310px; } }
.checkout-main { display: flex; flex-direction: column; gap: 16px; }
.checkout-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: var(--bg); }
.checkout-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.checkout-card h3 i { color: var(--primary); }

.address-radio-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.address-radio {
    display: flex; align-items: flex-start; gap: 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 14px; cursor: pointer;
    transition: border-color .2s, background .2s;
}
.address-radio:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.address-radio input { margin-top: 3px; accent-color: var(--primary); }
.address-radio-body { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.address-radio-body span { color: var(--muted); font-size: 13px; }

.no-address-card { text-align: center; padding: 48px 20px; }
.no-address-icon { font-size: 52px; color: #d0d5e8; display: block; margin-bottom: 14px; }
.no-address-card p { color: var(--muted); margin-bottom: 20px; }
.add-address-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--primary); }
.add-address-link:hover { text-decoration: underline; }
.or-divider { text-align: center; margin: 14px 0 0; position: relative; color: var(--muted); font-size: 13px; }
.or-divider span { background: #fff; padding: 0 12px; position: relative; z-index: 1; }
.or-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }

/* ─── Forms ───────────────────────────────────────────────── */
.auth-wrap { max-width: 420px; margin: 48px auto; padding: 0 20px; }
.card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 32px;
}
.card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; font-weight: 700; }
.card .subtitle { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.tabs { display: flex; margin-bottom: 24px; background: var(--surface); border-radius: var(--radius-sm); padding: 4px; gap: 4px; }
.tab-btn { flex: 1; padding: 9px; background: transparent; border: none; cursor: pointer; font-size: 14px; border-radius: 6px; color: var(--muted); transition: background .2s, color .2s; }
.tab-btn.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

.input-group { margin-bottom: 16px; }
.input-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: #555; }
.input-group input, .input-group textarea, .input-group select {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; outline: none;
    background: var(--bg); transition: border-color .2s;
}
.input-group input:focus, .input-group textarea:focus, .input-group select:focus { border-color: var(--primary); }
.input-group input:disabled { background: var(--surface); color: var(--muted); }
.form-errors { color: #c62828; font-size: 13px; margin-bottom: 12px; background: #fdecea; padding: 10px 14px; border-radius: var(--radius-sm); }
.errorlist { color: #c62828; font-size: 12px; list-style: none; margin-top: 4px; }
.hidden { display: none; }

/* ─── Profile Form ────────────────────────────────────────── */
.profile-form .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 18px; }
.profile-form select, .profile-form input, .profile-form textarea {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; outline: none; transition: border-color .2s;
}
.profile-form input:disabled { background: var(--surface); color: var(--muted); }
.profile-form input:focus, .profile-form textarea:focus, .profile-form select:focus { border-color: var(--primary); }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 18px; font-size: 14px; cursor: pointer; color: #555; }
.checkbox-row input { width: auto; accent-color: var(--primary); }
.form-actions { display: flex; gap: 10px; margin-top: 10px; }

/* ─── Profile Layout ──────────────────────────────────────── */
.profile-layout { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 820px) { .profile-layout { grid-template-columns: 240px 1fr; } }

.profile-sidebar { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.profile-user {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 18px; background: var(--secondary); color: #fff;
}
.profile-avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: rgba(255,255,255,.12); display: flex; align-items: center;
    justify-content: center; font-size: 20px; flex-shrink: 0;
}
.profile-user strong { display: block; font-size: 15px; font-weight: 600; }
.profile-user span { font-size: 12px; color: rgba(255,255,255,.65); margin-top: 2px; display: block; }

.profile-nav { display: flex; flex-direction: column; padding: 10px; }
.profile-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: var(--radius-sm); color: #4a5568; font-size: 14px;
    transition: background .2s, color .2s;
}
.profile-nav a i { width: 18px; color: var(--muted); transition: color .2s; }
.profile-nav a:hover { background: var(--surface); color: var(--text); }
.profile-nav a:hover i { color: var(--secondary); }
.profile-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.profile-nav a.active i { color: var(--primary); }
.profile-nav a.logout { color: #c62828; margin-top: 4px; padding-top: 15px; border-top: 1px solid var(--border); border-radius: 0; }
.profile-nav a.logout i { color: #c62828; }

.profile-content { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); padding: 28px; min-height: 320px; }
.profile-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.profile-subtitle { font-size: 16px; font-weight: 600; margin: 24px 0 14px; }
.profile-welcome { color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.profile-head-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }

/* ─── Stat Cards ──────────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; text-align: center; transition: box-shadow .2s, transform .2s; color: var(--text);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.stat-card i { font-size: 22px; color: var(--primary); }
.stat-card .stat-num { display: block; font-size: 26px; font-weight: 700; margin: 8px 0 3px; }
.stat-card .stat-label { color: var(--muted); font-size: 13px; }

/* ─── Orders Table ────────────────────────────────────────── */
.order-status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
    background: var(--surface); color: var(--muted);
}
.order-status.paid { background: var(--success-bg); color: var(--success); }
.order-status.pending { background: var(--warning-bg); color: var(--warning); }

/* ─── Addresses ───────────────────────────────────────────── */
.address-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.address-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px; }
.address-card.is-default { border-color: var(--primary); }
.address-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.address-card-head i { color: var(--primary); }
.badge-default { background: var(--primary-light); color: var(--primary); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.address-line { font-size: 14px; line-height: 1.8; color: #4a5568; margin-bottom: 8px; }
.address-meta { font-size: 13px; color: var(--muted); line-height: 1.9; margin-bottom: 14px; }
.address-actions { display: flex; gap: 8px; }

/* ─── Order Detail ────────────────────────────────────────── */
.order-info-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; background: var(--bg); }
.order-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.order-info-item label { font-size: 12px; color: var(--muted); font-weight: 500; display: block; margin-bottom: 3px; }
.order-info-item span { font-size: 14px; font-weight: 500; color: var(--text); }

.order-items-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.order-items-table thead { background: var(--surface); }
.order-items-table th { padding: 12px 14px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: start; border-bottom: 1px solid var(--border); }
.order-items-table td { padding: 14px; font-size: 14px; border-bottom: 1px solid var(--border); }
.order-items-table tr:last-child td { border-bottom: none; }

.order-totals { max-width: 320px; margin-inline-start: auto; margin-top: 16px; }

/* ─── Responsive Cart Table (legacy) ─────────────────────── */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: start; font-size: 14px; }
.cart-table thead { background: var(--surface); }
.cart-table th { font-size: 13px; font-weight: 600; color: var(--muted); }
.cart-table img { width: 52px; }
@media (max-width: 600px) {
    .cart-table thead { display: none; }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
    .cart-table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 8px; }
    .cart-table td { border: none; display: flex; justify-content: space-between; }
    .cart-table td::before { content: attr(data-label); font-weight: 600; color: var(--muted); }
}

/* ─── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-state i { font-size: 52px; color: #d8dde8; display: block; margin-bottom: 16px; }
.empty-state p { margin-bottom: 20px; font-size: 15px; }

/* ─── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span {
    padding: 8px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; transition: border-color .2s, background .2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Footer ──────────────────────────────────────────────── */
.footer { background: var(--secondary); color: rgba(255,255,255,.85); margin-top: auto; padding-top: 40px; }
.footer-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; padding-bottom: 32px; }
.footer-column h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: #fff; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: rgba(255,255,255,.6); font-size: 14px; transition: color .2s; display: flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; text-align: center; font-size: 13px; color: rgba(255,255,255,.45); }

/* ─── 404 Page ───────────────────────────────────────────── */
.error-page {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 60px 20px 80px; min-height: 60vh;
}
.error-illustration { margin-bottom: 32px; }
.error-code {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 120px; font-weight: 900; line-height: 1;
    color: var(--primary);
    text-shadow: 4px 4px 0 color-mix(in srgb, var(--primary) 15%, transparent);
}
.error-code .zero {
    width: 120px; height: 120px; border-radius: 50%;
    border: 12px solid var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; color: var(--primary);
    animation: spin404 6s linear infinite;
}
@keyframes spin404 {
    0%   { transform: rotateY(0deg); }
    50%  { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}
.error-title {
    font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 12px;
}
.error-desc {
    font-size: 15px; color: var(--muted); max-width: 420px; line-height: 1.9; margin-bottom: 36px;
}
.error-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn-outline {
    background: transparent; color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .logo img { height: 36px; }
    .banner-row { grid-template-columns: 1fr; }
    .slider-btn { width: 34px; height: 34px; font-size: 13px; }

    /* Two-row mobile header */
    .header-main { padding: 10px 0 8px; }
    .header-main .container {
        flex-wrap: wrap;
        gap: 8px;
    }
    .logo { flex: 0 0 auto; }
    .logo span { display: none; }
    .search-box {
        order: 3;
        flex: 1 1 100%;
        min-width: 0;
    }
    .search-box input { padding-inline-start: 96px; font-size: 13px; }
    .user-actions {
        flex: 1 1 auto;
        margin-inline-start: 0;
        gap: 2px;
        justify-content: flex-end;
    }
    .user-action-item span:not(.cart-count) { display: none; }
    .user-action-item { padding: 8px 10px; }
}
