/* =========================================
   MUSAFIR'S SHOP - PREMIUM FRONTEND THEME
   (Full Combined Stylesheet)
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&display=swap');

/* --- 1. Root Variables & Reset --- */
:root {
    --theme-green: #008C45;
    --theme-green-hover: #006b35;
    --theme-red: #E63946;
    --theme-red-hover: #c9302c;
    --theme-black: #111111;
    --text-dark: #2c2c2c;
    --text-gray: #666666;
    --border-color: #e5e5e5;
    --bg-white: #ffffff;
    --bg-offwhite: #f8f9fa;
}

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

body { 
    font-family: 'Hind Siliguri', sans-serif; 
    background-color: var(--bg-white); 
    color: var(--text-dark); 
    line-height: 1.6; 
    -webkit-font-smoothing: antialiased;
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 15px; 
}

/* --- 2. HEADER & NAVIGATION --- */
.top-bar { 
    background-color: var(--theme-green); 
    color: white; 
    text-align: center; 
    padding: 8px 10px; 
    font-size: 14px; 
    font-weight: 500;
    letter-spacing: 0.5px;
}

.main-header { 
    background: var(--bg-white); 
    border-bottom: 1px solid var(--border-color); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 75px; 
}

/* Hide hamburger menu on desktop */
.menu-icon { 
    display: none;
    font-size: 24px; 
    cursor: pointer; 
    color: var(--text-dark); 
}

.logo img { 
    max-height: 55px; 
    width: auto; 
    transition: transform 0.3s;
}
.logo img:hover { transform: scale(1.02); }

.nav-menu ul { 
    list-style: none; 
    display: flex; 
    gap: 25px; 
    align-items: center;
}

.nav-menu ul li a { 
    text-decoration: none; 
    color: var(--text-dark); 
    font-weight: 600; 
    font-size: 16px; 
    transition: color 0.3s ease; 
}
.nav-menu ul li a:hover { color: var(--theme-green); }

/* Dropdown Menu - Bulletproof Fix */
.dropdown { position: relative; }
.dropdown > a { display: flex; align-items: center; gap: 5px; }
.dropdown > a i { transition: transform 0.3s ease; }

.dropdown-menu { 
    display: none !important; /* Force hide initially */
    position: absolute; 
    top: 100%; 
    left: 0; 
    background: white; 
    min-width: 220px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    z-index: 200; 
    border-radius: 8px; 
    flex-direction: column !important; 
    gap: 0 !important; 
    padding: 10px 0;
    border: 1px solid #f0f0f0;
}

/* Show on Hover (Desktop) or Click (menu-active) */
.dropdown:hover .dropdown-menu,
.dropdown.menu-active .dropdown-menu { 
    display: flex !important; 
    animation: fadeIn 0.3s ease; 
}

