/* ============================================================
   eMart - Professional Ecommerce CSS Theme
   Price-Range Based: 1-99 MART | 100-999 MART | 999+ MART
   ============================================================ */

/* 1. CSS VARIABLES
   ------------------------------------------------------------ */
:root {
    --primary-color: #e53935;
    --primary-dark: #c62828;
    --primary-light: #ff6f60;
    --secondary-color: #ff6f00;
    --accent-color: #ffc107;
    --success-color: #43a047;
    --danger-color: #e53935;
    --warning-color: #fb8c00;
    --info-color: #039be5;
    --text-dark: #212121;
    --text-body: #424242;
    --text-muted: #757575;
    --text-light: #9e9e9e;
    --bg-white: #ffffff;
    --bg-light: #f5f5f5;
    --bg-lighter: #fafafa;
    --bg-dark: #1a1a2e;
    --bg-darker: #16213e;
    --border-color: #e0e0e0;
    --border-light: #eeeeee;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 50px;
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
    --container-max: 1280px;
    --header-height: 70px;
    --topbar-height: 36px;
    --mart-bar-height: 50px;
}

/* 2. BASE STYLES
   ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; scroll-behavior: smooth; }
@media (min-width: 768px) { html { font-size: 15px; } }
@media (min-width: 1200px) { html { font-size: 16px; } }

body {
    font-family: var(--font-family);
    color: var(--text-body);
    background-color: var(--bg-light);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: var(--primary-color); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

ul { list-style: none; padding: 0; margin: 0; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 0;
}

.container, .container-fluid { width: 100%; margin: 0 auto; padding: 0 15px; }
.container { max-width: var(--container-max); }

::selection { background-color: var(--primary-color); color: #fff; }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-light);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* 3. TOP UTILITY BAR
   ------------------------------------------------------------ */
.top-bar {
    background: var(--primary-color, #e53935);
    color: #fff;
    font-size: 0.78rem;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1001;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left, .top-bar-right {
    display: flex;
    align-items: center;
    gap: 0;
}

.top-bar a {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.78rem;
    transition: color var(--transition-fast);
    padding: 0 10px;
    white-space: nowrap;
}
.top-bar a:hover { color: #fff; text-decoration: underline; }

.top-bar-login { font-weight: 700; text-transform: uppercase; font-style: italic; }

.top-bar-divider {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.top-bar-label {
    font-size: 0.78rem;
    padding: 0 6px;
    white-space: nowrap;
}

.top-bar-social {
    display: flex;
    gap: 8px;
    margin-left: 2px;
}
.top-bar-social a { padding: 0 4px; }

/* 4. MAIN HEADER
   ------------------------------------------------------------ */
.main-header {
    background: var(--bg-white);
    height: var(--header-height);
    position: relative;
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.main-header .container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 20px;
}

/* Header Left: Hamburger + Logo */
.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.hamburger-btn {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 1.15rem;
    transition: all var(--transition-fast);
}
.hamburger-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(229, 57, 53, 0.04);
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* Header Center: Mart Tabs */
.header-center {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.mart-switcher-inline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mart-form-inline { display: inline; }

.mart-tab {
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border-radius: var(--radius-full);
}

.mart-tab:hover {
    color: var(--tab-color, var(--primary-color));
    background: rgba(229, 57, 53, 0.06);
}

.mart-tab.active {
    color: #fff;
    background: var(--tab-color, var(--primary-color));
}

.mart-tab-divider {
    color: var(--border-color);
    font-weight: 300;
    user-select: none;
    font-size: 1.1rem;
}

/* Header Right: Search + Icons */
.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    flex: 1;
    justify-content: flex-end;
}

.header-search-form {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 420px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.header-search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    background: var(--bg-white);
}

.header-search-form .form-control {
    flex: 1;
    padding: 9px 14px;
    border: none;
    background: transparent;
    font-size: 0.88rem;
    font-family: var(--font-family);
    color: var(--text-dark);
    outline: none;
    min-width: 0;
    box-shadow: none !important;
}

.header-search-form .form-control::placeholder { color: var(--text-light); }

.header-search-form .btn-search {
    background: var(--primary-color);
    border: none;
    color: #fff;
    padding: 9px 18px;
    cursor: pointer;
    font-size: 1rem;
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}
.header-search-form .btn-search:hover { background: var(--primary-dark); }

/* Header Icon Buttons (Wishlist, Cart) */
.header-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--text-dark);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 1.2rem;
    flex-shrink: 0;
}
.header-icon-btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.icon-badge {
    position: absolute;
    top: 0;
    right: -2px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--bg-white);
}

/* 4b. VISIBLE NAVIGATION BAR (below header, scrolls away)
   ------------------------------------------------------------ */
.main-nav {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light, #eee);
    border-bottom: 2px solid var(--primary-color);
    position: relative;
    z-index: 998;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: var(--text-dark, #222);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.nav-links li a i {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    transition: color 0.2s;
}

.nav-links li a:hover {
    color: var(--primary-color);
    background: rgba(229, 57, 53, 0.04);
}

.nav-links li a:hover i {
    color: var(--primary-color);
}

/* 5. STICKY COMPACT BAR (scroll-triggered)
   ------------------------------------------------------------ */
.sticky-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    z-index: 1100;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

.sticky-bar.visible {
    transform: translateY(0);
}

.sticky-bar .container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sticky-hamburger {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.sticky-hamburger:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.sticky-logo {
    flex-shrink: 0;
}
.sticky-logo a {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
}

.sticky-mart-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.sticky-mart-tab {
    background: none;
    border: 1px solid var(--border-color);
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-muted);
    white-space: nowrap;
}
.sticky-mart-tab.active {
    background: var(--tab-color, var(--primary-color));
    color: #fff;
    border-color: var(--tab-color, var(--primary-color));
}
.sticky-mart-tab:not(.active):hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.sticky-search-form {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-light);
}
.sticky-search-form .form-control {
    border: none;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-family: var(--font-family);
    background: transparent;
    flex: 1;
    outline: none;
    box-shadow: none !important;
}
.sticky-search-form .btn-search {
    background: var(--primary-color);
    border: none;
    color: #fff;
    padding: 6px 14px;
    font-size: 0.9rem;
    border-radius: 0;
    cursor: pointer;
}

.sticky-cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1.1rem;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}
.sticky-cart-btn:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

