/* ==========================================================================
   DESI DEALS HUB - ENTERPRISE CSS ENGINE (PERFECTED FINAL)
   Architecture: Light Premium Theme, Fixed Cards, Original Footer
========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* --- 1. GLOBAL VARIABLES --- */
:root {
    /* Main Light Theme Colors */
    --bg-body: #f8f9fa; 
    --bg-surface: #ffffff; 
    --text-primary: #0F172A; 
    --text-secondary: #475569; 
    --border-glass: #E2E8F0;
    
    /* Original Solid Button Colors (Fixed) */
    --btn-buy-now: #fb641b; 
    --btn-add-cart: #ff9f00; 
    
    /* Brand Colors */
    --nav-blue: #E0F2FE; 
    --nav-border: #BAE6FD;
    --success-green: #10B981;
    --danger-red: #EF4444;
    
    /* Original Footer Background (Fixed) */
    --footer-bg: #172337; 
    --bg-obsidian: #0B0D13; 
}

/* --- 2. RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body) !important;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--btn-buy-now); }

a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; outline: none; }
ul { list-style: none; }

/* --- 3. TOP NAVIGATION HEADER --- */
.main-header {
    background-color: var(--nav-blue) !important;
    border-bottom: 2px solid var(--nav-border) !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 5px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.brand-logo h2 { margin: 0; }
.logo span { font-weight: 900 !important; letter-spacing: 0.5px; }
.brand-logo .sub-logo {
    font-size: 11px;
    font-style: italic;
    font-weight: 600;
    margin-top: -3px;
    color: #475569;
}

.search-bar-container {
    flex: 1;
    max-width: 600px;
    position: relative;
    display: flex;
    align-items: center;
}
.search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 8px;
    border: 1px solid #90CAF9 !important;
    background: #ffffff !important;
    color: #212121 !important;
    font-size: 15px;
    transition: all 0.3s ease;
}
.search-input::placeholder { color: #878787 !important; }
.search-input:focus {
    border-color: #0D47A1 !important;
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.1);
}
.search-icon {
    position: absolute;
    left: 16px;
    color: #1E88E5 !important;
    font-size: 16px;
    pointer-events: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}
.header-actions .action-btn {
    background: transparent;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s;
}
.header-actions .action-btn:hover { transform: translateY(-2px); }

.play-win-btn {
    background-color: #FF7F50 !important;
    color: #ffffff !important;
    border-radius: 6px;
    padding: 10px 18px !important;
    box-shadow: 0 4px 10px rgba(255, 127, 80, 0.3);
}
#auth-trigger-btn, #auth-trigger-btn i { color: #000000 !important; }
#main-wishlist-trigger, #main-wishlist-trigger i { color: #FF3366 !important; }
#main-cart-trigger, #main-cart-trigger i { color: #424242 !important; }

.cart-link { position: relative; }
.cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #FF7F50;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    height: 18px;
    min-width: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* --- 4. APP-STYLE WAVY CATEGORIES --- */
