/* =========================================================
   SITE.CSS – Professional E-commerce global stylesheet
   Sections:
   01 Tokens        02 Base/Typography   03 Loader / Select2
   04 Buttons       05 Badges            06 Product card (+ item)
   07 Brand card    08 Cart / Summary    09 Checkout steps
   10 Mega menu     11 Desktop sidebar   12 Mobile menu / Offcanvas
   13 Shop filters  14 Pagination        15 Utilities / A11y
   Breakpoints: 576 / 768 / 992 / 1200
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---------- 01 TOKENS ---------- */
:root {
    --c-primary: #ff6a00;
    --c-primary-d: #e65e00;
    --c-primary-soft: #fff3e8;
    --c-dark: #111827;
    --c-text: #374151;
    --c-muted: #6b7280;
    --c-line: #e5e7eb;
    --c-bg: #f6f7fb;
    --c-card: #ffffff;
    --c-success: #16a34a;
    --c-danger: #e53935;
    --c-info: #2563eb;
    --c-warn: #f59e0b;
    --c-wish: #e53935;
    --c-brand-pink: #ff3f6c;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 4px rgba(17,24,39,.06);
    --shadow: 0 4px 14px rgba(17,24,39,.08);
    --shadow-lg: 0 10px 28px rgba(17,24,39,.14);
    /* font sizes */
    --fs-xs: .75rem; /* 12px */
    --fs-sm: .8125rem; /* 13px */
    --fs-base: .9375rem; /* 15px */
    --fs-md: 1rem; /* 16px */
    --fs-lg: 1.125rem; /* 18px */
    --fs-xl: 1.375rem; /* 22px */

    --gap: clamp(8px, 1.4vw, 16px);
    --pad: clamp(8px, 1.6vw, 14px);
    --ease: .25s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- 02 BASE / TYPOGRAPHY ---------- */
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--c-dark);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
}

h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h2 {
    font-size: clamp(1.25rem, 2.4vw, 1.625rem);
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
}

h4 {
    font-size: 1.0625rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: .9375rem;
}

small, .small {
    font-size: var(--fs-sm);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    transition: color var(--ease);
}

    a:hover {
        color: var(--c-primary);
    }

.text-muted {
    color: var(--c-muted) !important;
}

:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- 03 GLOBAL LOADER / SELECT2 ---------- */
#globalLoader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 46px;
    height: 46px;
    border: 4px solid var(--c-line);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin .9s linear infinite;
    margin: auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.select2-container {
    font-size: var(--fs-base);
}

.select2-results__options {
    max-height: 200px;
    overflow-y: auto;
}

/* ---------- 04 BUTTONS ---------- */
.btn-cart,
.cart-btn,
.checkout-btn,
.continue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: var(--fs-sm);
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.btn-cart {
    width: 100%;
    background: var(--c-primary);
    color: #fff;
    padding: 9px 12px;
}

    .btn-cart:hover {
        background: var(--c-primary-d);
        color: #fff;
    }

    .btn-cart:active, .checkout-btn:active {
        transform: translateY(1px);
    }

    .btn-cart:disabled {
        background: #cfd3da;
        cursor: not-allowed;
    }

.cart-btn {
    background: var(--c-dark);
    color: #fff;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
}

    .cart-btn:hover {
        background: var(--c-primary);
        color: #fff;
    }

.checkout-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--c-primary);
    color: #fff;
    font-size: var(--fs-base);
    font-weight: 700;
}

    .checkout-btn:hover {
        background: var(--c-primary-d);
        color: #fff;
        box-shadow: var(--shadow);
    }

.continue-btn {
    padding: 9px 16px;
    background: #f3f4f6;
    color: var(--c-dark);
}

    .continue-btn:hover {
        background: var(--c-primary);
        color: #fff;
    }

/* ---------- 05 BADGES ---------- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.3;
    border-radius: var(--radius-sm);
    color: #fff;
    letter-spacing: .02em;
}

    .badge.hot {
        background: #ef4444;
    }

    .badge.new {
        background: var(--c-success);
    }

    .badge.discount {
        background: var(--c-warn);
    }

    .badge.offer {
        background: var(--c-info);
    }

    .badge.oos {
        background: #6b7280;
    }

.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ---------- 06 PRODUCT CARD / ITEM ---------- */
.product-card,
.product-item {
    position: relative;
    background: var(--c-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-line);
    transition: transform var(--ease), box-shadow var(--ease);
}

.product-item {
    padding: 8px;
    border-radius: var(--radius);
}

    .product-card:hover,
    .product-item:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

.product-img {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    text-align: center;
}

.product-card .product-img {
    padding: 10px;
}

.product-img img {
    width: 100%;
    object-fit: contain;
    transition: transform .4s ease;
    border-radius: var(--radius);
}

.product-card .product-img img {
    max-height: 180px;
}

.product-card:hover .product-img img,
.product-item:hover .product-img img {
    transform: scale(1.05);
}

/* hover overlay buttons (centered) */
.product-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--ease);
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-overlay button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background var(--ease), color var(--ease);
}

    .product-overlay button:hover {
        background: var(--c-primary);
        color: #fff;
    }

