/* --- VARIABLES --- */
:root {
    --bg-dark: #0a0a0a;
    --gold: #D4AF37;
    --text-white: #ffffff;
    --font-headline: 'Lato', sans-serif;
    --font-body: 'Source Sans Pro', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-body);
    margin: 0;
    
    /* FIX: Extra padding so nothing hides behind nav */
    padding-top: 60px; 
    padding-bottom: 120px; 
    min-height: 100vh;
    box-sizing: border-box;
}

/* --- HEADER --- */
.app-header {
    position: fixed; top: 0; left: 0; right: 0; height: 60px;
    background: rgba(10, 10, 10, 0.98); 
    display: flex; justify-content: center; align-items: center;
    border-bottom: 1px solid #222;
    z-index: 900; backdrop-filter: blur(10px);
}
.brand-container { display: flex; align-items: center; gap: 10px; }
.header-logo { height: 32px; width: auto; }
.brand-name {
    font-family: var(--font-headline); font-weight: 900; 
    font-size: 1.2rem; color: #fff; letter-spacing: 2px;
}

/* --- HERO --- */
.store-hero { padding: 25px 0 10px 0; position: relative; z-index: 1; }
.container { padding: 0 20px; max-width: 1000px; margin: 0 auto; }
.store-hero h1 { font-family: var(--font-headline); font-weight: 900; font-size: 2rem; margin-bottom: 5px; line-height: 1.2; }
.gold-text { color: var(--gold); }
.store-hero p { color: #888; margin: 0 0 20px 0; font-size: 0.95rem; }

.search-box input {
    width: 100%; padding: 12px 15px; border-radius: 8px; border: none;
    background: #222; color: #fff; font-size: 1rem;
    border: 1px solid #333; outline: none; transition: 0.2s; box-sizing: border-box;
}
.search-box input:focus { border-color: var(--gold); background: #1a1a1a; }

/* --- REQUEST BOX --- */
.request-box {
    background: #222; border: 1px solid #333;
    padding: 20px; border-radius: 12px; text-align: center;
}
.request-box h3 { margin: 0 0 5px 0; color: #fff; font-size: 1.1rem; }
.request-box p { margin: 0 0 15px 0; color: #888; font-size: 0.9rem; }
.request-box input {
    width: 100%; padding: 12px; margin-bottom: 10px;
    border-radius: 6px; border: 1px solid #444; background: #111; color: #fff;
    box-sizing: border-box;
}
.request-box button {
    width: 100%; padding: 12px; border-radius: 6px; border: none;
    background: var(--gold); color: #000; font-weight: 700; cursor: pointer;
}

/* --- STORE GRID --- */
.category-section { margin-bottom: 40px; }
.category-title {
    font-size: 1.2rem; margin-bottom: 15px; color: var(--gold);
    border-bottom: 1px solid #222; padding-bottom: 10px;
    text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
}
.product-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px;
}

/* --- PRODUCT CARD --- */
.product-card {
    background: #fff; border-radius: 12px; overflow: hidden;
    position: relative; transition: transform 0.2s; cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.product-card:active { transform: scale(0.98); }
.card-img-box {
    width: 100%; height: 160px; background: #f9f9f9;
    display: flex; align-items: center; justify-content: center;
}
.card-img-box img { width: 100%; height: 100%; object-fit: cover; }
.card-details { padding: 12px; }
.card-title {
    color: #000; font-weight: 700; font-size: 0.95rem;
    margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-price { color: #d00000; font-weight: 700; font-size: 0.9rem; }
.card-btn {
    position: absolute; bottom: 10px; right: 10px;
    background: var(--gold); color: #000; width: 30px; height: 30px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 1.2rem; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* --- SKELETON LOADING --- */
.category-title-skeleton { width: 150px; height: 20px; background: #222; margin-bottom: 20px; border-radius: 4px; }
.skeleton-card { height: 220px; background: #222; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%{opacity:0.6} 50%{opacity:1} 100%{opacity:0.6} }

/* --- MODAL (Z-INDEX FIXED) --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); 
    
    /* FIX: Z-Index higher than Nav (9999) */
    z-index: 20000; 
    
    flex-direction: column; justify-content: flex-end; align-items: center;
}
.modal-content {
    background: #fff; width: 100%; max-width: 500px;
    border-radius: 20px 20px 0 0; padding: 0;
    max-height: 85vh; overflow-y: auto; 
    position: relative; animation: slideUp 0.3s ease; color: #000;
}
@keyframes slideUp { from {transform: translateY(100%);} to {transform: translateY(0);} }

.modal-gallery {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: 10px; padding: 20px 20px 10px 20px;
    -webkit-overflow-scrolling: touch;
}
.modal-gallery img {
    height: 250px; width: auto; min-width: 80%;
    object-fit: cover; border-radius: 12px; scroll-snap-align: center;
    background: #eee;
}
.modal-gallery::-webkit-scrollbar { display: none; }

/* FIX: Added extra bottom padding so button isn't too tight */
.modal-body { padding: 0 25px 40px 25px; }

.close-modal {
    position: absolute; top: 15px; right: 15px;
    background: rgba(0,0,0,0.1); border-radius: 50%;
    width: 35px; height: 35px; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; cursor: pointer; z-index: 20; color: #333;
}
#modal-title { margin: 10px 0 5px 0; font-size: 1.4rem; font-weight: 800; }
.modal-price-tag { color: #d00000; font-weight: 700; font-size: 1.2rem; margin-bottom: 20px; }
.modal-description h3 { font-size: 1rem; margin-bottom: 5px; color: #555; text-transform: uppercase; }
.modal-description p { color: #333; line-height: 1.6; margin-bottom: 25px; font-size: 0.95rem; }
.btn.full-width { display: block; width: 100%; text-align: center; background: var(--gold); color: #000; font-weight: 700; padding: 15px; border-radius: 8px; text-decoration: none; }

/* --- BOTTOM NAV --- */
.bottom-nav {
    position: fixed; 
    bottom: 0; left: 0; right: 0; 
    height: 60px;
    background: #111; 
    display: flex; justify-content: space-around; align-items: center;
    border-top: 1px solid #333; 
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: content-box; 
}
.nav-item { text-decoration: none; display: flex; flex-direction: column; align-items: center; color: #666; font-size: 0.7rem; }
.nav-icon { width: 24px; height: 24px; margin-bottom: 4px; }
.nav-item.active { color: var(--gold); }



/* --- FEATURED SECTION --- */
.featured-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #222;
}
.featured-title {
    color: var(--gold);
    font-size: 1.2rem;
    margin-bottom: 15px;
}
.featured-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}
.featured-scroll::-webkit-scrollbar { display: none; }

/* --- PRODUCT CARD UPDATES --- */
.product-card { position: relative; } /* Needed for badge */

.hot-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: #e74c3c;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* --- DUAL PRICE DISPLAY --- */
.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 5px;
}
.old-price {
    text-decoration: line-through;
    color: #888;
    font-size: 0.85rem;
}
.current-price {
    color: #27ae60; /* Green color for deal */
    font-weight: bold;
    font-size: 1rem;
}

/* --- PROMO BANNER --- */
.promo-banner {
    display: none;
    background: var(--gold);
    color: #000;
    width: 100%;
    padding: 12px 40px 12px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: slideDown 0.4s ease;
    z-index: 90;
    box-sizing: border-box;
}
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.close-promo {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; font-size: 1.5rem; color: #000; cursor: pointer; padding: 0 5px;
}

/* --- PRICE & BADGE STYLES --- */
.product-card { position: relative; }

.hot-badge {
    position: absolute; top: 8px; left: 8px;
    background: #e74c3c; color: white;
    font-size: 0.65rem; font-weight: 800;
    padding: 3px 6px; border-radius: 4px;
    z-index: 5; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.price-row {
    display: flex; align-items: baseline; gap: 8px; margin-top: 5px;
}
.old-price {
    text-decoration: line-through; color: #888; font-size: 0.85rem;
}
.current-price {
    color: #27ae60; font-weight: bold; font-size: 1rem;
}