/* Rotate Arrow */
.dropdown:hover > a i,
.dropdown.menu-active > a i { 
    transform: rotate(180deg); 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.dropdown-menu li { width: 100%; border-bottom: 1px solid #f9f9f9; }
.dropdown-menu li a { 
    padding: 10px 20px; 
    display: block; 
    color: var(--text-gray); 
    font-weight: 500;
    transition: all 0.3s; 
}
.dropdown-menu li a:hover { 
    background: var(--bg-offwhite); 
    color: var(--theme-green); 
    padding-left: 25px; 
}

/* Header Actions */
.header-actions { 
    display: flex; 
    gap: 20px; 
    align-items: center; 
}
.header-actions a { 
    color: var(--theme-black); 
    font-size: 22px; 
    text-decoration: none; 
    position: relative; 
}
.cart-count { 
    position: absolute; 
    top: -6px; 
    right: -10px; 
    background: var(--theme-red); 
    color: white; 
    font-size: 11px; 
    width: 20px; 
    height: 20px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    border-radius: 50%; 
    font-weight: bold; 
}

/* --- 3. HERO BANNER & SECTION --- */
.hero-section { width: 100%; overflow: hidden; background: var(--bg-offwhite); }
.hero-banner { width: 100%; height: auto; max-height: 500px; object-fit: cover; display: block; }

.section-title { 
    text-align: center; 
    font-size: 28px; 
    font-weight: 700; 
    margin: 50px 0 30px; 
    color: var(--theme-black);
    text-transform: uppercase;
}

/* --- 4. PRODUCT GRID & CARDS --- */
.product-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 25px; 
    margin-bottom: 50px;
}

.product-card { 
    background: white; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    padding: 15px; 
    text-align: center; 
    position: relative; 
    transition: all 0.3s ease; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.product-card:hover { 
    box-shadow: 0 10px 20px rgba(0,0,0,0.06); 
    transform: translateY(-3px);
    border-color: var(--theme-green);
}

.badge-sale { 
    position: absolute; 
    top: 15px; left: 15px; 
    background: var(--theme-red); 
    color: white; 
    padding: 4px 12px; 
    font-size: 11px; 
    border-radius: 20px; 
    font-weight: 700; 
    z-index: 2; 
}

.product-image img { 
    width: 100%; 
    height: 220px; 
    object-fit: contain; 
    transition: transform 0.5s ease; 
}

.product-details {
    margin-top: 15px;
}

.product-title a { 
    color: var(--text-dark); 
    text-decoration: none; 
    font-size: 16px; 
    font-weight: 600; 
}

.product-price { margin: 10px 0; }
.current-price { font-size: 20px; font-weight: 700; color: var(--theme-green); }
.old-price { font-size: 15px; color: var(--text-gray); text-decoration: line-through; margin-left: 8px; }

.btn-quick-add { 
    display: block;
    width: 100%; 
    background: var(--theme-black); 
    color: white; 
    border: none; 
    padding: 12px; 
    font-size: 15px; 
    font-weight: 600; 
    cursor: pointer; 
    border-radius: 6px; 
    transition: 0.3s;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
}
.btn-quick-add:hover { background: var(--theme-green); }

/* --- 5. SINGLE PRODUCT PAGE --- */
.single-product-page { padding: 50px 15px; }
.product-main { display: flex; flex-wrap: wrap; gap: 50px; background: white; padding: 30px; border-radius: 10px; border: 1px solid var(--border-color); }

.single-image-wrapper { flex: 1; min-width: 300px; text-align: center; background: var(--bg-offwhite); border-radius: 8px; padding: 20px; position: relative;}
.main-img { width: 100%; max-width: 450px; height: auto; object-fit: contain; }

.single-info { flex: 1.2; min-width: 300px; }
.single-title { font-size: 30px; font-weight: 700; margin-bottom: 15px; line-height: 1.3; }

.price-area { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px dashed #ddd; }
.current-price-large { font-size: 28px; font-weight: 700; color: var(--theme-green);}
.old-price-large { font-size: 20px; color: var(--text-gray); text-decoration: line-through; }
.save-badge { background: var(--theme-red); color: white; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: bold; }

.quantity-selector { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; }
.qty-controls { display: flex; border: 2px solid var(--theme-green); border-radius: 6px; overflow: hidden; }
.qty-btn { background: white; border: none; width: 45px; height: 45px; font-size: 22px; color: var(--theme-green); cursor: pointer; }
.qty-input { width: 60px; border: none; border-left: 2px solid var(--theme-green); border-right: 2px solid var(--theme-green); text-align: center; font-size: 18px; font-weight: bold; outline: none;}

.btn-add-cart { width: 100%; background: var(--theme-black); color: white; border: none; padding: 16px; font-size: 18px; font-weight: 600; border-radius: 6px; margin-bottom: 15px; cursor: pointer; transition: 0.3s; }
.btn-add-cart:hover { background: #333; }
.btn-buy-now { width: 100%; background: var(--theme-red); color: white; border: none; padding: 16px; font-size: 18px; font-weight: 600; border-radius: 6px; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 10px; transition: 0.3s; }
.btn-buy-now:hover { background: var(--theme-red-hover); }

.product-description { margin-top: 30px; padding: 20px; background: var(--bg-offwhite); border-radius: 8px; border-left: 4px solid var(--theme-green); }

/* --- 6. MODERN CART PAGE (Enhanced) --- */
.cart-steps { display: flex; justify-content: center; margin-bottom: 40px; gap: 10px; flex-wrap: wrap; }
.step { padding: 8px 20px; border-radius: 30px; background: #eee; font-size: 14px; font-weight: 600; color: #999; }
.step.active { background: var(--theme-green); color: #fff; }

.cart-page-wrapper { display: flex; gap: 30px; margin-top: 30px; align-items: flex-start; }
.cart-items-list { flex: 2; width: 100%; }
.cart-summary-sidebar { flex: 1; width: 100%; background: #fff; padding: 25px; border-radius: 12px; border: 1px solid #eee; box-shadow: 0 5px 15px rgba(0,0,0,0.05); position: sticky; top: 100px; }

.cart-item-card { display: flex; align-items: center; background: #fff; padding: 20px; border-radius: 12px; margin-bottom: 15px; border: 1px solid #f0f0f0; transition: 0.3s; }
.cart-item-card:hover { border-color: var(--theme-green); box-shadow: 0 5px 15px rgba(0,0,0,0.08); }
.cart-item-img img { width: 90px; height: 90px; object-fit: contain; border-radius: 8px; background: #f9f9f9; }
.cart-item-details { flex: 1; padding-left: 20px; }
.cart-item-title { font-size: 18px; font-weight: 600; color: var(--theme-black); text-decoration: none; }
.cart-item-price-qty { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 120px; }
.cart-price-tag { font-weight: 700; color: var(--theme-green); font-size: 18px; }
.remove-item-btn { color: #ff4d4d; text-decoration: none; font-size: 14px; font-weight: 600; transition: 0.3s; }
.remove-item-btn:hover { color: #cc0000; }

.summary-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--theme-green); }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 16px; }
.total-divider { height: 1px; background: #eee; margin: 15px 0; }
.grand-total { font-size: 22px; font-weight: 800; color: var(--theme-red); }

/* --- 7. PROFESSIONAL USER PROFILE (Enhanced) --- */
.profile-grid { display: flex; gap: 30px; margin-top: 30px; align-items: flex-start; }
.profile-sidebar { flex: 1; width: 100%; background: #fff; border-radius: 15px; border: 1px solid #eee; overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.user-info-header { background: var(--theme-green); color: white; padding: 30px 20px; text-align: center; }
.user-avatar { width: 80px; height: 80px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 35px; margin: 0 auto 15px; border: 3px solid rgba(255,255,255,0.3); }

.profile-nav { list-style: none; padding: 15px 0; }
.profile-nav li a { display: flex; align-items: center; gap: 12px; padding: 12px 25px; text-decoration: none; color: #555; font-weight: 500; transition: 0.3s; }
.profile-nav li a:hover, .profile-nav li a.active { background: #f0fdf4; color: var(--theme-green); border-left: 4px solid var(--theme-green); }

.profile-main-content { flex: 3; width: 100%; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card-small { background: white; padding: 20px; border-radius: 12px; border: 1px solid #eee; display: flex; align-items: center; gap: 15px; }
.stat-card-small i { font-size: 24px; color: var(--theme-green); }
.stat-card-small .num { font-size: 20px; font-weight: 700; display: block; }

.order-card-wrapper { background: white; border-radius: 15px; border: 1px solid #eee; padding: 25px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); overflow-x: auto; }
.modern-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.modern-table th { text-align: left; padding: 15px; color: #888; border-bottom: 1px solid #eee; }
.modern-table td { padding: 15px; border-bottom: 1px solid #f9f9f9; }

.status-pill { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; color: white; }
.action-btns { display: flex; gap: 8px; }
.btn-icon { width: 35px; height: 35px; border-radius: 8px; display: flex; justify-content: center; align-items: center; border: none; cursor: pointer; text-decoration: none; }

/* --- 8. FOOTER & MISC --- */
.custom-footer { background-color: #111111; color: #cccccc; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; padding: 70px 15px 30px; }
.footer-heading { color: white; font-size: 20px; font-weight: 600; margin-bottom: 25px; position: relative; padding-bottom: 10px; }
.footer-heading::after { content: ''; position: absolute; left: 0; bottom: 0; width: 50px; height: 3px; background: var(--theme-green); }
.footer-logo { max-width: 180px; margin-bottom: 20px; }

.footer-menu { list-style: none; }
.footer-menu li { margin-bottom: 12px; }
.footer-menu a { color: #cccccc; text-decoration: none; transition: 0.3s; }
.footer-menu a:hover { color: var(--theme-green); padding-left: 8px; }

.social-links { display: flex; gap: 12px; margin-top: 20px; }
.social-links a { width: 40px; height: 40px; background: rgba(255,255,255,0.1); color: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; text-decoration: none; transition: 0.3s; }
.social-links a:hover { background: var(--theme-green); transform: translateY(-5px); }

/* Added missing Footer Utility Classes */
.footer-bottom-bar { border-top: 1px solid #222; padding: 20px 0; background: #0a0a0a; }
.d-flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.payment-methods { display: flex; gap: 15px; font-size: 26px; color: #888; }

/* Floating Elements */
.custom-footer { position: relative; }
.back-to-top { position: absolute; right: 40px; top: -25px; background: var(--theme-red); color: white; border: none; width: 50px; height: 50px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: 0.3s; }
.back-to-top:hover { background: var(--theme-red-hover); transform: translateY(-3px); }

/* Enhanced Chat Button */
.floating-chat { position: fixed; bottom: 30px; right: 30px; z-index: 999; display: flex; align-items: center; gap: 10px; }
.chat-text { background: #fff; color: #333; padding: 6px 15px; border-radius: 20px; font-weight: 600; box-shadow: 0 4px 15px rgba(0,0,0,0.1); font-size: 14px; opacity: 0; transform: translateX(20px); transition: 0.3s ease; pointer-events: none; white-space: nowrap; }
.floating-chat:hover .chat-text { opacity: 1; transform: translateX(0); }
.chat-icon-bg { background: #25D366; width: 60px; height: 60px; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: white; font-size: 35px; box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); transition: transform 0.3s ease; }
.chat-icon-bg:hover { transform: scale(1.1); }

/* --- 9. MOBILE RESPONSIVE --- */
@media (max-width: 992px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .header-container { height: 65px; }
    .logo img { max-height: 45px; }
    
    /* Make Hamburger Icon Visible */
    .menu-icon { display: block; }
    
    /* Hide menu by default and slide/fade on active */
    .nav-menu { display: none; position: absolute; top: 65px; left: 0; width: 100%; background: white; box-shadow: 0 10px 15px rgba(0,0,0,0.1); border-top: 1px solid #eee;}
    .nav-menu.active { display: block; }
    .nav-menu ul { flex-direction: column; gap: 0; }
    .nav-menu ul li { width: 100%; border-bottom: 1px solid #f9f9f9; }
    .nav-menu ul li a { padding: 15px 20px; display: block; width: 100%; }

    /* Mobile Dropdown Override */
    .dropdown-menu { 
        position: static !important; 
        box-shadow: none !important; 
        border: none !important; 
        background: #f8f9fa !important; 
        padding: 0 !important; 
    }
    .dropdown-menu li a { padding-left: 35px; }

    /* Disable hover opening on mobile, rely strictly on .menu-active */
    .dropdown:hover .dropdown-menu { display: none !important; }
    .dropdown.menu-active .dropdown-menu { display: flex !important; }

    /* Rotate Arrow Reset */
    .dropdown:hover > a i { transform: rotate(0deg); }
    .dropdown.menu-active > a i { transform: rotate(180deg); }

    /* Product Grid Mobile (2 per row) */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-image img { height: 160px; }
    .product-title a { font-size: 14px; }
    .current-price { font-size: 17px; }

    /* Product Single Mobile Fixes */
    .product-main { gap: 20px; padding: 20px 15px; }
    .single-title { font-size: 22px; }
    .qty-controls { justify-content: center; }

    /* Cart & Profile Mobile */
    .cart-page-wrapper, .profile-grid { flex-direction: column; }
    .cart-summary-sidebar, .profile-sidebar { width: 100%; position: static; }
    
    .cart-item-card { flex-wrap: wrap; }
    .cart-item-price-qty { width: 100%; align-items: flex-start; border-top: 1px solid #eee; margin-top: 10px; padding-top: 10px; }

    /* Modern Table Mobile Overlay fix */
    .modern-table thead { display: none; }
    .modern-table tr { display: block; border: 1px solid #eee; margin-bottom: 15px; border-radius: 10px; padding: 10px; }
    .modern-table td { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border: none; text-align: right; }
    .modern-table td::before { content: attr(data-label); font-weight: 700; color: #555; float: left; text-align: left; }
    
    .d-flex-between { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    .product-image img { height: 200px; }
}