/* 6. HAMBURGER DROPDOWN MENU (under sticky bar)
   ------------------------------------------------------------ */
.sticky-hamburger-wrap {
    position: relative;
    flex-shrink: 0;
}

.hamburger-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    max-height: 70vh;
    overflow-y: auto;
}
.hamburger-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hamburger-dropdown-nav {
    list-style: none;
    padding: 6px 0;
    margin: 0;
}
.hamburger-dropdown-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--text-body);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}
.hamburger-dropdown-nav li a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}
.hamburger-dropdown-nav li a i {
    width: 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.hamburger-dropdown-nav li a:hover i { color: var(--primary-color); }

.hamburger-dropdown-nav .dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 6px 14px;
    list-style: none;
}
.hamburger-dropdown-nav .dropdown-heading {
    padding: 8px 18px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    list-style: none;
}

/* 7. (Legacy hero - kept for reference, overridden by Index.cshtml inline styles) */

/* 8. FEATURES BAR
   ------------------------------------------------------------ */
.features-bar {
    background: var(--bg-white);
    padding: 24px 0;
    border-bottom: 1px solid var(--border-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.feature-box:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
}

.feature-box .feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-box h4 {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.feature-box p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* 9. CATEGORIES SECTION
   ------------------------------------------------------------ */
.categories-section {
    padding: 40px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.category-card .cat-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.08), rgba(229, 57, 53, 0.04));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: all var(--transition-normal);
}

.category-card:hover .cat-icon {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
}

.category-card .cat-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.category-card h5 {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text-dark);
}

.category-card .cat-count {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* 10. PRODUCT CARDS
   ------------------------------------------------------------ */
.product-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.product-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--bg-lighter);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card-image img {
    transform: scale(1.06);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-badge span {
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-sale {
    background: var(--danger-color);
    color: #fff;
}

.badge-new {
    background: var(--success-color);
    color: #fff;
}

.badge-hot {
    background: var(--secondary-color);
    color: #fff;
}

.badge-discount {
    background: var(--accent-color);
    color: var(--text-dark);
}

.product-actions {
    position: absolute;
    top: 10px;
    right: -50px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
    transition: right var(--transition-normal);
}

.product-card:hover .product-actions {
    right: 10px;
}

.product-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-white);
    border: none;
    color: var(--text-body);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.product-action-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
}

.product-action-btn.wishlisted {
    color: var(--danger-color);
}

