/* ============================================================= */
/* Root Variables                                                */
/* ============================================================= */
:root {
    --primary: #170a69;        /* Main deep navy blue */
    --secondary: #2a1b8a;      /* Lighter indigo for gradients */
    --accent: #00d4ff;         /* Cyan accent */
    --success: #10b981;        /* Success / add to cart */
    --danger: #ef4444;         /* Warnings / remove */
    --warning: #f59e0b;        /* Promotions */
    --dark: #111827;           /* Text / footer */
    --light: #f8fafc;          /* Light background */
    --gray: #6b7280;           /* Neutral gray */
    --light-gray: #e2e8f0;     /* Borders & subtle bg */
}

/* ============================================================= */
/* Global Styles                                                 */
/* ============================================================= */
* {
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef2ff 100%);
    min-height: 100vh;
    padding-top: 100px !important;
    margin: 0;
}

/* ============================================================= */
/* Top Bar                                                       */
/* ============================================================= */
.top-bar {
    font-size: 0.85rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1040;
    background: rgba(23, 10, 105, 0.95);
    backdrop-filter: blur(12px);
    color: white;
    padding: 8px 0;
}

.top-bar a {
    color: #e0e7ff !important;
    transition: color 0.3s ease;
}

.top-bar a:hover {
    color: var(--accent) !important;
    text-decoration: none;
}

.top-bar {
    background: var(--primary);
    color: white;
    font-size: 0.875rem;
    padding: 8px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1040;
}

/* Right side fixed order: Search - Language - Login */
.navbar-collapse {
    justify-content: space-between !important;
}

.navbar-search {
    margin-left: auto !important;
    margin-right: 16px !important;
}

.d-inline-block + ul.navbar-nav {
    margin-left: 12px !important;
}

/* Brands Horizontal Scroll - Thin Scrollbar */
.brands-scroll .overflow-auto {
    scrollbar-width: thin;           /* Firefox */
    scrollbar-color: #0d6efd #e9ecef; /* Firefox */
    -ms-overflow-style: none;        /* IE/Edge */
}

.brands-scroll .overflow-auto::-webkit-scrollbar {
    height: 8px;                     /* Chrome, Edge, Safari */
    background: transparent;
}

.brands-scroll .overflow-auto::-webkit-scrollbar-thumb {
    background-color: #0d6efd;
    border-radius: 20px;
}

.brands-scroll .overflow-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 20px;
}

/* Smooth Underline - Full content width (icon + text) */
.link-underline {
    position: relative;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #0d6efd;
    transition: width 0.4s ease;
}

.link-underline:hover {
    color: #0d6efd !important;
}

.link-underline:hover::after {
    width: 100%;   /* Now exactly matches icon + text length */
}

.link-underline {
    position: relative;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #0d6efd;
    transition: width 0.4s ease;
}

.link-underline:hover {
    color: #0d6efd !important;
}

.link-underline:hover::after {
    width: 100%;
}


.user-dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
}

.user-dropdown-toggle::after {
    transition: transform 0.2s ease;
}

.user-dropdown:hover .user-dropdown-toggle::after {
    transform: rotate(180deg);
}

@media (max-width: 991.98px) {
    .top-bar {
        font-size: 0.85rem;
        padding: 10px 0;
        text-align: center;
    }
    .top-bar .contact-info {
        display: none;
    }
    .top-bar .links-info {
        display: block !important;
    }
}

@media (max-width: 576px) {
    .top-bar {
        padding: 6px 0;
        font-size: 0.8rem;
    }
}

/* ============================================================= */
/* Navbar (Desktop)                                              */
/* ============================================================= */
.navbar {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    top: 40px !important;
    z-index: 1030;
}

@media (max-width: 576px) {
    .navbar {
        top: 35px !important;
    }
}

/* Desktop Active Nav Styling */
.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
    color: var(--primary) !important;
    font-weight: 600;
}
.navbar-nav .nav-link.active {
    position: relative;
}
.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* Navbar Search */
.navbar-search {
    max-width: 600px;
    flex: 1;
    min-width: 280px;
}
.navbar-search .form-control {
    border-radius: 25px 0 0 25px;
    padding: 12px 20px;
    border: 2px solid var(--light-gray);
    font-size: 1rem;
    transition: all 0.3s ease;
}
.navbar-search .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(23, 10, 105, 0.2);
}
.navbar-search .btn {
    border-radius: 0 25px 25px 0;
    background: var(--primary);
    border: none;
    padding: 12px 20px;
    min-width: 56px;
}
.navbar-search .btn:hover {
    background: var(--secondary);
}

