/* site.css - Complete Stylesheet for VirtualWareHouse */
/* Fixed: No two-line menu, no scrollbar */

/* ===== VARIABLES ===== */
:root {
    --primary-color: #2563eb; /* Bright blue */
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary-color: #7c3aed; /* Purple */
    --accent-color: #059669; /* Emerald green */
    --text-color: #1f2937; /* Dark gray */
    --text-light: #6b7280; /* Medium gray */
    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* ===== RESET & BASE ===== */
html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: clip; /* clip does NOT create a new containing block for fixed elements */
    max-width: 100vw;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-white);
    line-height: 1.6;
    overflow-y: auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

    a:hover {
        color: var(--primary-dark);
    }

img {
    max-width: 100%;
    height: auto;
}

/* ===== HEADER STYLES - FIXED ===== */
.header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    overflow: visible !important; /* Fixed overflow */
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px; /* Reduced padding */
    height: 72px;
    gap: 10px; /* Reduced gap */
    overflow: visible;
}

/* Logo Section - Compact */
.header-logo {
    flex: 0 0 auto;
    min-width: 170px; /* Reduced width */
}

    .header-logo a {
        display: flex;
        align-items: center;
        gap: 8px; /* Reduced gap */
        text-decoration: none;
    }

.logo-icon {
    width: 40px; /* Slightly smaller */
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 13px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 20px; /* Smaller */
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* Navigation Menu - Compact spacing */
.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
    overflow: visible;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.2rem; /* REDUCED SPACING - Was 2rem */
    align-items: center;
    flex-wrap: nowrap !important; /* Prevent wrapping */
    justify-content: center;
    white-space: nowrap;
}

    .nav-menu li {
        flex-shrink: 0; /* Prevent shrinking */
    }

        .nav-menu li a {
            text-decoration: none;
            color: var(--text-color);
            font-weight: 500;
            font-size: 14px; /* Smaller font */
            padding: 6px 10px; /* Reduced padding */
            border-radius: 6px;
            transition: all 0.2s ease;
            position: relative;
            white-space: nowrap;
        }

            .nav-menu li a:hover {
                color: var(--primary-color);
                background-color: var(--bg-light);
            }

/* Right Side Icons - Compact */
.header-icons {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.8rem; /* Reduced gap */
    height: 100%;
    min-width: 260px; /* Reduced width */
    justify-content: flex-end;
    overflow: visible;
}

/* Mobile account button - replaces the user dropdown when .header-nav is hidden */
.mobile-account-btn {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

/* Mobile menu toggle - only shown when .header-nav is hidden */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

    .mobile-menu-btn:hover,
    .mobile-menu-btn:focus {
        background: rgba(255, 255, 255, 0.3);
        color: #fff;
    }

/* Search Container - Smaller */
.search-container {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    width: 180px; /* Smaller */
    height: 36px; /* Smaller */
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .search-container:focus-within {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        width: 200px;
    }

.search-input {
    border: none;
    background: transparent;
    padding: 0 10px;
    width: 100%;
    height: 100%;
    font-size: 13px; /* Smaller */
    color: var(--text-color);
    outline: none;
}

    .search-input::placeholder {
        color: var(--text-light);
    }

.search-button {
    background: transparent;
    border: none;
    padding: 0 10px;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    border-left: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

    .search-button:hover {
        background: rgba(0, 0, 0, 0.03);
        color: var(--primary-color);
    }

/* Cart Icon */
.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .cart-icon:hover {
        background: var(--bg-light);
        color: var(--primary-color);
    }

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
}

/* Sign In Button - Compact */
.signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px; /* Reduced padding */
    height: 36px; /* Smaller */
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 8px;
    color: #fff;
    font-size: 13px; /* Smaller */
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

    .signin-btn i {
        font-size: 15px;
        color: inherit;
    }

    .signin-btn:hover,
    .signin-btn:focus {
        background: #fff;
        border-color: #fff;
        color: var(--primary-color) !important;
    }

    .signin-btn:hover i,
    .signin-btn:focus i,
    .signin-btn:hover span,
    .signin-btn:focus span {
        color: var(--primary-color) !important;
    }

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    color: var(--text-color);
    margin: 20px auto;
    border: 1px solid var(--border-color);
    max-width: 1400px;
    width: calc(100% - 40px);
    overflow: hidden;
}

/* ===== MAIN CONTENT ===== */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1300px) {
    .header-container {
        padding: 0 16px;
    }

    .nav-menu {
        gap: 1rem; /* Even smaller on medium screens */
    }

        .nav-menu li a {
            font-size: 13px;
            padding: 6px 8px;
        }

    .header-icons {
        min-width: 240px;
    }

    .search-container {
        width: 160px;
    }

    .logo-text {
        font-size: 18px;
    }
}

