/* ========== SMART HUB - MAIN STYLESHEET ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; background: #0a0a0a; color: #fff; padding-bottom: 70px; transition: all 0.3s; }
body.light-mode { background: #f5f5f5; color: #1a1a1a; }
body.light-mode .product-card, body.light-mode .cart-item, body.light-mode .order-summary, body.light-mode .auth-container, body.light-mode .categories-sidebar { background: #fff; border-color: #FFD700; }
body.light-mode .category-header-item, body.light-mode .subcategory-item { background: rgba(0,0,0,0.05); }
.gold { color: #FFD700; }

/* Header */
.main-header { background: rgba(0,0,0,0.95); padding: 1rem 5%; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid rgba(255,215,0,0.3); }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 800; cursor: pointer; }
.logo i { color: #FFD700; }
.header-icons { display: flex; gap: 15px; position: relative; }
.icon-btn { background: rgba(255,255,255,0.1); border: none; color: #fff; padding: 8px 16px; border-radius: 50px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all 0.3s; }
.icon-btn:hover { background: #FFD700; color: #000; }

/* Dropdown Menu */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: 50px; right: 0; background: #1a1a1a; border-radius: 12px; padding: 10px 0; min-width: 200px; display: none; z-index: 1001; border: 1px solid #FFD700; }
.dropdown-menu.show { display: block; animation: fadeIn 0.2s; }
.dropdown-menu a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: #fff; text-decoration: none; cursor: pointer; transition: all 0.3s; font-size: 0.9rem; }
.dropdown-menu a:hover { background: rgba(255,215,0,0.2); color: #FFD700; }
.dropdown-menu .username-display { border-bottom: 1px solid rgba(255,215,0,0.3); font-weight: 600; color: #FFD700; cursor: default; }
.dropdown-menu .username-display:hover { background: transparent; color: #FFD700; }

/* Search Section */
.search-section { padding: 1rem 5%; background: #0a0a0a; position: relative; z-index: 99; }
.search-container { max-width: 800px; margin: 0 auto; position: relative; }
.search-container i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #FFD700; }
.search-input { width: 100%; padding: 12px 20px 12px 45px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,215,0,0.3); border-radius: 50px; color: #fff; transition: all 0.3s; }
.search-input:focus { outline: none; border-color: #FFD700; }

/* Marquee */
.marquee { background: linear-gradient(90deg, #FFD700, #FFA500); padding: 10px 0; overflow: hidden; position: relative; z-index: 99; }
.marquee-content { display: inline-block; animation: marqueeAnim 20s linear infinite; white-space: nowrap; }
.marquee-content span { color: #000; font-weight: 600; margin: 0 20px; }
@keyframes marqueeAnim { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Auto Animating Slider (3 seconds per product) */
.auto-slider-section { padding: 2rem 5%; background: linear-gradient(135deg, #0a0a0a, #141414); }
.auto-slider-container { position: relative; max-width: 100%; overflow: hidden; border-radius: 20px; }
.auto-slider { display: flex; transition: transform 0.5s ease-in-out; }
.auto-slide { min-width: 100%; position: relative; }
.auto-slide img { width: 100%; height: 400px; object-fit: cover; border-radius: 20px; }
.auto-slide-content { position: absolute; bottom: 30px; left: 30px; background: rgba(0,0,0,0.7); padding: 15px 25px; border-radius: 12px; }
.auto-slide-content h3 { color: #FFD700; margin-bottom: 5px; }
.auto-slide-content .price { font-size: 1.2rem; font-weight: bold; }
.auto-slider-prev, .auto-slider-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.7); color: #FFD700; border: none; width: 45px; height: 45px; border-radius: 50%; cursor: pointer; font-size: 1.3rem; transition: all 0.3s; z-index: 10; }
.auto-slider-prev:hover, .auto-slider-next:hover { background: #FFD700; color: #000; }
.auto-slider-prev { left: 20px; }
.auto-slider-next { right: 20px; }
.auto-slider-dots { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; z-index: 10; }
.auto-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.3s; }
.auto-dot.active { background: #FFD700; width: 25px; border-radius: 10px; }

/* Auth Forms */
.auth-container { max-width: 500px; margin: 3rem auto; background: rgba(0,0,0,0.8); padding: 2rem; border-radius: 20px; border: 1px solid rgba(255,215,0,0.3); }
.business-header { text-align: center; margin-bottom: 2rem; }
.business-header h1 { font-size: 2.5rem; background: linear-gradient(135deg, #FFD700, #FFA500); -webkit-background-clip: text; background-clip: text; color: transparent; }
.form-field { position: relative; margin-bottom: 1rem; }
.form-field i:first-child { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #FFD700; }
.form-field input { width: 100%; padding: 12px 15px 12px 45px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,215,0,0.3); border-radius: 10px; color: #fff; transition: all 0.3s; }
.form-field input:focus { outline: none; border-color: #FFD700; }
.toggle-password { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #FFD700; z-index: 1; }
.password-strength { height: 4px; margin-top: 5px; border-radius: 2px; transition: all 0.3s; }
.strength-weak { width: 33%; background: #FF0000; }
.strength-medium { width: 66%; background: #FFA500; }
.strength-strong { width: 100%; background: #00FF00; }
.checkbox-field { display: flex; justify-content: space-between; margin: 1rem 0; font-size: 0.85rem; }
.checkbox-field a { color: #FFD700; cursor: pointer; }
.btn-primary { width: 100%; padding: 12px; background: linear-gradient(135deg, #FFD700, #FFA500); border: none; border-radius: 50px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255,215,0,0.3); }
.btn-secondary { background: transparent; border: 2px solid #FFD700; color: #FFD700; padding: 8px 20px; border-radius: 50px; cursor: pointer; }
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Bottom Navigation */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.95); display: flex; justify-content: space-around; padding: 10px; z-index: 1000; border-top: 1px solid rgba(255,215,0,0.3); }
.nav-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; color: #fff; transition: all 0.3s; position: relative; }
.nav-item i { font-size: 1.3rem; }
.nav-item span { font-size: 0.7rem; margin-top: 4px; }
.nav-item.active, .nav-item:hover { color: #FFD700; transform: translateY(-3px); }
.cart-badge { position: absolute; top: -8px; right: -12px; background: #FF0000; border-radius: 50%; padding: 2px 6px; font-size: 0.65rem; min-width: 18px; text-align: center; }

/* Product Cards */
.product-container { display: flex; overflow-x: auto; gap: 15px; padding: 10px 0; scroll-behavior: smooth; }
.product-container::-webkit-scrollbar { display: none; }
.product-card { min-width: 220px; background: #1a1a1a; border-radius: 12px; padding: 1rem; border: 1px solid rgba(255,215,0,0.2); transition: all 0.3s; cursor: pointer; }
.product-card:hover { transform: translateY(-5px); border-color: #FFD700; box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.product-card img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; background: #333; }
.product-card h3 { font-size: 0.9rem; margin: 8px 0; }
.product-card .price { color: #FFD700; font-weight: 700; }
.add-to-cart { background: #FFD700; color: #000; border: none; padding: 8px; border-radius: 25px; width: 100%; cursor: pointer; margin-top: 8px; transition: all 0.3s; font-weight: 600; }
.add-to-cart:hover { background: #FFED4E; transform: scale(1.02); }
.category-section { padding: 1.5rem 5%; }
.category-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.category-header h2 { font-size: 1.3rem; }
.see-all { color: #FFD700; cursor: pointer; font-weight: 600; }
.see-all:hover { text-decoration: underline; }
.product-slider { display: flex; align-items: center; gap: 10px; }
.slider-prev-product, .slider-next-product { background: rgba(255,215,0,0.2); border: 1px solid #FFD700; color: #FFD700; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; transition: all 0.3s; }
.slider-prev-product:hover, .slider-next-product:hover { background: #FFD700; color: #000; }

/* Categories Page */
.categories-layout { display: flex; gap: 2rem; padding: 1rem 5%; min-height: 70vh; }
.categories-sidebar { width: 300px; background: rgba(0,0,0,0.5); border-radius: 16px; padding: 1.2rem; height: fit-content; position: sticky; top: 20px; border: 1px solid rgba(255,215,0,0.2); }
.categories-sidebar h3 { color: #FFD700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid #FFD700; }
.category-item { margin-bottom: 0.8rem; }
.category-header-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: rgba(255,255,255,0.05); border-radius: 10px; cursor: pointer; transition: all 0.3s; }
.category-header-item:hover { background: rgba(255,215,0,0.15); transform: translateX(5px); }
.category-arrow { color: #FFD700; transition: transform 0.3s; }
.category-arrow.rotated { transform: rotate(180deg); }
.subcategories { margin-left: 1rem; margin-top: 0.5rem; display: none; }
.subcategories.show { display: block; }
.subcategory-item { padding: 8px 12px; margin: 4px 0; background: rgba(255,255,255,0.03); border-radius: 8px; cursor: pointer; transition: all 0.3s; font-size: 0.85rem; }
.subcategory-item:hover { background: rgba(255,215,0,0.1); transform: translateX(8px); }
.categories-content { flex: 1; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.placeholder-message { text-align: center; padding: 3rem; color: #888; }
.placeholder-message i { font-size: 3rem; color: #FFD700; margin-bottom: 1rem; }

/* Cart Page */
.cart-items { padding: 1rem; }
.cart-item { display: flex; align-items: center; gap: 1rem; background: #1a1a1a; padding: 1rem; border-radius: 12px; margin-bottom: 1rem; flex-wrap: wrap; }
.cart-item-image { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; background: #333; }
.cart-item-details { flex: 1; min-width: 150px; }
.cart-item-price { color: #FFD700; font-weight: 700; }
.quantity-control { display: flex; gap: 10px; margin-top: 8px; align-items: center; }
.qty-minus, .qty-plus { background: rgba(255,215,0,0.2); border: 1px solid #FFD700; width: 30px; height: 30px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.remove-item { background: rgba(255,0,0,0.2); border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; color: #FF0000; transition: all 0.3s; }
.remove-item:hover { background: #FF0000; color: #fff; }
.order-summary { background: #1a1a1a; padding: 1.5rem; border-radius: 12px; margin: 1rem; max-width: 400px; margin-left: auto; }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.summary-row.total { border-top: 2px solid #FFD700; border-bottom: none; margin-top: 10px; padding-top: 15px; font-weight: 700; color: #FFD700; }
.cart-action-bar { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0; flex-wrap: wrap; gap: 10px; }
.delivery-input { margin: 1rem 0; padding: 15px; background: rgba(255,215,0,0.1); border-radius: 12px; }
.delivery-input label { display: block; margin-bottom: 8px; font-weight: 600; }
.delivery-input input { width: 100%; padding: 12px; border-radius: 8px; background: #1a1a1a; color: #fff; border: 1px solid #FFD700; margin-top: 5px; }

/* Chat Page */
.chat-messages { height: 350px; overflow-y: auto; padding: 1rem; background: #0a0a0a; border-radius: 12px; }
.message { margin-bottom: 1rem; }
.user-message { text-align: right; }
.admin-message { text-align: left; }
.message-bubble { display: inline-block; padding: 10px 16px; border-radius: 18px; max-width: 70%; word-wrap: break-word; }
.user-message .message-bubble { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.admin-message .message-bubble { background: #1a1a1a; }
.message-time { font-size: 0.65rem; opacity: 0.7; margin-top: 5px; }
.chat-input-area { display: flex; gap: 10px; padding: 1rem; background: #0a0a0a; border-radius: 0 0 12px 12px; }
.chat-input-area textarea { flex: 1; padding: 10px; background: #1a1a1a; border: 1px solid rgba(255,215,0,0.3); border-radius: 25px; color: #fff; resize: none; font-family: inherit; }
.send-message-btn { background: #FFD700; border: none; padding: 0 25px; border-radius: 25px; cursor: pointer; font-weight: 600; transition: all 0.3s; }
.send-message-btn:hover { background: #FFED4E; transform: scale(1.02); }
.quick-replies { display: flex; gap: 8px; padding: 1rem; flex-wrap: wrap; background: #0a0a0a; }
.quick-reply { background: rgba(255,215,0,0.1); border: 1px solid #FFD700; color: #FFD700; padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 0.75rem; transition: all 0.3s; }
.quick-reply:hover { background: #FFD700; color: #000; }

/* Modals & Toast */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 2000; justify-content: center; align-items: center; }
.modal-content { background: #1a1a1a; padding: 2rem; border-radius: 20px; max-width: 450px; width: 90%; border: 2px solid #FFD700; }
.close { float: right; font-size: 1.8rem; cursor: pointer; color: #FFD700; transition: all 0.3s; }
.close:hover { transform: scale(1.1); }
.modal-content input, .modal-content textarea { width: 100%; padding: 12px; margin: 10px 0; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,215,0,0.3); border-radius: 8px; color: #fff; }
.toast { position: fixed; bottom: 100px; right: 20px; background: #FFD700; color: #000; padding: 12px 24px; border-radius: 10px; display: none; z-index: 2000; animation: slideIn 0.3s; font-weight: 600; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Share Modal */
.share-buttons { display: flex; gap: 15px; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.share-btn { background: #1a1a1a; border: 1px solid #FFD700; color: #FFD700; padding: 10px 20px; border-radius: 50px; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px; }
.share-btn:hover { background: #FFD700; color: #000; }

/* Footer */
footer { background: #000; padding: 2rem 5%; text-align: center; border-top: 1px solid rgba(255,215,0,0.2); margin-top: 2rem; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.social-icons { display: flex; justify-content: center; gap: 20px; margin-top: 1rem; }
.social-icons a { color: #fff; font-size: 1.5rem; transition: all 0.3s; cursor: pointer; text-decoration: none; }
.social-icons a:hover { color: #FFD700; transform: scale(1.2); }
.footer-bottom { text-align: center; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1); color: #666; font-size: 0.8rem; }

/* Responsive */
@media (max-width: 768px) {
    .categories-layout { flex-direction: column; }
    .categories-sidebar { width: 100%; position: relative; top: 0; }
    .product-card { min-width: 160px; }
    .order-summary { max-width: 100%; }
    .header-icons .icon-btn span { display: none; }
    .header-icons .icon-btn { padding: 10px 12px; }
    .auto-slide img { height: 250px; }
    .auto-slide-content { bottom: 15px; left: 15px; padding: 10px 15px; }
    .auto-slide-content h3 { font-size: 0.9rem; }
}

/* ========== LOADING SPINNER ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: #FFD700;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Optional: Add text below spinner */
.loading-overlay .loading-text {
    color: #FFD700;
    margin-top: 20px;
    font-size: 0.9rem;
    text-align: center;
}

/* With text version */
.loading-overlay.with-text {
    flex-direction: column;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10000;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top: 4px solid #FFD700;
    border-right: 4px solid #FFA500;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #FFD700;
    margin-top: 20px;
    font-size: 1rem;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Dynamic Sliders Container */
#dynamicSlidersContainer {
    width: 100%;
}

/* Ensure product containers scroll horizontally */
.product-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 0;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.product-container::-webkit-scrollbar {
    height: 8px;
}

.product-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.product-container::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 10px;
}

/* Category section spacing */
.category-section {
    margin-bottom: 40px;
    padding: 0 5%;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-header h2 i {
    color: #FFD700;
}

.see-all {
    color: #FFD700;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.see-all:hover {
    text-decoration: underline;
    transform: translateX(5px);
}

/* Product slider buttons */
.product-slider {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.slider-prev-product, .slider-next-product {
    background: rgba(255,215,0,0.2);
    border: 2px solid #FFD700;
    color: #FFD700;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    flex-shrink: 0;
}

.slider-prev-product:hover, .slider-next-product:hover {
    background: #FFD700;
    color: #000;
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
    .category-header h2 {
        font-size: 1.2rem;
    }
    
    .slider-prev-product, .slider-next-product {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .product-slider {
        gap: 8px;
    }
}


.auto-slide img {
    width: 100%;
    height: 400px;
    object-fit: contain;  /* Shows entire image, adds black bars if needed */
    background: #1a1a1a;  /* Background color for empty areas */
}

/* Product Description Styling */
.product-description {
    font-size: 0.75rem;
    color: #aaa;
    margin: 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

/* For light mode */
body.light-mode .product-description {
    color: #666;
}