@media (max-width: 991px) {
    .navbar-search {
        margin: 15px 0;
        max-width: 100%;
        min-width: auto;
    }
    .navbar-search .form-control,
    .navbar-search .btn {
        border-radius: 25px;
    }
    .navbar-search .btn {
        width: 100%;
        margin-top: 10px;
    }
}

/* ============================================================= */
/* Mobile Header                                                 */
/* ============================================================= */
.mobile-header {
    display: none;
}
@media (max-width: 991.98px) {
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 48px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(12px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
        padding: 12px 20px;
        z-index: 1030;
    }
    main {
        padding-top: 140px !important;
    }
    .desktop-navbar {
        display: none !important;
    }
}

.mobile-header .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.4rem;
}
.mobile-header .logo-link img {
    max-height: 38px;
    margin-right: 8px;
}

.mobile-header .search-btn {
    background: var(--primary);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(23, 10, 105, 0.3);
}
.mobile-header .search-btn i {
    font-size: 1.4rem;
}

/* ============================================================= */
/* Mobile Bottom Nav - FORCED 5-COLUMN LINE                      */
/* ============================================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 1030;
    display: none;
}

@media (max-width: 991.98px) {
    .bottom-nav {
        display: block;
    }
    
    /* We remove the container/row restrictions */
    .bottom-nav .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .bottom-nav .row {
        display: flex !important;
        flex-wrap: nowrap !important; /* Forces one line */
        margin: 0 !important;
        width: 100%;
    }

    /* Force exactly 20% width */
    .bottom-nav .col {
        flex: 0 0 20% !important;
        width: 20% !important;
        max-width: 20% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body {
        padding-bottom: 80px !important;
    }
}

.bottom-nav .nav-link {
    color: var(--gray);
    padding: 6px 0;
    font-size: 11px; /* Smaller font is safer for 5 items */
    text-align: center;
    text-decoration: none;
    display: block;
    width: 100%;
    font-size: 10px;          /* smaller text */
    line-height: 1.1;
    white-space: nowrap;      /* prevents text wrapping */
}

.bottom-nav .nav-link.active,
.bottom-nav .nav-link:hover {
    color: var(--primary);
}

.bottom-nav .bi {
    font-size: 1.1.5rem; /* Scaled to fit */
    display: block;
    margin-bottom: 1px;
}

/* Badge adjustment for narrow columns */
.bottom-nav .badge {
    position: absolute;
    top: 3px;
    left: 55%; 
    transform: scale(0.85);
    font-size: 0.6rem;
    padding: 2px 5px;
}


/* ============================================================= */
/* General Components                                            */
/* ============================================================= */
.hero-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

/* Icons */
.cart-icon, .wishlist-icon {
    cursor: pointer;
    transition: color 0.3s;
    font-size: 1.2rem;
}
.cart-icon:hover { color: var(--primary) !important; }
.wishlist-icon:hover { color: #ff4757 !important; }

/* Product Images */
.main-product-image {
    height: 400px !important;
    object-fit: cover !important;
    width: 100% !important;
    border-radius: 12px;
}
.related-product-card .card-img-top {
    width: 100% !important;
    height: 140px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Cards */
.card {
    border: none !important;
    border-radius: 15px !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--secondary)) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-primary:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 25px rgba(23, 10, 105, 0.3) !important;
}

/* Animated Titles */
.cart-title-animated {
    position: relative;
    display: inline-block;
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: 0.5px;
    text-transform: capitalize;
    padding-bottom: 12px;
    overflow: hidden;
}
.cart-title-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.7s ease;
}
.cart-title-animated:hover::after {
    width: 100%;
}
.cart-title-animated:hover {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.checkout-title-animated {
    position: relative;
    display: inline-block;
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: 0.5px;
    text-transform: capitalize;
    padding-bottom: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.checkout-title-animated i {
    margin-right: 12px;
    font-size: 1.8rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}
.checkout-title-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.7s ease;
}
.checkout-title-animated:hover::after {
    width: 100%;
}
.checkout-title-animated:hover {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.checkout-title-animated:hover i {
    transform: translateY(-4px) rotate(8deg);
}

.cart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0,0,0,.08) !important;
}


@media (max-width: 576px) {
    .cart-title-animated,
    .checkout-title-animated {
        font-size: 2rem;
    }
    .checkout-title-animated i {
        font-size: 1.6rem;
    }
}

.search-product-item{
    transition: 0.2s ease;
}

.search-product-item:hover{
    background:#f8f9fa;
    cursor: pointer;
}


#ajaxSearchResults {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}