/* =========================================================
   Bismillah Family Mart — Customer Portal CSS
   Design System: Red #C8102E + White + Dark Gray
   ========================================================= */

/* ─── Google Fonts ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables ───────────────────────────────────────── */
:root {
    --red:          #C8102E;
    --red-dark:     #a00d24;
    --red-darker:   #7a0019;
    --red-light:    #fff1f3;
    --red-muted:    #fce7ea;
    --white:        #ffffff;
    --off-white:    #fafafa;
    --gray-50:      #f9fafb;
    --gray-100:     #f3f4f6;
    --gray-200:     #e5e7eb;
    --gray-300:     #d1d5db;
    --gray-400:     #9ca3af;
    --gray-500:     #6b7280;
    --gray-600:     #4b5563;
    --gray-700:     #374151;
    --gray-800:     #1f2937;
    --gray-900:     #111827;
    --green:        #10b981;
    --green-light:  #d1fae5;
    --yellow:       #f59e0b;
    --yellow-light: #fef3c7;
    --blue:         #3b82f6;

    --font:         'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm:    6px;
    --radius:       10px;
    --radius-lg:    16px;
    --radius-xl:    24px;
    --radius-full:  9999px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow:     0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
    --shadow-md:  0 8px 24px rgba(0,0,0,.1);
    --shadow-lg:  0 16px 48px rgba(0,0,0,.12);
    --shadow-red: 0 8px 24px rgba(200,16,46,.25);

    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;

    --header-height: 70px;
    --sidebar-width: 260px;
}

/* ─── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
ul, ol { list-style: none; }
input, select, textarea { font-family: var(--font); }

/* ─── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
    font-weight: 700;
    color: var(--gray-900);
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

p { color: var(--gray-600); }

/* ─── Layout Utilities ────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}
.container-sm { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-sm { padding: 40px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    white-space: nowrap;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    opacity: 0;
    transition: opacity var(--transition);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(200,16,46,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-red);
}

.btn-outline {
    background: transparent;
    color: var(--red);
    border-color: var(--red);
}
.btn-outline:hover { background: var(--red); color: white; }

.btn-ghost {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-200); }

.btn-white {
    background: white;
    color: var(--red);
    border-color: white;
}
.btn-white:hover { background: var(--red-light); }

.btn-sm { padding: 7px 16px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius); }
.btn-icon-sm { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); }

/* Ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-anim 0.5s linear;
    background: rgba(255,255,255,0.4);
}
@keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* ─── Header ──────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    box-shadow: var(--shadow-sm);
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--red);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}
.logo span { color: var(--gray-900); font-weight: 400; }

.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}
.header-search input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition);
    background: var(--gray-50);
}
.header-search input:focus {
    border-color: var(--red);
    background: white;
}
.header-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
    pointer-events: none;
}
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}
.search-dropdown.show { display: block; }
.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    transition: background var(--transition);
    cursor: pointer;
}
.search-item:hover { background: var(--gray-50); }
.search-item img {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}
.search-item-name { font-size: 0.875rem; font-weight: 500; }
.search-item-price { font-size: 0.8rem; color: var(--red); font-weight: 600; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
}
.header-btn:hover { background: var(--gray-100); color: var(--red); }

.cart-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    animation: pop 0.3s ease;
}
@keyframes pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    cursor: pointer;
    background: none;
    border: none;
}
.hamburger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all var(--transition);
}

/* Mobile Nav Drawer */
.mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
}
.mobile-nav.open { display: flex; }
.mobile-nav-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}
.mobile-nav-drawer {
    position: relative;
    z-index: 1;
    width: 280px;
    height: 100%;
    background: white;
    padding: 24px 20px;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* ─── Category Nav Bar ────────────────────────────────────── */
.cat-nav {
    background: var(--red);
    overflow: hidden;
}
.cat-nav-inner {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    white-space: nowrap;
    color: rgba(255,255,255,0.85);
    font-size: 0.825rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.cat-nav-item:hover, .cat-nav-item.active {
    color: white;
    background: rgba(255,255,255,0.12);
    border-bottom-color: white;
}
.cat-nav-item img {
    width: 20px; height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

/* ─── Hero Slider ──────────────────────────────────────────── */
.hero-slider {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background: var(--gray-100);
    height: 420px;
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    transform: scale(1.03);
}
.hero-slide.active {
    opacity: 1;
    transform: scale(1);
}
.hero-slide img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.hero-slide-content {
    position: absolute;
    top: 50%; left: 60px;
    transform: translateY(-50%);
    max-width: 420px;
    color: white;
    animation: fadeUp 0.6s ease 0.2s both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(calc(-50% + 20px)); }
    to { opacity: 1; transform: translateY(-50%); }
}
.hero-slide-content h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hero-slide-content p { margin: 10px 0 20px; opacity: 0.9; font-size: 1rem; }
.hero-dots {
    position: absolute;
    bottom: 16px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 8px;
}
.hero-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}
.hero-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}
.hero-arrow {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    box-shadow: var(--shadow);
}
.hero-arrow:hover { background: white; transform: translateY(-50%) scale(1.1); }
.hero-arrow-left { left: 16px; }
.hero-arrow-right { right: 16px; }

