/* ==========================================================
   Enterprise Smart E-Commerce Portal - Non-Overlapping Fluid CSS
   ========================================================== */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #0f172a;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition: all 0.2s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 0;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

/* Announcement Header Marquee */
.top-announcement-bar {
    background: linear-gradient(90deg, #1e3a8a, #2563eb);
    color: #ffffff;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 999;
}
.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 25s linear infinite;
}
@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* Glassmorphism Sticky Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 16px;
}
.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}
.brand-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--secondary);
    display: block;
    line-height: 1.2;
}
.brand-tagline {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Search Bar */
.header-search {
    flex: 1;
    max-width: 480px;
}
.search-form {
    display: flex;
    background: #f1f5f9;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    transition: var(--transition);
}
.search-form:focus-within {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 16px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}
.search-form button {
    background: transparent;
    border: none;
    padding: 0 16px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
}
.search-form button:hover { color: var(--primary); }

/* Desktop Navigation Links */
.desktop-nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-page-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}
.nav-page-link:hover { color: var(--primary); }

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.action-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    background: #f1f5f9;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}
.action-btn:hover { background: var(--primary-light); color: var(--primary); }
.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}
.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
}

/* Dropdowns */
.action-dropdown { position: relative; }
.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    min-width: 240px;
    display: none;
    z-index: 1100;
    overflow: hidden;
}
.action-dropdown.active .dropdown-menu { display: block; }
.notif-menu { width: 320px; }
.dropdown-header { padding: 12px 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-color); text-decoration: none; color: inherit; }
.notif-item:hover { background: var(--primary-light); }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.notif-icon.deal { background: #dcfce7; color: #16a34a; }
.notif-icon.alert { background: #fee2e2; color: #dc2626; }
.notif-icon.info { background: #e0f2fe; color: #0284c7; }
.notif-title { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.notif-desc { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.notif-time { font-size: 10px; color: #94a3b8; display: block; margin-top: 3px; }
.dropdown-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

.user-menu-header { padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid var(--border-color); }
.user-menu-header strong { display: block; font-size: 13px; color: var(--secondary); }
.user-menu-header small { color: var(--text-muted); font-size: 11px; }
.user-menu-link { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--text-main); text-decoration: none; font-size: 13px; font-weight: 500; }
.user-menu-link:hover { background: #f1f5f9; color: var(--primary); }
.user-menu-link.admin-link { background: #eff6ff; color: var(--primary); font-weight: 700; }
.dropdown-divider { height: 1px; background: var(--border-color); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--transition);
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: #f1f5f9; }
.btn-success { background: var(--success); color: #ffffff; }
.btn-danger { background: var(--danger); color: #ffffff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

/* Hero Slider */
.hero-slider-section { margin: 20px auto; }
.hero-slider { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.slider-slide { position: relative; height: 360px; background-size: cover; background-position: center; display: flex; align-items: center; }
.slider-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,23,42,0.85) 0%, rgba(15,23,42,0.3) 100%); }
.slider-content { position: relative; z-index: 2; max-width: 580px; padding: 0 40px; color: #ffffff; }
.slider-badge { display: inline-block; background: #ef4444; color: #ffffff; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius-full); margin-bottom: 12px; }
.slider-title { font-size: 30px; font-weight: 800; line-height: 1.2; margin-bottom: 10px; }
.slider-desc { font-size: 14px; color: #e2e8f0; margin-bottom: 20px; }

/* Categories Bar */
.categories-bar { margin: 24px 0 16px 0; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; }
.section-title { font-size: 20px; font-weight: 800; color: var(--secondary); }
.cat-scroll-container { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.cat-card { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #ffffff; border: 1px solid var(--border-color); border-radius: var(--radius-full); text-decoration: none; color: var(--text-main); font-size: 13px; font-weight: 600; white-space: nowrap; transition: var(--transition); }
.cat-card i { color: var(--primary); font-size: 15px; }
.cat-card:hover, .cat-card.active { background: var(--primary); color: #ffffff; border-color: var(--primary); }
.cat-card:hover i, .cat-card.active i { color: #ffffff; }

/* Product Cards Grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-bottom: 30px; }
.product-card { background: #ffffff; border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; transition: var(--transition); display: flex; flex-direction: column; position: relative; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cbd5e1; }
.product-badge-wrap { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; z-index: 2; }
.badge-discount { background: var(--danger); color: #ffffff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-sm); }
.badge-digital { background: #8b5cf6; color: #ffffff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-sm); }
.wishlist-heart-btn { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; background: rgba(255,255,255,0.9); border: 1px solid var(--border-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #94a3b8; cursor: pointer; transition: var(--transition); z-index: 2; }
.wishlist-heart-btn:hover, .wishlist-heart-btn.active { color: var(--danger); background: #fff; }
.product-thumb { height: 200px; background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-thumb img { max-width: 100%; max-height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .product-thumb img { transform: scale(1.05); }
.product-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.product-category { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.product-title { font-size: 14px; font-weight: 700; color: var(--secondary); line-height: 1.3; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 38px; }
.product-title a { color: inherit; text-decoration: none; }
.rating-stars { color: #fbbf24; font-size: 12px; margin-bottom: 8px; }
.rating-stars span { color: var(--text-muted); font-size: 11px; margin-left: 4px; }
.product-price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.current-price { font-size: 17px; font-weight: 800; color: var(--secondary); }
.original-mrp { font-size: 12px; color: #94a3b8; text-decoration: line-through; }
.product-footer-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

/* Mid Promo Banner */
.promo-mid-banner { margin: 30px 0; background: linear-gradient(135deg, #1e293b, #0f172a); border-radius: var(--radius-lg); padding: 36px; display: flex; align-items: center; justify-content: space-between; color: #ffffff; background-size: cover; background-position: center; }
.promo-text h3 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.promo-text p { color: #cbd5e1; font-size: 14px; max-width: 600px; }

/* Cart & Checkout Layout */
.cart-layout, .checkout-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin: 24px 0; }
.cart-table-card, .summary-card, .checkout-form-card { background: #ffffff; border-radius: var(--radius-lg); border: 1px solid var(--border-color); padding: 24px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; padding: 10px; border-bottom: 2px solid var(--border-color); font-size: 12px; color: var(--text-muted); }
.cart-table td { padding: 14px 10px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; }
.qty-btn { width: 28px; height: 28px; background: #f1f5f9; border: none; cursor: pointer; font-size: 14px; font-weight: bold; display: flex; align-items: center; justify-content: center; }
.qty-val { width: 34px; text-align: center; font-size: 13px; font-weight: 600; border: none; background: transparent; }

/* Global Popup Modal */
.popup-modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.7); backdrop-filter: blur(4px); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.popup-modal-card { background: #ffffff; border-radius: var(--radius-lg); max-width: 460px; width: 100%; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; animation: popIn 0.3s ease; }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.popup-close-btn { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff; border: none; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; }

/* Floating WhatsApp Button - Guaranteed Non-Overlapping */
.floating-wa-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: #25d366;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 950;
    text-decoration: none;
    transition: var(--transition);
}
.floating-wa-btn:hover { transform: scale(1.1); }
.wa-tooltip { position: absolute; right: 65px; background: #1e293b; color: #ffffff; font-size: 11px; padding: 4px 8px; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: var(--transition); }
.floating-wa-btn:hover .wa-tooltip { opacity: 1; }

/* Mobile Sticky Bottom Nav */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    z-index: 900;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--text-muted); font-size: 11px; gap: 2px; position: relative; width: 20%; }
.nav-item i { font-size: 17px; }
.nav-item.active { color: var(--primary); font-weight: 700; }
.mobile-cart-badge { position: absolute; top: -3px; right: 18px; background: var(--primary); color: #ffffff; font-size: 9px; padding: 1px 5px; border-radius: 10px; font-weight: bold; }

/* PWA Install Card */
.pwa-install-card {
    position: fixed;
    bottom: 25px;
    left: 25px;
    background: #1e293b;
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: none;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 960;
    max-width: 340px;
}
.pwa-content { display: flex; align-items: center; gap: 10px; }
.pwa-icon { width: 34px; height: 34px; background: var(--primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.pwa-info strong { display: block; font-size: 12px; }
.pwa-info p { font-size: 10px; color: #94a3b8; margin: 0; }
.pwa-actions { display: flex; align-items: center; gap: 8px; }
.btn-close-sm { background: transparent; border: none; color: #94a3b8; font-size: 18px; cursor: pointer; }

/* Footer */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 50px 0 20px 0; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 40px; }
.footer-col h3 { color: #fff; font-size: 18px; margin-bottom: 12px; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer-col p { font-size: 13px; line-height: 1.6; color: #94a3b8; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: #94a3b8; text-decoration: none; font-size: 13px; transition: var(--transition); }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; font-size: 12px; }
.bottom-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.payment-badges { display: flex; gap: 8px; }
.badge-pay { background: rgba(255,255,255,0.06); padding: 4px 8px; border-radius: 4px; font-size: 11px; }

/* Responsive Media Queries - Eliminating All Overlapping */
@media (max-width: 900px) {
    .cart-layout, .checkout-layout, .footer-grid { grid-template-columns: 1fr; }
    .promo-mid-banner { flex-direction: column; text-align: center; gap: 16px; }
    .desktop-nav-links { display: none; }
}

@media (max-width: 768px) {
    /* Critical body padding to prevent mobile bottom nav overlap */
    body { padding-bottom: 75px !important; }
    .header-search { display: none; }
    .mobile-bottom-nav { display: flex; }
    /* Position WhatsApp above bottom nav */
    .floating-wa-btn { bottom: 75px !important; right: 16px !important; width: 48px; height: 48px; font-size: 24px; }
    /* Position PWA install card above bottom nav */
    .pwa-install-card { bottom: 72px !important; left: 10px !important; right: 10px !important; max-width: none !important; }
    .slider-slide { height: 280px; }
    .slider-title { font-size: 22px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .product-thumb { height: 160px; }
}
