/* =========================================
   VARIABLES & MODERN APP THEME
========================================= */
:root {
    --bg-primary: #f9fafb; /* Modern off-white app background */
    --surface-primary: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    
    /* Elegant app accents */
    --accent-gold: #d97706;
    --accent-gold-hover: #b45309;
    --accent-gold-light: #fef3c7;
    
    --offer-green: #10b981;
    --offer-green-dark: #059669;
    --price-red: #ef4444;
    --whatsapp-green: #25D366;
    
    --font-primary: 'Poppins', sans-serif;
    --font-display: 'Teko', sans-serif;
    
    /* App-like rounded corners */
    --border-radius-sm: 8px;
    --border-radius: 12px;
    --border-radius-lg: 20px; 
    --border-radius-pill: 9999px;
    
    /* Refined, softer shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================
   GLOBAL RESET
========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body { 
    font-family: var(--font-primary); 
    background-color: var(--bg-primary);
    color: var(--text-primary); 
    line-height: 1.5; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 90px;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
main.container { flex-grow: 1; }

/* =========================================
   APP HEADER
========================================= */
.main-header { 
    position: sticky; 
    top: 0; 
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    z-index: 100; 
    border-bottom: 1px solid var(--border-color); 
    box-shadow: var(--shadow-sm); 
}

.main-header .container { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    height: 72px; /* Fixed app header height */
    position: relative;
}

/* Perfectly center the logo */
.logo { 
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display); 
    font-size: 2.2rem; 
    background: linear-gradient(135deg, var(--accent-gold) 0%, #f59e0b 100%); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    font-weight: 600; 
    letter-spacing: 1px; 
    white-space: nowrap;
}

/* Show icons on ALL devices for app feel */
.header-icon { 
    display: flex; 
    align-items: center;
    justify-content: center;
    background: var(--surface-primary); 
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer; 
    color: var(--text-primary); 
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.header-icon:hover {
    background: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.header-icon svg { width: 22px; height: 22px; }

/* =========================================
   SIDE MENU (APP DRAWER)
========================================= */
.side-menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(17, 24, 39, 0.6); backdrop-filter: blur(4px); z-index: 1001; opacity: 0; visibility: hidden; transition: var(--transition-smooth); }
.side-menu-overlay.open { opacity: 1; visibility: visible; }
.side-menu-content { position: absolute; top: 0; left: 0; width: 300px; max-width: 80vw; height: 100%; background: var(--surface-primary); box-shadow: var(--shadow-lg); transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; }
.side-menu-overlay.open .side-menu-content { transform: translateX(0); }
.side-menu-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.side-menu-header h3 { font-size: 1.25rem; font-weight: 600; }
.side-menu-nav { list-style: none; padding: 1rem 0; }
.side-menu-nav li a, .side-menu-nav li button { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; width: 100%; text-align: left; font-size: 1rem; font-weight: 500; color: var(--text-primary); text-decoration: none; background: none; border: none; cursor: pointer; transition: var(--transition-smooth); }
.side-menu-nav li a:hover, .side-menu-nav li button:hover { background-color: var(--bg-primary); color: var(--accent-gold); padding-left: 2rem; }
.side-menu-nav svg { width: 22px; height: 22px; fill: currentColor; }

/* =========================================
   HERO CAROUSEL (RESPONSIVE HEIGHTS)
========================================= */
.carousel { 
    position: relative; 
    height: 400px; /* DESKTOP HEIGHT */
    width: 100%; 
    max-width: 1200px; 
    margin: 2rem auto; 
    border-radius: var(--border-radius-lg); 
    box-shadow: var(--shadow-md); 
    overflow: hidden; 
}

.carousel-track-container { height: 100%; position: relative; overflow: hidden; }
.carousel-track { list-style: none; position: relative; height: 100%; display: flex; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.carousel-slide { position: relative; flex-shrink: 0; width: 100%; height: 100%; }
.carousel-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.promo-text { position: absolute; bottom: 0; left: 0; right: 0; padding: 2rem 1.5rem 1rem; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%); color: #fff; font-weight: 600; font-size: 1.25rem; }

.carousel-button { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); border: none; border-radius: 50%; width: 44px; height: 44px; cursor: pointer; z-index: 1; display: flex; align-items: center; justify-content: center; transition: var(--transition-smooth); box-shadow: var(--shadow-md); }
.carousel-button:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.carousel-button svg { width: 24px; height: 24px; fill: var(--text-primary); }
.carousel-button--left { left: 1rem; }
.carousel-button--right { right: 1rem; }
.carousel-nav { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.5rem; }
.carousel-indicator { border: none; border-radius: var(--border-radius-pill); width: 8px; height: 8px; background-color: rgba(255,255,255,0.5); cursor: pointer; transition: var(--transition-smooth); }
.carousel-indicator.current-slide { background-color: #fff; width: 24px; }

/* =========================================
   SEARCH & FILTERS
========================================= */
.search-filter-bar { display: flex; gap: 1rem; margin-bottom: 2rem; }
.search-box-wrapper { flex-grow: 1; position: relative; }
#search-box { width: 100%; padding: 1rem 1.25rem 1rem 3rem; background: var(--surface-primary); border: 1px solid var(--border-color); border-radius: var(--border-radius-pill); font-size: 1rem; transition: var(--transition-smooth); box-shadow: var(--shadow-sm); }
#search-box:focus { outline: none; border-color: var(--accent-gold); box-shadow: 0 0 0 4px var(--accent-gold-light); }
.search-icon { position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: var(--text-secondary); }
#search-box:focus + .search-icon { fill: var(--accent-gold); }

.filter-button { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.5rem; background: var(--surface-primary); border: 1px solid var(--border-color); border-radius: var(--border-radius-pill); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition-smooth); box-shadow: var(--shadow-sm); }
.filter-button:hover { background: var(--bg-primary); border-color: var(--accent-gold); color: var(--accent-gold); }
.filter-icon { width: 20px; height: 20px; fill: currentColor; }

/* =========================================
   NUMBER CARDS (MODERN APP LOOK)
========================================= */
.number-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

.number-card { 
    background: var(--surface-primary); 
    border-radius: var(--border-radius-lg); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    transition: var(--transition-spring); 
    box-shadow: var(--shadow-md); 
    border: 1px solid rgba(0,0,0,0.03); 
    position: relative; 
    cursor: pointer; 
    opacity: 0; 
    transform: translateY(20px); 
    animation: fadeInUp 0.5s ease-out forwards;
}

.number-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-float); }
.number-card.selected { transform: translateY(-4px) scale(1.02); box-shadow: 0 0 0 2px var(--accent-gold), var(--shadow-float); border-color: transparent; }

