/* ===================================
   World Class Header & Hero Styles
   =================================== */

/* --- Top Bar (Optional, for contacts/currency) --- */
.top-bar {
    background-color: var(--neutral-900, #1e1e1e);
    color: #fff;
    font-size: 0.8rem;
    padding: 8px 0;
}

.top-bar a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.top-bar a:hover {
    opacity: 1;
}

/* --- Main Header --- */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.navbar-brand img {
    height: 40px;
    /* Adjusted for sleek look */
    width: auto;
}

/* Search Bar */
.search-form {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.search-input-group {
    position: relative;
    border: 1px solid var(--neutral-300, #e2e8f0);
    border-radius: 50px;
    /* Pill shape */
    overflow: hidden;
    background: var(--neutral-100, #f8f9fa);
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    border-color: var(--primary-color, #0d6efd);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search-input {
    border: none;
    background: transparent;
    padding: 10px 20px;
    font-size: 0.95rem;
}

.search-input:focus {
    box-shadow: none;
    background: transparent;
}

.btn-search {
    background: transparent;
    border: none;
    color: var(--neutral-500, #6c757d);
    padding: 0 20px;
    transition: color 0.2s;
}

.btn-search:hover {
    color: var(--primary-color, #0d6efd);
}

/* User Actions */
.action-item {
    margin-left: 20px;
    position: relative;
}

.action-link {
    color: var(--neutral-700, #343a40);
    font-size: 1.25rem;
    transition: color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.action-link:hover {
    color: var(--primary-color, #0d6efd);
}

.action-label {
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 500;
    display: none;
    /* Hidden on mobile/tablet, shown on desktop if desired */
}

@media (min-width: 992px) {
    .action-label {
        display: block;
    }
}

.badge-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--danger-color, #dc3545);
    color: #fff;
    font-size: 0.65rem;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* --- Navigation Bar --- */
.main-navbar {
    background: #fff;
    border-top: 1px solid var(--neutral-200, #eee);
    display: none;
    /* Hidden on mobile, use hamburger or bottom nav */
}

@media (min-width: 992px) {
    .main-navbar {
        display: block;
    }
}

.nav-link {
    color: var(--neutral-700, #343a40);
    font-weight: 500;
    padding: 12px 20px !important;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    position: relative;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color, #0d6efd);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-color, #0d6efd);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 80%;
}

/* --- Hero Slider --- */
.hero-slider-container {
    padding: 20px 0 40px;
    /* Add some spacing */
    background: linear-gradient(to bottom, #f8f9fa 0%, #fff 100%);
}

.hero-swiper {
    width: 100%;
    height: 480px;
    /* Fixed height for consistency */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .hero-swiper {
        height: 350px;
    }
}

.swiper-slide {
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Left align content usually looks better */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 40px;
    max-width: 600px;
    color: #fff;
    margin-left: 5%;
    /* Indent from left */
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    color: #fff;
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
    /* Adjusted in animation */
}

.btn-hero {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
    /* Adjusted in animation */
    background-color: var(--color-primary, #0e2945);
    color: #fff;
    border: none;
    transition: all 0.3s;
}

.hero-discount-badge {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--color-primary, #0e2945);
    color: #fff;
    font-weight: 700;
    border-radius: 50px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out forwards;
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.4);
    background-color: #0b5ed7;
    color: #fff;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Tweaks */
@media (max-width: 576px) {
    .hero-title {
        font-size: 1.5rem !important;
        /* Smaller title */
        margin-bottom: 0.5rem !important;
    }

    .hero-subtitle {
        font-size: 0.95rem !important;
        /* Smaller subtitle */
        margin-bottom: 1rem !important;
    }

    .btn-hero {
        padding: 8px 20px !important;
        /* Move compact button */
        font-size: 0.85rem !important;
    }

    .hero-content {
        padding: 15px !important;
        margin-left: 0;
        text-align: center;
        width: 100%;
    }

    .hero-button-wrapper {
        display: flex;
        justify-content: center;
    }

    .hero-overlay {
        background: rgba(0, 0, 0, 0.6);
    }

    /* Reposition/Scale Arrows to avoid text overlap */
    .hero-swiper .swiper-button-next,
    .hero-swiper .swiper-button-prev {
        width: 32px !important;
        height: 32px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        top: auto !important;
        bottom: 15px !important;
        /* Move to bottom to clear text */
    }

    .hero-swiper .swiper-button-prev {
        left: 20px !important;
    }

    .hero-swiper .swiper-button-next {
        right: 20px !important;
    }

    .hero-swiper .swiper-button-next:after,
    .hero-swiper .swiper-button-prev:after {
        font-size: 0.9rem !important;
    }
}

/* --- Modern Category Filters --- */
.categories-section {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid var(--neutral-200, #eee);
}

.categories-bar-wrapper {
    position: relative;
    /* Can add arrow navigators here if needed */
}

.categories-scroll {
    display: flex;
    overflow-x: auto;
    padding-bottom: 5px;
    /* Space for scrollbar if visible */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    -webkit-overflow-scrolling: touch;
    align-items: center;
    gap: 12px;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.modern-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid var(--neutral-300, #e2e8f0);
    border-radius: 50px;
    color: var(--neutral-700, #4a5568);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 40px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.modern-filter-chip:hover {
    border-color: var(--primary-color, #0d6efd);
    color: var(--primary-color, #0d6efd);
    background: var(--neutral-50, #f8f9fa);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.modern-filter-chip.active {
    background-color: var(--neutral-900, #1a202c);
    /* Dark pill for active 'All' */
    color: #fff;
    border-color: var(--neutral-900, #1a202c);
}

.chip-icon {
    margin-right: 8px;
    font-size: 0.9em;
}

.chip-count {
    background: var(--neutral-100, #edf2f7);
    color: var(--neutral-600, #718096);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 600;
    line-height: 1;
}

.modern-filter-chip:hover .chip-count {
    background: #fff;
    color: var(--primary-color, #0d6efd);
}

/* Ensure container has some padding on mobile edges */
@media (max-width: 576px) {
    .categories-bar-wrapper {
        margin-left: -0.75rem;
        /* Bootstrap gutter compensation */
        margin-right: -0.75rem;
    }

    .categories-scroll {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* --- Spotlight Deal Banner --- */
.deal-banner-modern {
    text-align: center;
    padding: 30px 20px;
    margin-top: 10px;
    background: linear-gradient(to bottom, #fff, #fcfcfc);
    /* Subtle background */
}

.deal-banner-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--neutral-900, #212529);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@media (max-width: 576px) {
    .deal-banner-title {
        font-size: 1.25rem !important;
        /* Smaller Flash Deals title */
    }

    .deal-banner-subtitle {
        font-size: 0.9rem !important;
    }
}

.deal-banner-subtitle {
    font-size: 1.1rem;
    color: var(--neutral-600, #6c757d);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Product Grid 4-Column Layout --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Mobile first: 2 cols */
    gap: 15px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1350px) {
    .product-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }
}

/* Product Card Override/Enhancement */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.product-card__image {
    position: relative;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    background: #f8fafc;
}

.product-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.3s;
}

.product-card:hover .product-card__image img {
    transform: scale(1.05);
}

.product-card__content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card__category {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.product-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8em;
}

.product-card__price-section {
    margin-top: auto;
}

.product-card__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.product-card__price--old {
    font-size: 0.85rem;
    color: #94a3b8;
    text-decoration: line-through;
    margin-left: 8px;
}

/* --- Swiper Navigation - Decorated --- */
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 10;
}

.hero-swiper .swiper-button-next:after,
.hero-swiper .swiper-button-prev:after {
    font-size: 1.25rem;
    font-weight: 900;
}

.hero-swiper .swiper-button-next:hover,
.hero-swiper .swiper-button-prev:hover {
    background: var(--color-primary, #0e2945);
    border-color: var(--color-primary, #0e2945);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(14, 41, 69, 0.4);
}

.modern-filter-chip.active {
    background-color: var(--color-primary, #0e2945);
    color: #ffffff !important;
    border-color: var(--color-primary, #0e2945);
    box-shadow: 0 4px 12px rgba(14, 41, 69, 0.15);
}

.hero-swiper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all 0.3s ease;
}

.hero-swiper .swiper-pagination-bullet-active {
    width: 30px;
    border-radius: 5px;
    background: var(--color-primary, #0e2945);
}

/* --- Top Bar Enhancements --- */
.top-bar {
    background: #0a1f35 !important;
    /* Deepest dark for contrast */
}

.top-bar a:hover {
    color: var(--color-star, #fbbf24) !important;
    opacity: 1;
}

.hover-primary:hover {
    color: var(--color-star, #fbbf24) !important;
}

/* --- TOP BAR VISIBILITY & LAYOUT --- */
.top-bar {
    display: block !important;
    /* Changed from none to block */
    font-size: 0.85rem !important;
}

@media (min-width: 992px) {
    .top-bar {
        display: block !important;
    }
}

/* --- DESKTOP NAV VISIBILITY & LAYOUT --- */
.desktop-nav {
    display: none !important;
}

@media (min-width: 992px) {
    .desktop-nav {
        display: flex !important;
    }
}

/* Fix for desktop nav color consistency */
.desktop-nav .nav-link {
    color: #334155 !important;
    font-weight: 600 !important;
    padding: 0 10px !important;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.desktop-nav .nav-link:hover {
    color: var(--color-primary, #0e2945) !important;
}

/* Enhanced Active Link Styling */
.desktop-nav .nav-link {
    position: relative;
    /* Ensure relative positioning for pseudo-element */
}

.desktop-nav .nav-link.active {
    color: var(--color-primary, #0e2945) !important;
    font-weight: 800 !important;
}

.desktop-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    /* Push it down a bit */
    left: 0;
    width: 100%;
    transform: none;
    /* Fix: Cancel inherited variable centering from base class */
    height: 3px;
    background-color: var(--color-primary, #0e2945);
    border-radius: 2px;
}

/* Custom Cart Badge Positioning */
.cart-badge-custom {
    position: absolute;
    top: -5px;
    /* Reduced from -8px to prevent clipping */
    right: -5px;
    /* Reduced from -8px */
    background: linear-gradient(135deg, #ff4d4d 0%, #dc3545 100%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
    animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}