/* side actions (quick view / wishlist) */
.product-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity var(--ease), transform var(--ease);
    z-index: 2;
}

.product-item:hover .product-actions,
.product-card:hover .product-actions {
    opacity: 1;
    transform: none;
}

.product-actions a {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--c-dark);
    border: 1px solid var(--c-line);
    border-radius: 50%;
    font-size: 15px;
    transition: background var(--ease), color var(--ease), border-color var(--ease);
}

    .product-actions a:hover {
        background: var(--c-primary);
        border-color: var(--c-primary);
        color: #fff;
    }

@media (hover: none) {
    .product-actions {
        opacity: 1;
        transform: none;
    }
}

/* wishlist */
.wishlist-btn,
.wishlist-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 2;
    transition: transform var(--ease);
}

    .wishlist-btn:hover, .wishlist-toggle:hover {
        transform: scale(1.1);
    }

    .wishlist-btn i {
        color: var(--c-wish);
    }

/* body */
.product-body {
    padding: var(--pad);
}

.product-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.35;
    color: var(--c-dark);
    height: 2.7em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price-box {
    margin: 6px 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.price {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--c-dark);
}

.old-price {
    font-size: var(--fs-sm);
    text-decoration: line-through;
    color: #9ca3af;
    margin-left: 0;
}

/* ---------- 07 BRAND CARD ---------- */
.brand-card {
    display: block;
    padding: var(--pad);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--c-line);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform var(--ease), box-shadow var(--ease);
}

    .brand-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow);
    }

.brand-img-wrapper {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-img {
    max-height: 56px;
    max-width: 100%;
    object-fit: contain;
}

.brand-name {
    margin-top: 8px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-dark);
}

/* ---------- 08 CART / SUMMARY ---------- */
.cart-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: var(--pad);
    margin-bottom: var(--gap);
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.cart-img img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: var(--radius);
}

.product-link {
    text-decoration: none;
    color: var(--c-dark);
    font-weight: 600;
    font-size: var(--fs-base);
}

    .product-link:hover {
        color: var(--c-primary);
    }

.cart-attr {
    font-size: var(--fs-sm);
    color: var(--c-muted);
    margin-bottom: 3px;
}

.attr-name {
    font-weight: 600;
    margin-right: 4px;
    color: var(--c-text);
}

.attr-value {
    margin-right: 6px;
}

.color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 6px;
    border: 1px solid #cbd5e1;
    vertical-align: middle;
}

.qty-box {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    border-radius: var(--radius);
    padding: 3px;
}

    .qty-box button {
        width: 30px;
        height: 30px;
        border: 0;
        background: #fff;
        color: var(--c-dark);
        border-radius: var(--radius-sm);
        font-weight: 700;
        cursor: pointer;
        box-shadow: var(--shadow-sm);
        transition: background var(--ease), color var(--ease);
    }

        .qty-box button:hover {
            background: var(--c-primary);
            color: #fff;
        }

    .qty-box input {
        width: 42px;
        text-align: center;
        border: 0;
        background: transparent;
        font-weight: 600;
        font-size: var(--fs-base);
    }

.summary-box {
    padding: 16px;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

    .summary-box ul {
        list-style: none;
        padding: 0;
        margin: 0 0 12px;
    }

    .summary-box li {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        padding: 6px 0;
        font-size: var(--fs-base);
        border-bottom: 1px dashed var(--c-line);
    }

        .summary-box li:last-child {
            border-bottom: 0;
            font-weight: 700;
            color: var(--c-dark);
            font-size: var(--fs-md);
        }

@media (min-width: 992px) {
    .summary-box {
        position: sticky;
        top: 90px;
    }
}

.address-card {
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: var(--pad);
    background: #fff;
}

.border-dashed {
    border: 2px dashed #cbd5e1;
}

/* ---------- 09 CHECKOUT STEPS ---------- */
.checkout-steps {
    font-weight: 600;
    letter-spacing: .1em;
    font-size: var(--fs-sm);
    text-transform: uppercase;
}

    .checkout-steps .step {
        margin: 0 8px;
        color: #9ca3af;
    }

    .checkout-steps .active {
        color: var(--c-success);
        border-bottom: 2px solid var(--c-success);
    }

.checkout-steps-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
}

.step-item {
    text-align: center;
    position: relative;
}

.step-circle {
    width: 32px;
    height: 32px;
    margin: auto;
    border-radius: 50%;
    background: #d1d5db;
    color: #fff;
    font-weight: 700;
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ease);
}

.step-label {
    margin-top: 4px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: #9ca3af;
}

.step-line {
    width: clamp(28px, 9vw, 80px);
    height: 2px;
    background: #d1d5db;
}

.step-item.active .step-circle {
    background: var(--c-brand-pink);
}

.step-item.active .step-label {
    color: var(--c-dark);
}

.step-item.completed .step-circle {
    background: var(--c-success);
}

.step-item.completed .step-label {
    color: var(--c-success);
}

.step-item.completed + .step-line {
    background: var(--c-success);
}