/* ─── Section Headers ──────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px;
}
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    position: relative;
    padding-left: 14px;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0; top: 15%; bottom: 15%;
    width: 4px;
    background: var(--red);
    border-radius: 2px;
}
.see-all {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--red);
    transition: color var(--transition);
    white-space: nowrap;
}
.see-all:hover { color: var(--red-dark); text-decoration: underline; }

/* ─── Product Card ─────────────────────────────────────────── */
.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: all var(--transition-slow);
    position: relative;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--gray-200);
}

.product-img-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--gray-50);
}
.product-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.06); }

.product-badge {
    position: absolute;
    top: 10px; left: 10px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-sale { background: var(--red); color: white; }
.badge-new { background: var(--green); color: white; }
.badge-hot { background: var(--yellow); color: white; }
.badge-out { background: var(--gray-500); color: white; }

.wishlist-btn {
    position: absolute;
    top: 10px; right: 10px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    color: var(--gray-400);
}
.wishlist-btn:hover, .wishlist-btn.active { color: var(--red); transform: scale(1.1); }
.wishlist-btn.active { background: var(--red-light); }

.product-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.product-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-unit { font-size: 0.75rem; color: var(--gray-400); }
.product-rating {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.75rem; color: var(--gray-500);
}
.stars { color: var(--yellow); font-size: 0.75rem; }

.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}
.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--red);
}
.product-price-old {
    font-size: 0.8rem;
    color: var(--gray-400);
    text-decoration: line-through;
}
.product-discount {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--green);
    background: var(--green-light);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.qty-btn {
    width: 30px; height: 30px;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: background var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: var(--gray-100); color: var(--red); }
.qty-num {
    width: 30px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    outline: none;
}

.add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
    margin-top: 8px;
}
.add-to-cart-btn:hover { background: var(--red-dark); transform: translateY(-1px); }
.add-to-cart-btn.loading { opacity: 0.7; pointer-events: none; }

/* ─── Product Carousel ─────────────────────────────────────── */
.product-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}
.product-carousel::-webkit-scrollbar { display: none; }
.product-carousel .product-card {
    flex: 0 0 calc(25% - 12px);
    scroll-snap-align: start;
    min-width: 200px;
}

/* ─── Category Grid ────────────────────────────────────────── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}
.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: white;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--gray-100);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}
.cat-item:hover {
    border-color: var(--red);
    background: var(--red-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.cat-item img {
    width: 52px; height: 52px;
    object-fit: contain;
    border-radius: var(--radius);
}
.cat-item-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius);
    background: var(--red-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
}
.cat-item-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-700);
}
.cat-item:hover .cat-item-name { color: var(--red); }

/* ─── Cart Page ────────────────────────────────────────────── */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}
.cart-table {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: var(--gray-50); }
.cart-item-img {
    width: 70px; height: 70px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}
