:root {
    --primary-color: #1a1a1a; 
    --accent-color: #e63946; 
    --text-light: #f8f9fa;
    --header-bg: #ffffff; /* White Header */
    --header-text: #1a1a1a; /* Dark text for header */
    --nav-secondary-bg: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
}

.site-header {
    background-color: var(--header-bg);
    border-bottom: 2px solid var(--accent-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Lighter shadow */
    z-index: 1030;
}

/* Header Text & Icons */
.site-header .btn-outline-light {
    color: var(--header-text);
    border-color: var(--header-text);
}

.site-header .btn-outline-light:hover {
    background-color: var(--header-text);
    color: #fff;
}

.site-header .cart-icon {
    color: var(--header-text) !important;
}

/* Hamburger - Transparent & Modern */
.hamburger-btn {
    background: transparent;
    border: none;
    color: var(--header-text);
    padding: 0.25rem 0.5rem;
    transition: color 0.2s;
}

.hamburger-btn:hover {
    color: var(--accent-color);
}

/* Secondary Navbar */
.secondary-navbar {
    background-color: var(--nav-secondary-bg);
    border-bottom: 1px solid #333;
}

.secondary-navbar .nav-link {
    color: #ccc;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.secondary-navbar .nav-link:hover {
    color: var(--accent-color);
}

/* Offcanvas Customization */
.offcanvas {
    max-width: 300px;
}

.accordion-button:not(.collapsed) {
    color: var(--accent-color);
    background-color: rgba(230, 57, 70, 0.1); /* Subtle red tint when open */
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.125);
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23e63946' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3e%3cpath d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

.accordion-button:focus {
    box-shadow: none; 
    border-color: rgba(0,0,0,0);
}

/* Offcanvas Submenu Styling */
.accordion-body ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.accordion-body ul li:last-child {
    border-bottom: none;
}

.accordion-body ul li a {
    display: block;
    padding-left: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    color: #ced4da !important; /* Lighter text */
}

.accordion-body ul li a:hover {
    color: var(--accent-color) !important;
    padding-left: 1rem; /* Indent effect */
    background-color: rgba(255,255,255,0.05);
    border-radius: 4px;
}

/* Mobile Adjustments for Secondary Nav Logic */
@media (max-width: 991.98px) {
    .offcanvas {
        width: 85%;
    }
}

/* Search Bar Styling */
.search-group .form-control {
    border-radius: 20px 0 0 20px;
    border: 1px solid #ced4da; /* Restore border for visibility */
    border-right: none; /* Merge visually with button */
}

.search-group .btn-search {
    background-color: var(--accent-color);
    color: white;
    border-radius: 0 20px 20px 0;
    border: none;
    transition: background-color 0.3s;
}

.search-group .btn-search:hover {
    background-color: #c92a36;
}

/* User Actions */
.login-btn {
    border-radius: 20px;
}

.cart-icon {
    transition: transform 0.2s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

/* Hero Section */
#hero-section {
    position: relative;
    max-height: 500px; /* Limit height on desktop */
    overflow: hidden;
    background-color: #000;
}

.hero-img {
    height: 500px;
    object-fit: cover;
    filter: brightness(0.85); /* Slightly darken images */
}

/* Gradient Overlay for Text Readability */
.carousel-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 60%);
    z-index: 1;
}

.carousel-caption {
    z-index: 2;
    bottom: 20%;
    left: 10%;
    right: auto; /* Align left */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

/* Animations */
.animate-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.delay-100 { animation-delay: 0.2s; }
.delay-200 { animation-delay: 0.4s; }

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

/* Hero Mobile Adjustments */
@media (max-width: 768px) {
    #hero-section, .hero-img {
        height: 300px; /* Smaller height on mobile */
    }
    .carousel-caption {
        bottom: 10%;
        left: 5%;
        right: 5%;
        text-align: center !important; /* Center text on mobile */
    }
    .carousel-caption h2 {
        font-size: 1.8rem;
    }
    .carousel-caption p {
        font-size: 1rem;
    }
    .carousel-caption .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Category Rail */
.category-rail-container {
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding-bottom: 1rem;
    padding-top: 1rem; /* Prevent hover clipping */
}

.category-rail-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Mobile: Switch to Grid/Wrap layout */
@media (max-width: 768px) {
    .category-rail-container {
        flex-wrap: wrap !important; /* Force wrap */
        justify-content: center !important; /* Center items */
        overflow-x: visible; /* Disable scroll */
        gap: 1.5rem !important; /* Adjust gap for grid */
    }
    .category-item {
        flex: 0 0 auto; /* Allow sizing based on content or width */
        width: 30%; /* 3 items per row approx */
        max-width: 100px;
    }
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    cursor: pointer;
    transition: transform 0.2s;
    color: var(--primary-color);
    text-decoration: none;
}

.category-item:hover {
    transform: translateY(-5px);
    color: var(--accent-color);
}

.cat-icon-circle {
    width: 60px;
    height: 60px;
    background-color: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.2s, color 0.2s;
}

.category-item:hover .cat-icon-circle {
    background-color: var(--accent-color);
    color: white;
}

.category-name {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

/* Featured Products Grid */
.product-card {
    border: none;
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

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

.product-img-wrapper {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    background-color: #fff; /* Ensure white bg for images */
}

.product-img-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    max-height: 80%;
    transition: transform 0.3s;
}

.product-card:hover .product-img-wrapper img {
    transform: translate(-50%, -50%) scale(1.05); /* Subtle zoom */
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px; /* Right aligned */
    background-color: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    z-index: 2;
}

.old-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.current-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.btn-add-cart {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 100%;
    border-radius: 8px;
    padding: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-add-cart:hover {
    background-color: var(--accent-color);
}

/* Promo Banners */
.promo-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 250px;
    display: flex;
    align-items: center;
    padding: 2rem;
    color: white;
    text-decoration: none;
    transition: transform 0.3s;
}

.promo-card:hover {
    transform: translateY(-5px);
    color: white;
}

.promo-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    filter: brightness(0.6);
    transition: filter 0.3s;
}

.promo-card:hover .promo-bg {
    filter: brightness(0.5);
}

.promo-content {
    position: relative;
    z-index: 2;
    max-width: 70%;
}

/* Brands Carousel */
.brand-item {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    transition: transform 0.3s;
}

.brand-logo {
    max-height: 60px;
    max-width: 100%;
    filter: grayscale(100%) opacity(0.6);
    transition: filter 0.3s, transform 0.3s;
    cursor: pointer;
}

.brand-item:hover .brand-logo {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1); /* Make arrows black */
}

/* Maps */
.map-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    margin-top: 1rem;
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Footer */
footer a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: white;
}

.footer-logo {
    filter: brightness(0) invert(1); /* Make logo white */
    max-width: 180px;
}

.social-icon {
    width: 36px;
    height: 36px;
    background-color: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 0.5rem;
    transition: background-color 0.2s;
}

.social-icon:hover {
    background-color: var(--accent-color);
    color: white;
}

.payment-icons i {
    font-size: 1.5rem;
    margin-left: 0.5rem;
    color: #adb5bd;
}