:root {
    --bs-primary: #d4af37; /* Gold */
    --bs-primary-rgb: 212, 175, 55;
    --royal-blue: #4169e1; /* Light Royal Blue */
    --light-blue: #e0e7ff; /* Soft tint */
    --bg-main: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --font: 'Outfit', sans-serif;
}

body.dark-mode {
    --bg-main: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    background-color: var(--bg-main);
    color: var(--text-main);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography and common */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

.text-muted-custom {
    color: var(--text-muted) !important;
}

/* Top Promo Bar */
.top-promo {
    background-color: var(--royal-blue);
    color: white;
    font-size: 0.85rem;
    padding: 8px 0;
    font-weight: 600;
}

/* Main Header */
.main-header {
    background-color: white;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}
body.dark-mode .main-header {
    background-color: #1e293b;
    border-color: #334155;
}

/* Search Group & Dropdown */
.search-input {
    border-radius: 50px 0 0 50px;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-right: none;
    padding-left: 1.5rem;
}
.search-input:focus {
    box-shadow: none;
    border-color: var(--bs-primary);
}
body.dark-mode .search-input {
    background-color: #334155;
    color: white;
    border-color: #475569;
}
.search-btn {
    border-radius: 0 50px 50px 0;
    background-color: var(--bs-primary);
    color: white;
    border: none;
    padding: 0 1.5rem;
    font-weight: 600;
    transition: background-color 0.2s;
}
.search-btn:hover {
    background-color: #bfa032;
    color: white;
}
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 1050;
    max-height: 400px;
    overflow-y: auto;
    display: none; /* toggled via JS */
}
body.dark-mode .search-dropdown {
    background: #1e293b;
    border-color: #334155;
}
.search-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-main);
    border-bottom: 1px solid #f1f5f9;
}
body.dark-mode .search-item {
    border-color: #334155;
    color: var(--text-main);
}
.search-item:hover {
    background-color: var(--light-blue);
}
body.dark-mode .search-item:hover {
    background-color: #0f172a;
}
.search-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Header Icons */
.header-icons .icon-btn {
    font-size: 1.25rem;
    color: var(--text-main);
    background: none;
    border: none;
    position: relative;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.header-icons .icon-btn:hover {
    background-color: #f1f5f9;
}
body.dark-mode .header-icons .icon-btn:hover {
    background-color: #334155;
}
.header-icons .badge-custom {
    position: absolute;
    top: 0px;
    right: 0px;
    background-color: #dc2626; /* Red for alert */
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    padding: 2px 5px;
}

/* Navbar */
.main-nav {
    background-color: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 0;
}
body.dark-mode .main-nav {
    background-color: #1e293b;
    border-color: #334155;
}
.nav-link-custom {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 1rem;
    text-decoration: none;
    transition: color 0.2s;
}
.nav-link-custom:hover {
    color: var(--royal-blue);
}

/* Hero Section */
.hero-section {
    padding: 2rem 0;
}
.hero-banner {
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 250px;
}
.hero-large {
    background-color: #f1f5f9;
    background-image: url('https://images.unsplash.com/photo-1490481651871-ab68de25d43d?auto=format&fit=crop&q=80&w=800');
    min-height: 400px;
}
.hero-tall {
    background-color: #fff7ed;
    background-image: url('https://images.unsplash.com/photo-1515886657613-9f3515b0c78f?auto=format&fit=crop&q=80&w=600');
    min-height: 100%;
}
.hero-banner h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}
.hero-banner p {
    color: white;
    max-width: 60%;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}
.btn-royal-blue {
    background-color: var(--royal-blue);
    color: white;
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border: none;
    display: inline-block;
    text-decoration: none;
    width: fit-content;
}
.btn-royal-blue:hover {
    background-color: #2c4da6;
    color: white;
}

/* Weekly Best Deals (Dark Section) */
.deals-section {
    background-color: var(--royal-blue);
    color: white;
    padding: 4rem 0;
    margin-top: 2rem;
}
.deals-timer span {
    background-color: var(--bs-primary);
    color: #1e293b;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin: 0 2px;
}
.deal-pill {
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    text-decoration: none;
}
.deal-pill.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #1e293b;
    font-weight: bold;
}

/* Product Cards */
.product-card {
    background-color: white;
    border-radius: 12px;
    padding: 1rem;
    border: none;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}
body.dark-mode .product-card {
    background-color: #1e293b;
    border: 1px solid #334155;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.product-img-wrapper {
    position: relative;
    padding-top: 100%; 
    margin-bottom: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}
body.dark-mode .product-img-wrapper {
    background-color: #0f172a;
}
.product-img {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #dc2626;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 2;
}
.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
    flex-grow: 1;
}
.product-price {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
}
.product-price-strike {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}
.btn-add-cart {
    background-color: var(--royal-blue);
    color: white;
    border-radius: 50px;
    width: 100%;
    font-weight: 600;
    padding: 0.5rem;
    border: none;
    margin-top: 1rem;
    transition: background-color 0.2s;
}
.btn-add-cart:hover {
    background-color: #2c4da6;
}
.btn-add-cart:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
}

/* Footer */
.footer-main {
    background-color: #0f172a;
    color: white;
    padding: 4rem 0 2rem 0;
}
.footer-link {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    margin-bottom: 0.5rem;
}
.footer-link:hover {
    color: var(--bs-primary);
}

/* Cart Offcanvas */
.cart-item {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
body.dark-mode .cart-item {
    border-color: #334155;
}
.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}
.qty-btn {
    background: #f1f5f9;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
body.dark-mode .qty-btn {
    background: #334155;
    color: white;
}

/* Overrides for generic components */
.modal-content, .offcanvas {
    background-color: var(--bg-main);
    color: var(--text-main);
}
.form-control, .form-select {
    background-color: var(--bg-main);
    color: var(--text-main);
    border-color: #e2e8f0;
}
body.dark-mode .form-control, body.dark-mode .form-select {
    background-color: #1e293b;
    border-color: #334155;
    color: white;
}
.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
}

/* Utility classes */
.hidden {
    display: none !important;
}