.cart-item-name { font-size: 0.9rem; font-weight: 600; }
.cart-item-price { font-size: 0.875rem; color: var(--red); font-weight: 600; }
.remove-item {
    margin-left: auto;
    background: none; border: none;
    color: var(--gray-400); cursor: pointer;
    font-size: 1.1rem; padding: 4px;
    transition: color var(--transition);
    flex-shrink: 0;
}
.remove-item:hover { color: var(--red); }

.cart-summary {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--header-height) + 16px);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-100);
}
.summary-row:last-of-type { border-bottom: 2px solid var(--gray-200); }
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
}
.coupon-form {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}
.coupon-form input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
    outline: none;
}
.coupon-form input:focus { border-color: var(--red); }

/* ─── Checkout ──────────────────────────────────────────────── */
.checkout-steps {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    padding: 4px;
}
.checkout-step-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    transition: all var(--transition);
}
.checkout-step-tab.active {
    background: var(--red);
    color: white;
    box-shadow: var(--shadow-red);
}
.checkout-step-tab.done { color: var(--green); }

.payment-method-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}
.payment-method-card:hover { border-color: var(--red); }
.payment-method-card.selected {
    border-color: var(--red);
    background: var(--red-light);
}
.payment-method-card .pm-icon {
    width: 48px; height: 32px;
    object-fit: contain;
    border-radius: 4px;
}
.payment-method-card .pm-name { font-weight: 600; font-size: 0.875rem; }
.payment-method-card .pm-desc { font-size: 0.75rem; color: var(--gray-500); }

/* ─── Order Status Tracker ─────────────────────────────────── */
.order-tracker {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 20px;
    margin: 32px 0;
}
.order-tracker::before {
    content: '';
    position: absolute;
    top: 20px; left: 40px; right: 40px;
    height: 3px;
    background: var(--gray-200);
    z-index: 0;
}
.tracker-progress {
    position: absolute;
    top: 20px; left: 40px;
    height: 3px;
    background: var(--red);
    z-index: 1;
    transition: width 1s ease;
}
.tracker-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
    position: relative;
}
.tracker-dot {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: var(--gray-400);
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-slow);
}
.tracker-step.done .tracker-dot { background: var(--red); color: white; }
.tracker-step.active .tracker-dot {
    background: var(--red);
    color: white;
    box-shadow: 0 0 0 6px rgba(200,16,46,0.15);
}
.tracker-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    text-align: center;
    white-space: nowrap;
}
.tracker-step.done .tracker-label,
.tracker-step.active .tracker-label { color: var(--red); }

/* ─── Toast Notifications ─────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20000;
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--gray-900);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 320px;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(100%); }
}
.toast.hiding { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast.success { background: #065f46; }
.toast.error   { background: #991b1b; }
.toast.warning { background: #92400e; }
.toast.info    { background: #1e40af; }
.toast-close {
    margin-left: auto; background: none; border: none;
    color: rgba(255,255,255,0.7); cursor: pointer; font-size: 1rem; flex-shrink: 0;
}

/* ─── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-label .required { color: var(--red); }
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
    transition: all var(--transition);
    background: white;
    color: var(--gray-800);
}
.form-control:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,0.1); }
.form-control.error { border-color: var(--red); }
.form-control.success { border-color: var(--green); }
.form-error { font-size: 0.8rem; color: var(--red); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.form-hint { font-size: 0.78rem; color: var(--gray-400); margin-top: 4px; }

textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { appearance: none; cursor: pointer; }

/* ─── Cards ────────────────────────────────────────────────── */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}
.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body { padding: 24px; }
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* ─── Badge ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ─── Stars ─────────────────────────────────────────────────── */
.star-rating {
    display: inline-flex;
    gap: 2px;
}
.star-rating .star {
    font-size: 1rem;
    color: var(--gray-300);
    cursor: pointer;
    transition: color var(--transition);
}
.star-rating .star.filled,
.star-rating .star:hover,
.star-rating .star:hover ~ .star { color: var(--yellow); }