.product-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card-category {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-card-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-card-title a {
    color: inherit;
    text-decoration: none;
}
.product-card-title a:hover { color: var(--primary-color); }

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.product-rating .stars {
    display: flex;
    gap: 1px;
}

.product-rating .star {
    color: var(--accent-color);
    font-size: 0.75rem;
}

.product-rating .star.empty { color: var(--border-color); }

.product-rating .rating-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.product-card-price {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.price-current {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-original {
    font-size: 0.82rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.price-discount {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--success-color);
    background: rgba(67, 160, 71, 0.1);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

.product-card-footer {
    padding: 0 14px 14px;
}

.product-add-to-cart {
    width: 100%;
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.product-add-to-cart:hover {
    background: var(--primary-color);
    color: #fff;
}

.product-add-to-cart i { font-size: 0.9rem; }

/* 11. PRODUCTS SECTION
   ------------------------------------------------------------ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-color);
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.section-header .view-all {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-header .view-all:hover { gap: 8px; }

.products-section { padding: 40px 0; }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.products-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* 12. PRODUCT DETAILS PAGE
   ------------------------------------------------------------ */
.product-details-section { padding: 30px 0 50px; }

.product-details-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.product-gallery { position: relative; }

.product-gallery-main {
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--bg-lighter);
    margin-bottom: 12px;
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-gallery-thumbs {
    display: flex;
    gap: 8px;
}

.product-gallery-thumbs .thumb {
    width: 70px;
    height: 70px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.product-gallery-thumbs .thumb.active,
.product-gallery-thumbs .thumb:hover {
    border-color: var(--primary-color);
}

.product-gallery-thumbs .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.product-info .product-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.product-info .product-meta .rating-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--accent-color);
}

.product-info .detail-price {
    padding: 16px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.product-info .detail-price .current-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-info .detail-price .original-price {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 12px;
}

.product-info .detail-price .save-badge {
    display: inline-block;
    background: rgba(229, 57, 53, 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    margin-left: 12px;
}

.product-info .detail-variants {
    margin-bottom: 20px;
}

.detail-variants label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.variant-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.variant-option {
    padding: 6px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    color: var(--text-body);
}

.variant-option:hover { border-color: var(--primary-color); }

.variant-option.selected {
    border-color: var(--primary-color);
    background: rgba(229, 57, 53, 0.05);
    color: var(--primary-color);
    font-weight: 600;
}

.detail-quantity {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.detail-quantity label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.qty-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.qty-selector button {
    width: 38px;
    height: 38px;
    background: var(--bg-light);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-body);
    transition: all var(--transition-fast);
}

.qty-selector button:hover {
    background: var(--primary-color);
    color: #fff;
}

.qty-selector input {
    width: 50px;
    height: 38px;
    border: none;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-family);
    color: var(--text-dark);
}

.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-actions .btn {
    flex: 1;
    min-width: 140px;
}

.product-tabs {
    margin-top: 40px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.product-tabs .tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    gap: 0;
    margin-bottom: 24px;
}

.product-tabs .tab-nav button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.product-tabs .tab-nav button.active,
.product-tabs .tab-nav button:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}


.review-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.review-item:last-child { border-bottom: none; }

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.review-author { font-weight: 600; font-size: 0.9rem; }
.review-date { font-size: 0.78rem; color: var(--text-muted); }
.review-text { font-size: 0.88rem; line-height: 1.7; color: var(--text-body); }

/* 13. SEARCH / BROWSE PAGE
   ------------------------------------------------------------ */
.browse-section { padding: 30px 0 50px; }

.browse-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

.browse-sidebar {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

.filter-group { margin-bottom: 22px; }
.filter-group:last-child { margin-bottom: 0; }

.filter-group h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.84rem;
    color: var(--text-body);
    cursor: pointer;
}

.filter-group label:hover { color: var(--primary-color); }

.filter-group input[type="checkbox"],
.filter-group input[type="radio"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
}

.price-range-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.price-range-inputs input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: var(--font-family);
}

.price-range-inputs span { color: var(--text-muted); }

.browse-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.browse-toolbar .result-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.browse-toolbar .sort-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.82rem;
    color: var(--text-body);
}

.browse-toolbar .view-toggle {
    display: flex;
    gap: 4px;
}

.browse-toolbar .view-toggle button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.browse-toolbar .view-toggle button.active,
.browse-toolbar .view-toggle button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(229, 57, 53, 0.05);
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination {
    display: flex;
    gap: 6px;
}

.pagination a, .pagination span {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    color: var(--text-body);
    background: var(--bg-white);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* 14. CART PAGE
   ------------------------------------------------------------ */
.cart-section { padding: 30px 0 50px; }

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

.cart-table-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table thead {
    background: var(--bg-light);
}

.cart-table th {
    padding: 14px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
}

.cart-table td {
    padding: 18px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.cart-table tr:last-child td { border-bottom: none; }

.cart-product-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cart-product-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-lighter);
}

.cart-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-product-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-dark);
}