/* ---------- 10 MEGA MENU ---------- */
.mega-menu {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
}

    .mega-menu::-webkit-scrollbar {
        width: 6px;
    }

    .mega-menu::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

.nav-link .bi-chevron-down,
.toggle-arrow {
    transition: transform var(--ease);
}

.nav-link[aria-expanded="true"] .bi-chevron-down,
.nav-link[aria-expanded="true"] .toggle-arrow {
    transform: rotate(180deg);
}

/* ---------- 11 DESKTOP CATEGORY SIDEBAR ---------- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: none;
    z-index: 9998;
}

    .sidebar-overlay.active {
        display: block;
    }

.desktop-category-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(300px, 86vw);
    height: 100vh;
    background: #f8f8f8;
    overflow: hidden;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    transition: left .3s ease;
}

    .desktop-category-sidebar.active {
        left: 0;
    }

.sidebar-header {
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: #232f3e;
    color: #fff;
    font-weight: 600;
}

.sidebar-body {
    position: relative;
    height: calc(100vh - 56px);
    overflow: hidden;
}

.menu-level {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #f8f8f8;
    overflow-y: auto;
    transition: left .3s ease;
}

    .menu-level.active {
        left: 0;
    }

    .menu-level li {
        padding: 12px 16px;
        font-size: var(--fs-base);
        border-bottom: 1px solid #ececec;
        cursor: pointer;
        transition: background var(--ease);
    }

        .menu-level li:hover {
            background: #fff;
        }

.back-btn {
    font-weight: 600;
    background: #eaeaea;
}

.arrow {
    float: right;
}

/* ---------- 12 MOBILE MENU / OFFCANVAS ---------- */
#mobileMenu {
    display: flex;
    flex-direction: column;
}

    #mobileMenu .offcanvas-header {
        flex: 0 0 auto;
        padding: 10px 14px;
        border-bottom: 1px solid var(--c-line);
        background: #fff;
        z-index: 5;
    }

    #mobileMenu .offcanvas-body {
        flex: 1 1 auto;
        overflow-y: auto;
        position: relative;
        padding: 0;
    }

.mobile-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    background: #fff;
}

    .mobile-menu.active {
        display: block;
    }

    .mobile-menu li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 13px 16px;
        font-size: var(--fs-base);
        border-bottom: 1px solid #f1f1f1;
        cursor: pointer;
        transition: background var(--ease);
    }

        .mobile-menu li:hover {
            background: #f3f4f6;
        }

        .mobile-menu li a {
            width: 100%;
            color: var(--c-dark);
            text-decoration: none;
        }

    .mobile-menu .back-btn {
        font-weight: 600;
        background: #f7f7f7;
    }

/* ---------- 13 SHOP FILTERS ---------- */
.shop-category-list,
.shop-checkbox-list {
    overflow-y: auto;
    padding-right: 5px;
}

.shop-category-list {
    max-height: 250px;
}

.shop-checkbox-list {
    max-height: 200px;
}

    .shop-category-list::-webkit-scrollbar,
    .shop-checkbox-list::-webkit-scrollbar {
        width: 6px;
    }

    .shop-category-list::-webkit-scrollbar-thumb,
    .shop-checkbox-list::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

        .shop-category-list::-webkit-scrollbar-thumb:hover,
        .shop-checkbox-list::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

/* ---------- 14 PAGINATION ---------- */
.premium-pagination-container {
    margin-top: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.premium-pagination {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 6px 12px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: 999px;
    box-shadow: var(--shadow);
}

    .premium-pagination .page-item .page-link {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        color: var(--c-dark);
        background: #f8f9fa;
        border: 1px solid var(--c-line);
        text-decoration: none;
        transition: all .3s cubic-bezier(.4, 0, .2, 1);
    }

    .premium-pagination .page-item:not(.disabled) .page-link:hover {
        background: var(--c-dark);
        border-color: var(--c-dark);
        color: #fff;
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

    .premium-pagination .page-item.disabled .page-link {
        color: #cbd5e1;
        background: #f3f4f6;
        cursor: not-allowed;
        pointer-events: none;
    }

    .premium-pagination .page-status {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 0 8px;
        font-size: var(--fs-sm);
        font-weight: 500;
        color: var(--c-muted);
        user-select: none;
    }

        .premium-pagination .page-status .current-page {
            color: var(--c-dark);
            font-weight: 700;
        }

        .premium-pagination .page-status .separator {
            color: #d1d5db;
        }

/* ---------- 15 RESPONSIVE TWEAKS ---------- */
@media (max-width: 575.98px) {
    :root {
        --fs-base: .9rem;
    }

    .cart-card {
        padding: 10px;
    }

    .cart-img img {
        width: 64px;
        height: 64px;
    }

    .premium-pagination {
        gap: 6px;
        padding: 5px 8px;
    }

        .premium-pagination .page-item .page-link {
            width: 34px;
            height: 34px;
        }

    .product-img img {
        max-height: 150px;
    }
}

@media (min-width: 768px) {
    .product-card .product-img img {
        max-height: 200px;
    }
}

@media (min-width: 1200px) {
    body {
        font-size: 1rem;
    }
}
