* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body { background-color: #faf7f2; color: #2c221e; line-height: 1.6; }
.hidden { display: none !important; }

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(74, 46, 43, 0.83); z-index: 2000; display: none; 
    align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: white; padding: 40px; border-radius: 10px;
    text-align: center; max-width: 400px; width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative; 
}
.modal-box h2 { color: #7b2c22; margin-bottom: 15px; }
.modal-box p { color: #6b5b53; margin-bottom: 20px; }
.modal-box input {
    width: 100%; padding: 12px; margin-bottom: 15px;
    border: 1px solid #ccc; border-radius: 5px; font-size: 1rem;
}
.error-msg { margin-top: 15px; font-weight: bold; }

/* Modal Close Button */
.close-modal-btn {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; font-size: 1.8rem;
    color: #2c221e; cursor: pointer; line-height: 1;
}
.close-modal-btn:hover { color: #7b2c22; }

/* Buttons */
.btn {
    display: inline-block; padding: 12px 30px; background-color: #d97706; 
    color: white; text-decoration: none; border: none; border-radius: 6px;
    font-weight: bold; cursor: pointer; transition: background-color 0.2s;
}
.btn:hover { background-color: #b45309; }
.alt-btn { background-color: #f2ebe1; color: #7b2c22; border: 2px solid #7b2c22; }
.alt-btn:hover { background-color: #e6ccb8; color: #5a1f18; }
#logout-btn:hover { background-color: #9c1010 !important; }

/* BRAND BANNER */
.brand-banner {
    background-color: #5a1f18;
    color: white;
    text-align: center;
    padding: 1.5rem 1rem 1rem 1rem;
    border-bottom: 1px solid #7b2c22;
}

.brand-banner .logo { 
    font-family: 'Great Vibes', cursive; 
    font-size: 4.2rem; 
    font-weight: normal; 
    letter-spacing: 2px;
    color: white; 
    line-height: 1;
}

/* STICKY NAVIGATION BAR */
header.sticky-nav {
    background-color: #7b2c22;
    padding: 0.8rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
}

header.sticky-nav nav ul { 
    list-style: none; 
    display: flex; 
    gap: 3rem; 
    align-items: center;
}

header.sticky-nav a { 
    color: white; 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 1.1rem;
    transition: color 0.2s; 
}

header.sticky-nav a:hover { 
    color: #f4d06f; 
}

/* CART BADGE STYLING */
.cart-nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cart-badge {
    position: absolute;
    top: -10px;
    right: -18px;
    background-color: #ff3b30;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Hero Section */
.hero { background-color: #4a2e2b; color: white; padding: 120px 5%; text-align: center; }
.hero h1 { font-size: 2.8rem; margin-bottom: 1rem; color: #f4d06f; }
.hero p { font-size: 1.1rem; max-width: 600px; margin: 0 auto 2rem auto; color: #e6dfd5; }

/* Product Grid */
section { padding: 70px 5%; text-align: center; }
section h2 { color: #7b2c22; font-size: 2.2rem; margin-bottom: 10px; }
.section-subtitle { color: #6b5b53; margin-bottom: 40px; }
.product-grid { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.product-card {
    background: white; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    width: 300px; overflow: hidden; display: flex; flex-direction: column;
    justify-content: space-between; text-align: left; transition: transform 0.2s;
}
.product-card:hover { transform: translateY(-5px); }
.img-container { width: 100%; height: 220px; display: flex; align-items: center; justify-content: center; }
.product-card h3 { font-size: 1.1rem; color: #2c221e; padding: 15px 15px 5px 15px; }
.product-card .price { font-size: 1.3rem; font-weight: bold; color: #7b2c22; padding: 0 15px; }
.product-card .desc { font-size: 0.9rem; color: #6b5b53; padding: 10px 15px; flex-grow: 1; }

/* Actions & Quantities */
.product-actions { margin-top: auto; }
.add-to-cart-btn {
    width: 100%; background-color: #7b2c22; color: white; border: none;
    padding: 15px; font-size: 1.1rem; font-weight: bold; cursor: pointer; transition: background-color 0.2s;
}
.add-to-cart-btn:hover { background-color: #5a1f18; }
.qty-selector { display: flex; justify-content: space-between; align-items: center; background-color: #7b2c22; color: white; width: 100%; }
.qty-btn { background-color: transparent; color: white; border: none; padding: 15px 25px; font-size: 1.2rem; font-weight: bold; cursor: pointer; transition: background-color 0.2s; }
.qty-btn:hover { background-color: #5a1f18; }
.qty-text { font-weight: bold; font-size: 1.1rem; }

/* Cart Slider & Address Slider */
.cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); z-index: 1001; display: none; opacity: 0; transition: opacity 0.3s ease; }
.cart-overlay.active { display: block; opacity: 1; }
.cart-slider { position: fixed; top: 0; right: -500px; width: 100%; max-width: 480px; height: 100vh; background-color: #f2ebe1; box-shadow: -5px 0 15px rgba(0,0,0,0.2); z-index: 1002; transition: right 0.3s ease; display: flex; flex-direction: column; padding: 20px; overflow-y: auto; }
.cart-slider.open { right: 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #7b2c22; padding-bottom: 15px; margin-bottom: 20px; }
.cart-header h2 { color: #7b2c22; font-size: 1.3rem; margin: 0; }
.close-cart-btn { background: none; border: none; font-size: 2rem; color: #2c221e; cursor: pointer; line-height: 1; }
#cart-items { flex-grow: 1; margin: 0; }
.cart-row { background: white; padding: 15px; border-radius: 8px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.cart-item-info { display: flex; justify-content: space-between; font-weight: bold; font-size: 1rem; }
.cart-item-actions { display: flex; justify-content: space-between; align-items: center; }
.cart-row .qty-selector { width: 120px; border-radius: 4px; }
.cart-row .qty-btn { padding: 5px 15px; }
.remove-item-btn { background: none; border: none; color: #c91818; text-decoration: underline; cursor: pointer; font-weight: bold; }
#cart-total { background: white; padding: 20px; border-radius: 8px; margin-top: 20px; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.checkout-btn { width: 100%; margin-top: 15px; }

/* CART SELECTED ADDRESS BANNER */
.cart-address-banner {
    background-color: #e8f1ff;
    border: 1px solid #b3d1ff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: left;
}

.cart-address-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: #1a73e8;
    margin-bottom: 4px;
}

.change-addr-link {
    background: none;
    border: none;
    color: #7b2c22;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
}

.cart-addr-text {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.3;
}

.pricing-rows-container {
    text-align: left;
}

.price-row { display: flex; justify-content: space-between; font-size: 1rem; margin-bottom: 6px; }

/* DELIVERY DETAILS STYLING */
.delivery-details-container { display: flex; flex-direction: column; gap: 15px; }
.address-top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.select-address-title { font-size: 1.1rem; font-weight: 600; color: #2c221e; }
.add-address-pill-btn { background: #fff; border: 1.5px solid #000; border-radius: 8px; padding: 6px 14px; font-weight: bold; font-size: 0.9rem; cursor: pointer; }
.add-address-pill-btn:hover { background: #f0f0f0; }
.address-cards-list { display: flex; flex-direction: column; gap: 12px; }
.empty-address-msg { color: #6b5b53; font-style: italic; text-align: center; padding: 30px 10px; background: white; border-radius: 8px; }

.ui-address-card { background: white; border: 1px solid #ccc; border-radius: 12px; padding: 16px; position: relative; text-align: left; }
.ui-address-card.selected-card { border: 1.5px solid #a81c1c; }
.ui-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ui-card-name { font-weight: bold; font-size: 1rem; color: #000; }
.ui-card-tag { font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; font-weight: 500; background-color: #e8f1ff; color: #1a73e8; }

.ui-card-more-container {
    position: relative;
    margin-left: auto;
}

.ui-card-more {
    font-size: 1.3rem;
    cursor: pointer;
    color: #555;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.ui-card-more:hover {
    background-color: #f0f0f0;
}

.card-menu-dropdown {
    position: absolute;
    top: 25px;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    z-index: 100;
    min-width: 110px;
    overflow: hidden;
}

.card-menu-dropdown.active {
    display: flex;
}

.card-menu-item {
    padding: 10px 15px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
    transition: background 0.2s;
    font-weight: 500;
}

.card-menu-item:hover {
    background-color: #f2ebe1;
}

.card-menu-item.delete-item {
    color: #c91818;
    border-top: 1px solid #eee;
}

.ui-card-address { font-size: 0.9rem; color: #333; line-height: 1.4; margin-bottom: 6px; }
.ui-card-contact { font-size: 0.85rem; color: #666; }

.deliver-here-btn { width: 100%; background-color: #7b2c22; color: white; border: none; border-radius: 8px; padding: 10px; font-weight: bold; font-size: 0.95rem; margin-top: 12px; cursor: pointer; }
.deliver-here-btn:hover { background-color: #5a1f18; }

/* Footer & WhatsApp */
footer { background-color: #2c221e; color: #e6dfd5; text-align: center; padding: 25px; line-height: 1.8; }
.whatsapp-footer-link { color: #25D366; text-decoration: none; font-weight: bold; }
.whatsapp-footer-link:hover { text-decoration: underline; }

.floating-whatsapp {
    position: fixed; bottom: 25px; right: 25px; background-color: #25D366;
    color: white; border-radius: 50%; width: 65px; height: 65px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 1500; transition: transform 0.3s;
}
.floating-whatsapp:hover { transform: scale(1.1); }

/* Responsive */
@media (max-width: 900px) { 
    .brand-banner .logo { font-size: 3.2rem; }
    header.sticky-nav nav ul { gap: 1.5rem; }
    .product-grid { gap: 20px; } 
    .product-card { width: 45%; } 
}
@media (max-width: 600px) {
    .brand-banner .logo { font-size: 2.8rem; }
    header.sticky-nav nav ul { gap: 1rem; }
    header.sticky-nav a { font-size: 0.95rem; }
    .hero { padding: 80px 5%; }
    .product-card { width: 100%; max-width: 350px; }
    .floating-whatsapp { width: 55px; height: 55px; bottom: 15px; right: 15px; }
}