.cart-product-variant {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.cart-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
}

.cart-qty .qty-selector { display: inline-flex; }

.cart-subtotal {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
}

.cart-remove {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.cart-remove:hover { color: var(--danger-color); }

.cart-summary {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

.cart-summary h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.88rem;
}

.cart-summary-row.total {
    border-top: 2px solid var(--border-color);
    margin-top: 10px;
    padding-top: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.cart-summary-row.total span:last-child { color: var(--primary-color); }

.cart-summary .coupon-input {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.cart-summary .coupon-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.82rem;
}

/* 15. CHECKOUT PAGE
   ------------------------------------------------------------ */
.checkout-section { padding: 30px 0 50px; }

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

.checkout-form {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.checkout-form h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--danger-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.88rem;
    color: var(--text-dark);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    outline: none;
}

.form-group textarea { resize: vertical; min-height: 80px; }

.payment-methods {
    margin-top: 24px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.payment-option:hover,
.payment-option.selected {
    border-color: var(--primary-color);
    background: rgba(229, 57, 53, 0.03);
}

.payment-option input[type="radio"] {
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
}

.payment-option .payment-label {
    font-size: 0.88rem;
    font-weight: 600;
}

.payment-option .payment-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.order-summary {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

.order-summary h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.order-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.order-item:last-of-type { border-bottom: none; }

.order-item-img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-lighter);
}

.order-item-img img { width: 100%; height: 100%; object-fit: cover; }

.order-item-info { flex: 1; }

.order-item-name {
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 3px;
}

.order-item-qty { font-size: 0.75rem; color: var(--text-muted); }

.order-item-price {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

/* 16. ACCOUNT PAGES
   ------------------------------------------------------------ */
.account-section { padding: 30px 0 50px; }

.account-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
    align-items: start;
}

.account-sidebar {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.account-sidebar-header {
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
}

.account-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.account-name { font-weight: 600; font-size: 1rem; }
.account-email { font-size: 0.78rem; opacity: 0.85; }

.account-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    color: var(--text-body);
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.account-menu a:last-child { border-bottom: none; }

.account-menu a:hover,
.account-menu a.active {
    color: var(--primary-color);
    background: rgba(229, 57, 53, 0.04);
    padding-left: 26px;
}

.account-menu a.active { border-left: 3px solid var(--primary-color); }

.account-menu a i { width: 20px; text-align: center; font-size: 0.95rem; }

.account-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.account-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.dashboard-card {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all var(--transition-normal);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dashboard-card .card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.dashboard-card .card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.dashboard-card .card-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.order-table {
    width: 100%;
    border-collapse: collapse;
}

.order-table th {
    padding: 12px 16px;
    background: var(--bg-light);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
}

.order-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.order-status {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
}

.order-status.pending { background: #fff3e0; color: #e65100; }
.order-status.processing { background: #e3f2fd; color: #1565c0; }
.order-status.shipped { background: #e8f5e9; color: #2e7d32; }
.order-status.delivered { background: #e8f5e9; color: #1b5e20; }
.order-status.cancelled { background: #ffebee; color: #c62828; }

/* 17. AUTH MODAL
   ------------------------------------------------------------ */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.auth-overlay.show {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    width: 420px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-normal);
    position: relative;
}

.auth-overlay.show .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    z-index: 1;
}

.auth-modal-close:hover {
    background: var(--danger-color);
    color: #fff;
}

.auth-modal-header {
    padding: 30px 30px 0;
    text-align: center;
}

.auth-modal-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-modal-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-tabs {
    display: flex;
    margin: 20px 30px 0;
    border-bottom: 2px solid var(--border-light);
}

.auth-tabs button {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-tabs button.active,
.auth-tabs button:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-form {
    padding: 24px 30px 30px;
}

.auth-form .form-group { margin-bottom: 16px; }

.auth-form .form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.auth-form .form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.88rem;
    transition: all var(--transition-fast);
}

.auth-form .form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    outline: none;
}

.auth-form .form-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    font-size: 0.82rem;
}

.auth-form .forgot-link { color: var(--primary-color); font-weight: 500; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-body);
}

.social-btn:hover { background: var(--bg-light); box-shadow: var(--shadow-sm); }

.social-btn img { width: 20px; height: 20px; }

/* 18. CART SIDEBAR
   ------------------------------------------------------------ */
.cart-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.cart-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-white);
    z-index: 2002;
    display: flex;
    flex-direction: column;
    transition: right var(--transition-normal);
    box-shadow: var(--shadow-xl);
}

.cart-sidebar.show { right: 0; }
body.cart-open { overflow: hidden; }

.cart-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
}

.cart-sidebar-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.cart-sidebar-header .item-count {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 400;
}

.cart-sidebar-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.cart-sidebar-close:hover { background: var(--danger-color); color: #fff; }

.cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.cart-sidebar-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.cart-sidebar-item:last-child { border-bottom: none; }

.cart-sidebar-item-img {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-lighter);
}

.cart-sidebar-item-img img { width: 100%; height: 100%; object-fit: cover; }

.cart-sidebar-item-info { flex: 1; }

.cart-sidebar-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-sidebar-item-price {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color);
}