/* Modern floating offer badge inside the card */
.offer-badge { position: absolute; top: 1rem; left: 1rem; background: var(--accent-gold-light); color: var(--accent-gold-hover); padding: 4px 12px; font-size: 0.75rem; font-weight: 700; border-radius: var(--border-radius-pill); z-index: 3; text-transform: uppercase; letter-spacing: 0.5px; }

.selection-checkmark { position: absolute; top: 1rem; right: 1rem; width: 28px; height: 28px; background-color: var(--accent-gold); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; transform: scale(0); transition: var(--transition-spring); z-index: 5; box-shadow: var(--shadow-sm); }
.selection-checkmark svg { width: 16px; height: 16px; }
.number-card.selected .selection-checkmark { transform: scale(1); }

.card-main { padding: 3.5rem 1.25rem 0; flex-grow: 1; display: flex; flex-direction: column; }
.card-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; }
.vip-number { font-family: var(--font-display); font-size: 2.2rem; color: var(--text-primary); letter-spacing: 1.5px; line-height: 1; font-weight: 600; }
.vip-number .highlight { color: var(--accent-gold-hover); background-color: var(--accent-gold-light); padding: 0px 4px; border-radius: 6px; }

.brand-logo { width: 60px; height: auto; object-fit: contain; opacity: 0.8; }

.details-grid { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-primary); padding: 1rem; border-radius: var(--border-radius); gap: 1rem; align-items: center; }
.detail-item { text-align: center; display: flex; flex-direction: column; }
.detail-item--sum { border-right: 1px solid var(--border-color); }
.detail-label { font-size: 0.7rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.25rem; }
.detail-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.detail-item--count .detail-value { color: var(--accent-gold); font-size: 1.7rem; }