.category-nav { padding: 0; }
.category-list-wavy {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 25px 15px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border-radius: 16px;
    margin: 20px auto;
    max-width: 1200px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.app-cat {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.app-cat:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.app-cat i {
    transform: none !important;
    filter: none !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

/* --- 5. STOREFRONT & PRODUCT CARDS --- */
.main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 40px;
    min-height: 50vh;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.product-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 15px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.wishlist-btn {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #E2E8F0 !important;
    color: #878787 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 10 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
    transition: all 0.2s ease !important;
}
.wishlist-btn:hover {
    color: #FF3366 !important;
    border-color: #FF3366 !important;
    background: #FFF0F5 !important;
}

.product-img-box {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
.product-card:hover .product-img-box img { transform: scale(1.08); }

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.rating-badge {
    background-color: #388e3c !important;
    color: #ffffff !important;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}
.rating-badge i { color: #fff; font-size: 10px; }

.price-box {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.current-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}
.original-price {
    font-size: 13px;
    text-decoration: line-through;
    color: var(--text-secondary);
}

.card-actions {
    display: flex !important;
    gap: 10px !important;
    margin-top: 15px !important;
    width: 100% !important;
}
.action-btn-half {
    flex: 1 !important;
    padding: 12px 0 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    border: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    text-align: center !important;
}
.action-btn-half:hover {
    transform: translateY(-2px) !important;
}
.btn-buy-now {
    background-color: var(--btn-buy-now) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(251, 100, 27, 0.2) !important;
}
.btn-add-cart {
    background-color: var(--btn-add-cart) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(255, 159, 0, 0.2) !important;
}

/* --- 6. CHECKOUT & MODALS --- */
.modal-overlay, .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content, .auth-card, .game-hub-card, .checkout-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    animation: slideUpFade 0.3s ease forwards;
}
@keyframes slideUpFade {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
.close-modal-btn, .close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #FEE2E2;
    color: #DC2626;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: 0.2s;
}
.close-modal-btn:hover, .close:hover { background: #DC2626; color: white; }

#address-form input, #address-form textarea, .auth-form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
    transition: 0.2s;
}
#address-form input:focus, #address-form textarea:focus {
    outline: none;
    border-color: #0D47A1;
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

/* --- 7. GAME HUB & BOARDS --- */
.game-hub-card {
    background-color: #ffffff !important;
    max-width: 700px;
}
.game-hub-header h2 { color: #0F172A !important; font-weight: 800; }
.game-hub-header p { color: #475569 !important; font-weight: 600; }
.game-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
.game-card {
    border: none !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s !important;
}
.game-card h4, .game-card p, .game-card i { color: #ffffff !important; }
.game-card:hover { transform: translateY(-5px) !important; }

.game-play-modal .game-board-card {
    background: var(--bg-obsidian);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    max-width: 600px;
}
#merge-2048-board-modal .game-board-card { max-width: 400px !important; }
#merge-grid {
    width: 100% !important;
    aspect-ratio: 5 / 6 !important;
    max-height: 60vh !important;
    margin: 0 auto !important;
    background: #0F172A !important;
    padding: 8px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}
#merge-grid > div[style*="grid-column"] {
    grid-row: 1 / -1 !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

.main-footer {
    background-color: var(--footer-bg) !important;
    padding: 30px 20px 15px !important; /* 👈 Top padding 60px se 30px kar di */
    margin-top: 30px !important; /* 👈 Upar ka margin bhi aadha kar diya */
    border-top: none !important;
}
.footer-grid {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px; /* 👈 Gaps 40px se ghatakar 20px kar diye */
    margin-bottom: 20px;
}
.footer-col h4 {
    color: #878787 !important;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px; /* 👈 Heading ke neeche ka space kam kiya */
    font-weight: 600;
}
.footer-col p, .footer-col a, .footer-col .policy-text-btn, .address-col p {
    color: #ffffff !important; 
    background: transparent !important;
    border: none !important;
    font-size: 14px;
    margin-bottom: 5px; /* 👈 Text ke beech ki doori 12px se 5px kar di */
    display: block;
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
    font-family: inherit;
    text-decoration: none;
}

@media (max-width: 480px) {
    .header-container { padding: 10px 15px !important; gap: 10px; } /* 👈 Header container ko tight kiya */
    
    .product-grid { grid-template-columns: 1fr !important; }
    .header-actions { gap: 10px; }
    .header-actions .action-btn { font-size: 0; }
    .header-actions .action-btn i { font-size: 22px; }
    .play-win-btn { font-size: 12px !important; padding: 8px 12px !important; }
    
    .main-footer {
        padding: 20px 15px 15px !important; /* 👈 Mobile par footer padding ekdum minimal */
    }
    .footer-grid { 
        gap: 15px !important; /* 👈 Sections ke beech ka gap chota kiya */
    }
    
    .category-list-wavy { gap: 10px; padding: 15px 5px; }
    .app-cat { width: 75px; height: 75px; }
    .app-cat i { font-size: 24px; }
}