.cart-sidebar-item-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px;
    transition: color var(--transition-fast);
    align-self: flex-start;
}

.cart-sidebar-item-remove:hover { color: var(--danger-color); }

.cart-sidebar-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.cart-sidebar-empty i { font-size: 3rem; margin-bottom: 14px; display: block; color: var(--border-color); }

.cart-sidebar-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-lighter);
}

.cart-sidebar-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-dark);
}

.cart-sidebar-total span:last-child { color: var(--primary-color); }

.cart-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Cart sidebar item styles (used by JS renderCartSidebar) */
.cart-items { padding: 0; }
.cart-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-lighter);
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.cart-item-title:hover { color: var(--primary-color); }
.cart-item-price {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
}
.cart-item-qty {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.cart-item-qty .qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-light);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.cart-item-qty .qty-btn:hover { background: var(--primary-color); color: #fff; }
.cart-item-qty .qty-value {
    width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    border-left: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
}
.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px;
    transition: color var(--transition-fast);
    align-self: flex-start;
    flex-shrink: 0;
}
.cart-item-remove:hover { color: var(--danger-color); }

/* 19. FOOTER
   ------------------------------------------------------------ */
.site-footer {
    background: var(--bg-dark);
    color: rgba(255, 255, 255, 0.75);
    padding-top: 50px;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-about .footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 14px;
    display: inline-block;
}

.footer-about .footer-logo span { color: var(--primary-color); }

.footer-about p {
    font-size: 0.85rem;
    line-height: 1.7;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.6);
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.footer-social a:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

.footer-column h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-color);
}