/* ─── Empty State ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { color: var(--gray-400); font-size: 0.9rem; margin-bottom: 24px; }

/* ─── Spinner / Loader ──────────────────────────────────────── */
.spinner {
    width: 22px; height: 22px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.spinner-dark {
    border: 2.5px solid var(--gray-200);
    border-top-color: var(--red);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9998;
}

/* ─── Footer ────────────────────────────────────────────────── */
.site-footer {
    background: var(--gray-900);
    color: rgba(255,255,255,0.8);
    padding: 60px 0 0;
    margin-top: 80px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}
.footer-brand .logo { color: white; font-size: 1.4rem; }
.footer-brand .logo span { opacity: 0.7; }
.footer-brand p { margin-top: 12px; font-size: 0.875rem; line-height: 1.7; opacity: 0.7; }
.footer-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity var(--transition);
}
.footer-links a:hover { opacity: 1; color: var(--red); }
.social-links { display: flex; gap: 10px; margin-top: 16px; }
.social-btn {
    width: 38px; height: 38px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    transition: all var(--transition);
    color: white;
}
.social-btn:hover { background: var(--red); transform: translateY(-2px); }
.footer-contact { display: flex; flex-direction: column; gap: 10px; }
.footer-contact-item {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 0.85rem; opacity: 0.7;
}
.footer-contact-item span:first-child { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }
.newsletter-form {
    display: flex; gap: 8px; margin-top: 12px;
}
.newsletter-form input {
    flex: 1; padding: 10px 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    color: white;
    font-size: 0.875rem;
    font-family: var(--font);
    outline: none;
}
.newsletter-form input::placeholder { opacity: 0.5; color: white; }
.newsletter-form input:focus { border-color: var(--red); }
.newsletter-form button {
    padding: 10px 16px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    font-family: var(--font);
}
.newsletter-form button:hover { background: var(--red-dark); }
.footer-bottom {
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ─── Map embed ──────────────────────────────────────────────── */
.map-embed {
    width: 100%; height: 180px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 16px;
}
.map-embed iframe { width: 100%; height: 100%; border: none; }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 40px;
}
.page-btn {
    width: 38px; height: 38px;
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    background: white;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.page-btn:hover { border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); color: white; border-color: var(--red); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Sticky Mobile Cart Bar ────────────────────────────────── */
.mobile-cart-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 12px 20px;
    z-index: 999;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}

/* ─── Animations ────────────────────────────────────────────── */
.fade-in {
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

[data-aos] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Responsive Breakpoints ─────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .product-carousel .product-card { flex: 0 0 calc(33.333% - 12px); }
}

/* Mobile */
@media (max-width: 768px) {
    :root { --header-height: 60px; }
    .header-search { max-width: none; }
    .hamburger { display: flex; }
    .header-search { display: none; }
    .header-actions .header-btn-text { display: none; }
    .hero-slider { height: 250px; }
    .hero-slide-content { left: 20px; max-width: 70%; }
    .hero-slide-content h2 { font-size: 1.2rem; }
    .hero-slide-content p { display: none; }
    .section { padding: 40px 0; }
    .section-title { font-size: 1.1rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .product-carousel .product-card { flex: 0 0 calc(50% - 8px); }
    .cat-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .mobile-cart-bar { display: flex; align-items: center; gap: 12px; }
    .order-tracker { overflow-x: auto; padding-bottom: 16px; }
    .toast-container { left: 12px; right: 12px; bottom: 80px; }
}

/* Small Mobile */
@media (max-width: 480px) {
    .product-carousel .product-card { flex: 0 0 calc(75% - 8px); }
    .checkout-steps { display: none; }
    .hero-arrow { display: none; }
    .cat-item { padding: 10px 4px; }
    .cat-item-icon { width: 40px; height: 40px; font-size: 1.3rem; }
}