@media (max-width: 1100px) {
    .nav-menu {
        gap: 0.8rem; /* Very compact */
    }

        .nav-menu li a {
            font-size: 12px;
            padding: 5px 6px;
        }

    .header-icons {
        min-width: 220px;
    }

    .search-container {
        width: 140px;
    }

        .search-container:focus-within {
            width: 160px;
        }
}

@media (max-width: 992px) {
    .header-nav {
        display: none; /* Hide menu on tablets */
    }

    .header-icons {
        min-width: 200px;
    }

    .mobile-menu-btn,
    .mobile-account-btn {
        display: inline-flex;
    }

    /* The dropdown is replaced by the account offcanvas on small screens */
    .header-icons .user-dropdown-wrap {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 12px;
        height: 60px;
    }

    .logo-text {
        font-size: 16px;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }

    .header-icons {
        min-width: 180px;
        gap: 0.6rem;
    }

    .search-container {
        width: 120px;
        height: 32px;
    }

    .search-input {
        font-size: 12px;
        padding: 0 8px;
    }

    .signin-btn span {
        display: none; /* Hide text on mobile */
    }

    .signin-btn {
        width: 32px;
        padding: 0;
        justify-content: center;
    }

    .cart-icon {
        width: 32px;
        height: 32px;
    }

    .mobile-menu-btn {
        width: 38px;
        height: 32px;
        font-size: 20px;
    }

    .hero-section {
        margin: 12px auto;
        width: calc(100% - 24px);
        border-radius: 12px;
    }
}

@media (max-width: 576px) {
    /* The offcanvas menu carries its own search box on phones */
    .header .search-container {
        display: none;
    }

    .header-icons {
        min-width: 0;
        gap: 0.5rem;
    }

    .header-logo {
        min-width: 0;
        overflow: hidden;
    }

    .logo-text {
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    .logo-text {
        display: none; /* Keep the header on one row on very small phones */
    }
}

/* ===== FOOTER ===== */
.footer {
    background-color: #1f2937;
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

    .footer .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
    }

/* ===== PRODUCT CARDS & OTHER STYLES ===== */
/* (Keep your existing product card, button, etc. styles here) */
/* Just copy all the non-header styles from your previous site.css */

/* ===== UTILITY CLASSES ===== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .hover-lift:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-lg) !important;
    }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

/* SCROLLBAR FIX */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-light);
    }
/* ===== PRODUCT CARD STYLES ===== */
.product-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    background: white;
    height: 100%;
}

    .product-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-lg) !important;
        border-color: var(--primary-color);
    }

.product-image-container {
    position: relative;
    overflow: hidden;
    background: var(--bg-light);
    height: 220px;
}

    .product-image-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }

.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

    .product-badge.featured {
        background: var(--primary-color);
    }

    .product-badge.trending {
        background: var(--warning-color);
    }

    .product-badge.sale {
        background: var(--danger-color);
    }

    .product-badge.new {
        background: var(--success-color);
    }

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-card .card-body {
    padding: 1.25rem;
}

.product-card .card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3em;
}