.footer-links li { margin-bottom: 8px; }

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links a:hover { color: #fff; padding-left: 4px; }

.footer-contact li {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.footer-contact li i {
    color: var(--primary-color);
    margin-top: 3px;
    width: 16px;
    flex-shrink: 0;
}

.footer-newsletter p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 14px;
}

.newsletter-form {
    display: flex;
    gap: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.newsletter-form input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: var(--font-family);
    font-size: 0.85rem;
}

.newsletter-form input::placeholder { color: rgba(255, 255, 255, 0.4); }

.newsletter-form button {
    padding: 10px 18px;
    background: var(--primary-color);
    border: none;
    color: #fff;
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.newsletter-form button:hover { background: var(--primary-dark); }

.footer-payment {
    margin-top: 20px;
}

.footer-payment span {
    display: block;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.payment-icons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.payment-icons img {
    height: 26px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.payment-icons img:hover { opacity: 1; }

.footer-bottom {
    padding: 18px 0;
    margin-top: 0;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    gap: 18px;
}

.footer-bottom-links a {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer-bottom-links a:hover { color: #fff; }

/* 20. NOTIFICATION TOAST
   ------------------------------------------------------------ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    transform: translateX(120%);
    transition: transform var(--transition-normal);
    border-left: 4px solid var(--text-muted);
}

.toast.show { transform: translateX(0); }

.toast.toast-success { border-left-color: var(--success-color); }
.toast.toast-error { border-left-color: var(--danger-color); }
.toast.toast-warning { border-left-color: var(--warning-color); }
.toast.toast-info { border-left-color: var(--info-color); }

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success-color); }
.toast-error .toast-icon { color: var(--danger-color); }
.toast-warning .toast-icon { color: var(--warning-color); }
.toast-info .toast-icon { color: var(--info-color); }

.toast-body { flex: 1; }

.toast-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    transition: color var(--transition-fast);
}

.toast-close:hover { color: var(--text-dark); }

/* 21. BUTTONS
   ------------------------------------------------------------ */
.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
    transform: translateY(-1px);
}

.btn-primary-custom:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
}

.btn-outline-custom:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
    transform: translateY(-1px);
}

.btn-outline-custom:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-lg { padding: 13px 32px; font-size: 0.95rem; }
.btn-sm { padding: 6px 16px; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn-rounded { border-radius: var(--radius-full); }

.btn-success-custom {
    background: var(--success-color);
    border-color: var(--success-color);
    color: #fff;
}
.btn-success-custom:hover {
    background: #388e3c;
    border-color: #388e3c;
    color: #fff;
}

.btn-warning-custom {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-dark);
}
.btn-warning-custom:hover {
    background: #ffb300;
    border-color: #ffb300;
    color: var(--text-dark);
}

/* 22. UTILITY CLASSES
   ------------------------------------------------------------ */
.text-primary { color: var(--primary-color) !important; }
.text-dark { color: var(--text-dark) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-white { background-color: var(--bg-white) !important; }
.bg-light { background-color: var(--bg-light) !important; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.fs-sm { font-size: 0.82rem; }
.fs-md { font-size: 1rem; }
.fs-lg { font-size: 1.2rem; }
.fs-xl { font-size: 1.5rem; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-4 { margin-top: 32px !important; }
.mt-5 { margin-top: 48px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }
.mb-5 { margin-bottom: 48px !important; }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }
.p-4 { padding: 32px !important; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.overflow-hidden { overflow: hidden; }
.position-relative { position: relative; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    font-size: 0.82rem;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-color); }
.breadcrumb .separator { color: var(--text-light); font-size: 0.7rem; }
.breadcrumb .current { color: var(--text-dark); font-weight: 500; }

/* Loading spinner */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* 23. RESPONSIVE STYLES
   ------------------------------------------------------------ */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
    .products-grid-5 { grid-template-columns: repeat(4, 1fr); }
    .footer-main { grid-template-columns: repeat(2, 1fr); }
    .category-dropdown-toggle { min-width: 200px; }
}

/* Tablets */
@media (max-width: 992px) {
    .header-center { display: none; }
    .sticky-mart-switcher { display: none; }
    .header-search-form { max-width: 320px; }

    .product-details-wrapper { grid-template-columns: 1fr; gap: 24px; }

    .browse-layout { grid-template-columns: 1fr; }
    .browse-sidebar {
        position: static;
        display: none;
    }
    .browse-sidebar.show { display: block; }

    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }

    .checkout-layout { grid-template-columns: 1fr; }
    .order-summary { position: static; }

    .account-layout { grid-template-columns: 1fr; }

    .products-grid-5 { grid-template-columns: repeat(3, 1fr); }

    .footer-main { grid-template-columns: repeat(2, 1fr); gap: 24px; }

    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .top-bar-left { display: none; }
    .top-bar .container { justify-content: flex-end; }

    .header-search-form { display: none; }
    .main-header .container { gap: 10px; }
    .logo-text { font-size: 1.4rem; }
    .logo-mart { font-size: 1.2rem; }

    .nav-links { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .nav-links li a { padding: 10px 14px; font-size: 0.82rem; }
    .nav-links li a i { display: none; }

    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .products-grid-5 { grid-template-columns: repeat(2, 1fr); }

    .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }

    .category-card { padding: 16px 10px; }
    .category-card .cat-icon { width: 44px; height: 44px; font-size: 1.2rem; }

    .section-header h2 { font-size: 1.15rem; }

    .features-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .feature-box { padding: 10px; gap: 10px; }
    .feature-box .feature-icon { width: 40px; height: 40px; font-size: 1rem; }
    .feature-box h4 { font-size: 0.8rem; }
    .feature-box p { font-size: 0.7rem; }

    .cart-table { font-size: 0.82rem; }
    .cart-table th { padding: 10px 12px; }
    .cart-table td { padding: 12px; }
    .cart-product-img { width: 60px; height: 60px; }

    .checkout-form { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }

    .account-sidebar { margin-bottom: 0; }

    .footer-main { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom .container { justify-content: center; text-align: center; }
    .footer-bottom-links { justify-content: center; }

    .product-tabs .tab-nav { overflow-x: auto; }
    .product-tabs .tab-nav button { padding: 10px 16px; font-size: 0.82rem; white-space: nowrap; }

    .auth-modal { width: 100%; max-width: 95vw; }
    .auth-form { padding: 20px; }

    .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile phones */
@media (max-width: 576px) {
    html { font-size: 13px; }

    .top-bar { font-size: 0.7rem; height: 28px; }
    .hamburger-dropdown { min-width: 200px; }
    .sticky-search-form { max-width: none; flex: 1; }
    .main-nav { display: none; }

    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .products-grid-5 { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    .product-card-body { padding: 10px; }
    .product-card-title { font-size: 0.8rem; }
    .price-current { font-size: 0.95rem; }
    .price-original { font-size: 0.75rem; }

    .product-card-footer { padding: 0 10px 10px; }
    .product-add-to-cart { padding: 6px 10px; font-size: 0.75rem; }

    .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .category-card { padding: 12px 6px; }
    .category-card .cat-icon { width: 38px; height: 38px; font-size: 1rem; }
    .category-card h5 { font-size: 0.72rem; }

    .hero-slide { min-height: 220px; }
    .hero-slide-content h1 { font-size: 1.4rem; }
    .hero-slide-content p { font-size: 0.82rem; display: none; }

    .features-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

    .product-details-wrapper { padding: 16px; gap: 20px; }
    .product-info h1 { font-size: 1.2rem; }
    .product-info .detail-price .current-price { font-size: 1.4rem; }
    .detail-actions .btn { min-width: 100px; }

    .cart-sidebar { width: 100%; max-width: 100vw; }

    .toast-container { top: 10px; right: 10px; left: 10px; }
    .toast { min-width: auto; width: 100%; }

    .breadcrumb { font-size: 0.75rem; }

    .order-table { font-size: 0.78rem; }
    .order-table th, .order-table td { padding: 10px 8px; }

    .dashboard-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .dashboard-card { padding: 14px; }
    .dashboard-card .card-value { font-size: 1.2rem; }

    .product-gallery-thumbs .thumb { width: 55px; height: 55px; }

    .back-to-top { width: 38px; height: 38px; bottom: 16px; right: 16px; font-size: 0.9rem; }
}

/* Extra small phones */
@media (max-width: 400px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }

    .header-action-btn { padding: 4px 6px; min-width: 38px; }
    .header-action-btn i { font-size: 1.1rem; }

    .product-card-body { padding: 8px; }
    .product-card-footer { padding: 0 8px 8px; }
}

/* Print styles */
@media print {
    .top-bar, .mart-switcher-bar, .main-nav, .site-footer,
    .cart-sidebar, .auth-overlay, .toast-container,
    .back-to-top, .header-actions, .header-search { display: none !important; }

    .site-header { position: static; box-shadow: none; }

    body { background: #fff; color: #000; }

    .product-card, .cart-table-wrapper, .checkout-form,
    .order-summary, .account-content { box-shadow: none; border: 1px solid #ddd; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fadeIn { animation: fadeIn var(--transition-normal) forwards; }
.animate-fadeInUp { animation: fadeInUp var(--transition-normal) forwards; }
.animate-slideInRight { animation: slideInRight var(--transition-normal) forwards; }
.animate-slideInLeft { animation: slideInLeft var(--transition-normal) forwards; }
.animate-scaleIn { animation: scaleIn var(--transition-normal) forwards; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #9e9e9e; }

/* ============================================================
   VIEW COMPATIBILITY ALIASES
   Maps class names used in views to their CSS-defined equivalents
   ============================================================ */

/* --- Header/Layout compatibility aliases (used by views) --- */
.logo-mart {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark, #222);
    letter-spacing: -0.5px;
    margin-left: 4px;
}

/* Cart sidebar header/close aliases */
.close-cart {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    transition: color var(--transition-fast);
}
.close-cart:hover { color: var(--danger-color); }
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
}
.cart-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

/* --- Footer aliases --- */
.main-footer {
    background: var(--bg-dark);
    color: rgba(255, 255, 255, 0.75);
    padding-top: 50px;
}
.footer-top {
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-widget {
    margin-bottom: 20px;
}
.footer-widget h5 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 10px;
}
.footer-widget h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-color);
}
.footer-widget ul { list-style: none; padding: 0; margin: 0; }
.footer-widget ul li { margin-bottom: 8px; }
.footer-widget ul li a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.footer-widget ul li a:hover { color: #fff; padding-left: 4px; }
.footer-widget ul li a i { color: var(--primary-color); width: 16px; }
.main-footer .footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 14px;
    display: inline-flex;
    gap: 5px;
}
.main-footer .footer-logo .logo-text { color: #fff; font-size: 1.5rem; }
.main-footer .footer-logo .logo-mart { color: var(--primary-color); font-size: 1.5rem; }
.main-footer p {
    font-size: 0.85rem;
    line-height: 1.7;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.6);
}
.social-links {
    display: flex;
    gap: 10px;
}
.social-links a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    text-decoration: none;
}
.social-links a:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}
.main-footer ul.contact-info li {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}
.main-footer ul.contact-info li i {
    color: var(--primary-color);
    margin-top: 3px;
    width: 16px;
    flex-shrink: 0;
}
.main-footer .footer-bottom {
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.main-footer .footer-bottom p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}
.payment-methods {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}
.payment-methods span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}
.payment-methods i {
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition-fast);
}
.payment-methods i:hover { color: rgba(255, 255, 255, 0.8); }

/* --- Cart Sidebar aliases --- */
.cart-sidebar .cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
}
.cart-sidebar .cart-header h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}
.close-cart {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}
.close-cart:hover { background: var(--danger-color); color: #fff; }
.cart-sidebar .cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.empty-cart {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.empty-cart i { font-size: 3rem; margin-bottom: 14px; display: block; color: var(--border-color); }
.empty-cart p { margin-bottom: 15px; }
.cart-sidebar .cart-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-lighter, #fafafa);
}
.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-dark);
}
.cart-subtotal .subtotal-amount { color: var(--primary-color); }
.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}
.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* --- Auth Modal aliases (Bootstrap modal wrapper) --- */
#loginModal .modal-content {
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
}
#loginModal .btn-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1;
}
.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light, #eee);
    margin-bottom: 0;
}
.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted, #757575);
    cursor: pointer;
    transition: all var(--transition-fast, 0.2s ease);
    text-align: center;
}
.auth-tab.active,
.auth-tab:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.auth-content { padding: 0; }
.auth-form {
    display: none;
    padding: 24px 30px 30px;
}
.auth-form.active { display: block; }
.auth-form h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-dark, #212121);
}
.auth-form p {
    font-size: 0.85rem;
    color: var(--text-muted, #757575);
    margin-bottom: 20px;
}
.auth-form .form-control {
    padding: 11px 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--radius-md, 8px);
    font-family: var(--font-family);
    font-size: 0.88rem;
    transition: all var(--transition-fast, 0.2s ease);
}
.auth-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}
.form-options label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.terms-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    cursor: pointer;
}
.terms-check a { color: var(--primary-color); font-weight: 500; }