.calculation-steps-container { margin-top: 0.5rem; display: flex; justify-content: center; }
.calculation-step { font-size: 0.75rem; color: var(--text-secondary); background-color: #fff; border: 1px solid var(--border-color); padding: 2px 8px; border-radius: var(--border-radius-pill); }

.card-footer { padding: 1.25rem; border-top: 1px solid var(--border-color); margin-top: auto; background: #fff;}
.price-display { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.new-price { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.original-price { font-size: 0.95rem; color: var(--text-secondary); text-decoration: line-through; }

.buy-button { display: block; width: 100%; background: var(--offer-green); color: #fff; padding: 0.85rem; border-radius: var(--border-radius-pill); text-decoration: none; font-weight: 600; font-size: 1rem; text-align: center; transition: var(--transition-smooth); border: none; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2); }
.buy-button:hover { background: var(--offer-green-dark); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3); }

/* =========================================
   MODALS (APP BOTTOM SHEET / CENTER)
========================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(17, 24, 39, 0.5); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 1000; animation: fadeIn 0.2s ease; }
.modal-content { background: var(--surface-primary); padding: 1.5rem; border-radius: var(--border-radius-lg); width: 90%; max-width: 420px; box-shadow: var(--shadow-float); animation: slideInUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.modal-header h2 { font-size: 1.25rem; font-weight: 600; }
.close-button { background: var(--bg-primary); border: none; font-size: 1.5rem; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); cursor: pointer; transition: var(--transition-smooth); }
.close-button:hover { background: #fee2e2; color: var(--price-red); }

.control-group { margin-bottom: 1rem; }
.control-group label { display: block; margin-bottom: 0.5rem; color: var(--text-secondary); font-weight: 500; font-size: 0.85rem; }
.control-group input { width: 100%; padding: 0.85rem; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--border-radius); font-size: 1rem; transition: var(--transition-smooth); }
.control-group input:focus { outline: none; border-color: var(--accent-gold); box-shadow: 0 0 0 3px var(--accent-gold-light); background: #fff; }

.modal-footer { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.modal-footer button, .modal-footer a { flex: 1; padding: 0.85rem; border: none; border-radius: var(--border-radius-pill); font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition-smooth); text-decoration: none; text-align: center; }
.btn-primary { background: var(--accent-gold); color: #fff; }
.btn-primary:hover { background: var(--accent-gold-hover); }
.btn-secondary { background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--border-color); }

.sort-option-btn { width: 100%; text-align: left; padding: 1rem; font-size: 1rem; background: transparent; border: 1px solid var(--border-color); border-radius: var(--border-radius); cursor: pointer; transition: var(--transition-smooth); margin-bottom: 0.5rem; font-weight: 500;}
.sort-option-btn.active, .sort-option-btn:hover { background: var(--accent-gold-light); color: var(--accent-gold-hover); border-color: var(--accent-gold); }

.share-text-area { width: 100%; height: 120px; padding: 0.75rem; border-radius: var(--border-radius); border: 1px solid var(--border-color); background-color: var(--bg-primary); font-family: monospace; font-size: 0.85rem; resize: none; margin-bottom: 1rem; }
.share-actions svg { width: 18px; height: 18px; }
.whatsapp-share-btn { background: var(--whatsapp-green); color: white;}
.whatsapp-share-btn:hover { background: #20b857; }

/* =========================================
   ACTION BARS & FLOATERS
========================================= */
#multi-select-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(17, 24, 39, 0.95); backdrop-filter: blur(10px); color: white; z-index: 900; box-shadow: 0 -4px 20px rgba(0,0,0,0.15); transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); visibility: hidden; border-top-left-radius: var(--border-radius-lg); border-top-right-radius: var(--border-radius-lg); }
#multi-select-bar.visible { transform: translateY(0); visibility: visible; }
.multi-select-bar-content { display: flex; justify-content: space-between; align-items: center; height: 70px; padding: 0 1.5rem;}

#mobile-action-bar { display: none; position: fixed; bottom: 0; left: 0; width: 100%; height: 70px; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); box-shadow: 0 -4px 15px rgba(0,0,0,0.05); z-index: 500; border-top: 1px solid rgba(0,0,0,0.05); justify-content: space-around; align-items: center; padding-bottom: env(safe-area-inset-bottom); }
#mobile-action-bar button { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 0.7rem; font-weight: 600; color: var(--text-secondary); flex-grow: 1; transition: color 0.2s ease; }
#mobile-action-bar button.active, #mobile-action-bar button:active { color: var(--accent-gold); }
#mobile-action-bar svg { width: 22px; height: 22px; fill: currentColor; }

#mobile-search-overlay { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); z-index: 501; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); box-shadow: 0 -10px 25px rgba(0,0,0,0.1); transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: none; border-top-left-radius: var(--border-radius-lg); border-top-right-radius: var(--border-radius-lg); }
#mobile-search-overlay.visible { transform: translateY(0); }
.mobile-search-box-container { display: flex; align-items: center; gap: 0.75rem; }
#mobile-search-input { flex-grow: 1; padding: 1rem 1.25rem; font-size: 1rem; border: 1px solid var(--border-color); border-radius: var(--border-radius-pill); background: var(--bg-primary); }
#mobile-search-close-btn { background: var(--bg-primary); }

.whatsapp-float { position: fixed; width: 56px; height: 56px; bottom: 24px; right: 24px; background: var(--whatsapp-green); color: #FFF; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3); z-index: 100; transform: scale(0); animation: zoomIn 0.4s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; transition: var(--transition-spring); }
.whatsapp-float:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4); }
.whatsapp-svg { width: 30px; height: 30px; }

/* =========================================
   PAGINATION & FOOTER
========================================= */
.pagination-controls { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 3rem 0; }
.pagination-btn { padding: 0.75rem 1.5rem; border: 1px solid var(--border-color); background-color: var(--surface-primary); color: var(--text-primary); font-weight: 600; font-size: 0.95rem; border-radius: var(--border-radius-pill); cursor: pointer; transition: var(--transition-smooth); box-shadow: var(--shadow-sm); }
.pagination-btn:hover:not(:disabled) { background-color: var(--bg-primary); border-color: var(--accent-gold); color: var(--accent-gold); }
.pagination-btn:disabled { cursor: not-allowed; opacity: 0.5; box-shadow: none; }
#page-info { font-weight: 600; font-size: 1rem; color: var(--text-secondary); min-width: 60px; text-align: center; }

.loader-container { padding: 3rem 0; text-align: center; }
.loader-spinner { display: inline-block; border: 3px solid var(--accent-gold-light); border-top-color: var(--accent-gold); border-radius: 50%; width: 40px; height: 40px; animation: spin 0.8s linear infinite; }
.no-results-message { text-align: center; padding: 4rem 1rem; color: var(--text-secondary); }

.main-footer { text-align: center; padding: 2rem 1rem; margin-top: auto; color: var(--text-secondary); font-size: 0.9rem; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.powered-by { display: flex; align-items: center; gap: 0.5rem; }
.footer-logo { height: 22px; opacity: 0.8; transition: opacity 0.2s; }
.footer-logo:hover { opacity: 1; }

/* =========================================
   ANIMATIONS & RESPONSIVE DESIGN
========================================= */
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0); } to { transform: scale(1); } }

/* TABLET (Mid-size) */
@media (max-width: 1024px) {
    .carousel { height: 300px; }
}

/* MOBILE */
@media (max-width: 768px) {
    body { padding-bottom: 110px; } /* Room for bottom bar */
    .main-header .container { height: 60px; padding: 0 1rem; }
    .logo { font-size: 1.8rem; }
    .header-icon { width: 38px; height: 38px; }
    .header-icon svg { width: 20px; height: 20px; }
    
    .search-filter-bar { display: none; }
    #mobile-action-bar { display: flex; }
    
    .carousel { height: 200px; margin: 1rem auto; border-radius: var(--border-radius); }
    .promo-text { font-size: 1.1rem; padding: 1.5rem 1rem 0.75rem; }
    
    .number-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
    
    .modal-content { 
        padding: 1.25rem; 
        width: 100%; 
        max-width: 100%; 
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0; 
        position: absolute; 
        bottom: 0; 
        animation: slideInUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }
    .modal-header { padding-bottom: 0.75rem; margin-bottom: 1rem; }
    
    .whatsapp-float { bottom: 90px; right: 16px; width: 50px; height: 50px; }
    .whatsapp-svg { width: 26px; height: 26px; }
    body.selection-active .whatsapp-float { bottom: 160px; }
}

/* SMALL MOBILE */
@media (max-width: 480px) {
    .vip-number { font-size: 1.8rem; letter-spacing: 1px; }
    .brand-logo { width: 50px; }
    .detail-value { font-size: 1.3rem; }
    .detail-item--count .detail-value { font-size: 1.5rem; }
    .buy-button { padding: 0.75rem; font-size: 0.95rem; }
    .new-price { font-size: 1.3rem; }
}