.product-card .card-text {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

    .product-rating .stars {
        color: #fbbf24;
    }

    .product-rating .count {
        font-size: 12px;
        color: var(--text-light);
        margin-left: 0.5rem;
    }

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

    .product-price .current {
        font-size: 18px;
        font-weight: 700;
        color: var(--primary-color);
    }

    .product-price .old {
        font-size: 14px;
        color: var(--text-light);
        text-decoration: line-through;
    }

.product-stock {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

    .product-stock.in-stock {
        background: rgba(34, 197, 94, 0.1);
        color: #16a34a;
    }

    .product-stock.out-of-stock {
        background: rgba(239, 68, 68, 0.1);
        color: #dc2626;
    }

/* Product grid layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-image-container {
        height: 180px;
    }
}



/* Gradient background for header */
.navbar.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Custom button styles */
.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

    .btn-gradient:hover {
        background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

/* ===== BUY FOR US PREVIEW MODAL ===== */
#previewModal .modal-dialog {
    max-width: 900px;
    margin: 1.75rem auto;
}

#previewModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#previewModal .modal-body {
    padding: 2rem;
}

/* Product Image Container in Modal */
#previewModal #previewProductImage {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    max-height: 320px !important;
    object-fit: contain !important;
    background: transparent;
}

/* Image container background */
#previewModal .bg-light {
    background-color: #f8f9fa !important;
}

/* Bootstrap 5 handles modal centering natively via .modal-dialog-centered */

/* Mobile responsive for modal */
@media (max-width: 768px) {
    #previewModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    #previewModal .modal-body {
        padding: 1rem;
    }

    #previewModal #previewProductImage {
        max-height: 250px !important;
    }
}

/* ===== USER DROPDOWN MENU (shared: main + super admin layouts) ===== */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .3);
}

.avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
    background: rgba(255, 255, 255, .2);
    border: 2px solid rgba(255, 255, 255, .3);
    flex-shrink: 0;
}

.user-dropdown-toggle {
    padding: 5px 10px;
    border-radius: 20px;
    transition: all .3s;
    border: 1px solid rgba(255, 255, 255, .2);
}

.user-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .3);
}

.header .dropdown-menu {
    min-width: 280px;
    border: 1px solid rgba(0, 0, 0, .15);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    margin-top: 10px;
    font-family: inherit;
    font-size: 1rem;
}

.header .dropdown-item {
    padding: 8px 16px;
    transition: all .2s;
    font-size: 1rem;
    font-weight: 400;
    color: #212529;
}

.header .dropdown-item:hover {
    background-color: #f8f9fa;
}

.header .dropdown-item i {
    width: 20px;
    text-align: center;
    color: #6c757d;
}

.header .dropdown-item.text-danger i.text-danger {
    color: #dc3545 !important;
}

.header .dropdown-divider {
    margin: 8px 0;
}

.user-info-header {
    padding: 12px 16px;
    min-width: 250px;
}

.user-info-header .user-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    font-size: 1rem;
}

.user-info-header .user-email {
    font-size: 13px;
    color: #6c757d;
}

/* ===== HEADER NAV UTILITIES (search, cart, wishlist) ===== */
.header-blue {
    background-color: rgb(27, 132, 255) !important;
}

.header-blue .nav-link {
    color: white !important;
}

.header-blue .nav-menu .nav-link:hover,
.header-blue .nav-menu .nav-link:focus,
.header .nav-menu .nav-link:hover,
.header .nav-menu .nav-link:focus {
    color: rgb(27, 132, 255) !important;
    background-color: #fff !important;
    opacity: 1;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
}

.cart-icon-container {
    position: relative;
    display: inline-block;
}

.wishlist-nav-icon {
    font-size: 1.35rem;
    color: #fff;
    transition: transform .2s;
    display: inline-block;
}

.wishlist-nav-icon:hover {
    transform: scale(1.15);
    color: #fff;
}

#wishlistNavCount {
    display: none;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 8px 40px 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, .55);
    background: #fff;
    color: #1a1a1a;
    width: 200px;
    transition: all .3s;
    caret-color: rgb(27, 132, 255);
}

.search-input:focus {
    outline: none;
    border-color: #fff;
    background: #fff;
    color: #1a1a1a;
    width: 250px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}

.search-input::placeholder {
    color: #6c757d;
}

.search-button {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: rgb(27, 132, 255);
    cursor: pointer;
}

/* Super Admin layout: fixed header above sidebar */
body.sa-layout .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}