/* --- Product Card aliases (for _ProductCard partial) --- */
.product-card .product-img {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: var(--bg-lighter, #fafafa);
}
.product-card .product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    padding: 10px;
}
.product-card:hover .product-img img { transform: scale(1.08); }
.product-card .sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger-color, #e53935);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}
.product-card .out-of-stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #757575;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}
.product-card.out-of-stock-card .product-img img {
    opacity: 0.6;
}
.product-card .product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}
.product-card:hover .product-actions { opacity: 1; }
.product-card .product-actions button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-body, #555);
    font-size: 0.85rem;
}
.product-card .product-actions button:hover {
    background: var(--primary-color);
    color: #fff;
}
.product-card .product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-card .product-category {
    font-size: 0.78rem;
    color: var(--text-light, #999);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.product-card .product-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-dark, #333);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    line-height: 1.4;
}
.product-card .product-title:hover { color: var(--primary-color); }
.product-card .product-rating {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.product-card .product-rating i { font-size: 0.75rem; color: #ffc107; }
.product-card .product-rating i.empty { color: #ddd; }
.product-card .product-rating span { font-size: 0.78rem; color: var(--text-light, #999); }
.product-card .product-price { margin-top: auto; margin-bottom: 12px; }
.product-card .product-price .final-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
}
.product-card .product-price .original-price {
    font-size: 0.85rem;
    color: var(--text-light, #999);
    text-decoration: line-through;
    margin-left: 8px;
}
.product-card .btn-add-cart {
    width: 100%;
    padding: 8px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: var(--font-family);
}
.product-card .btn-add-cart:hover {
    background: var(--primary-color);
    color: #fff;
}
.product-card .btn-add-cart i { margin-right: 5px; }

/* --- Search Page aliases --- */
.search-filters { margin-bottom: 20px; }
.filter-section { margin-bottom: 20px; }
.filter-section h5 {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light, #eee);
}

/* --- Product grid (ensures consistent layout) --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 1200px) { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .products-grid { grid-template-columns: 1fr; } }
