:root {
    --primary-color: #DF0708;
    --primary-hover: #b80506;
    --bg-color: #ffffff;
    --text-color: #111111;
    --text-muted: #777777;
    --header-bg: #ffffff;
    --border-color: #eaeaea;
    --card-bg: #ffffff;
}

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

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.auth-container input:not([type="checkbox"]):not([type="hidden"]) {
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
}

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

header {
    background-color: var(--header-bg);
    padding: 2rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1005;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}


/* Main Layout for Permanent Sidebar */
.main-layout {
    display: flex;
    align-items: flex-start;
    max-width: 100%;
    margin: 0;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1010;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar Styles */
.brands-sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--bg-color);
    border-right: 1px solid var(--border-color);
    min-height: calc(100vh - 105px);
    overflow-y: auto;
}

.main-content-wrapper {
    flex-grow: 1;
    width: calc(100% - 250px);
    transition: width 0.3s ease;
}

.sidebar-header {
    background-color: var(--primary-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
}
.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 1px;
}

.brands-list {
    list-style: none;
    padding: 0;
}

.brand-item {
    border-bottom: 1px solid var(--border-color);
}

.brand-title {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.brand-title:hover {
    background-color: #f9f9f9;
}

.chevron {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.brand-item.open .chevron {
    transform: rotate(180deg);
}

.subcategories-list {
    list-style: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #fafafa;
}

.brand-item.open .subcategories-list {
    max-height: 500px; /* Arbitrary large number for animation */
}

.subcategories-list li a {
    display: block;
    padding: 0.8rem 1.5rem 0.8rem 2.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.subcategories-list li a:hover {
    color: var(--primary-color);
}

header h1 {
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo img {
    max-height: 50px; /* Reduced from 60px */
    width: auto;
    display: block;
}

/* Minimalist Search Bar */
.search-container {
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1.5rem;
    border: 1px solid #cccccc; /* Darkened border for visibility */
    border-radius: 30px;
    background: #fdfdfd; /* Slight off-white to contrast with pure white header */
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Header Icons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-link {
    color: #8b0000; /* Dark Red */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
}

.icon-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.cart-link {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    height: 18px;
    min-width: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

main {
    padding: 0 0 4rem 0;
}

/* Footer Styles */
footer {
    background-color: #efedee; /* Custom light grey per request */
    color: #111111; /* Changed to dark text for contrast against light bg */
    padding: 4rem 0 0 0;
    border-top: none;
    text-align: left;
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-title {
    color: #111111; /* Changed to dark text */
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-desc {
    color: #444444; /* Darker description text */
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: #ffffff;
    background-color: #111111; /* Dark background for icons */
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #444444; /* Darker link text */
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-form input {
    padding: 0.8rem 1rem;
    background-color: #ffffff; /* White input background */
    border: 1px solid #cccccc;
    color: #111111;
    border-radius: 4px;
    outline: none;
}

.newsletter-form input::placeholder {
    color: #888888;
}

.newsletter-form input:focus {
    border-color: var(--primary-color);
}

.btn-subscribe {
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.btn-subscribe:hover {
    background-color: var(--primary-hover);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-top: 1px solid #999999; /* Darker border for light background */
    color: #444444; /* Darker text */
    font-size: 0.8rem;
}

.payment-methods {
    display: flex;
    gap: 1rem;
    align-items: center;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Button styles - Minimal */
.btn {
    display: inline-block;
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 0.8rem 2rem;
    text-decoration: none;
    border: 1px solid var(--text-color);
    cursor: pointer;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: transparent;
    color: var(--text-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
}

/* Minimalist Cards & Layouts */
.hero {
    text-align: center;
    padding: 6rem 2rem;
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4rem;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 4rem 2rem;
}

.product-card {
    background-color: #ffffff; /* Make cards white to pop off the grey background */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

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

.product-card img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    background-color: #f9f9f9;
    margin-bottom: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover img {
    opacity: 0.85;
}

.product-info {
    padding: 0.8rem 1rem;
}

.product-info h3 {
    font-size: 1.05rem;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 0.1rem;
    line-height: 1.2;
    color: var(--text-color);
}

.product-info .price {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Override admin/checkout stuff for minimalist */
.stat-card, .checkout-form, .checkout-summary, .sidebar {
    background-color: transparent;
    border: 1px solid var(--border-color);
    padding: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    text-align: left;
}

th {
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* Hero Section */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 6%;
    gap: 4rem;
    min-height: 65vh;
    background-color: #f7f7f7;
    border-radius: 0;
    margin-top: 0;
    width: 100%;
}

.hero-inner {
    max-width: 1400px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hero-content {
    flex: 1;
    max-width: 550px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1.5px;
    text-transform: uppercase;
}

.hero-title .highlight {
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.hero-image-wrapper {
    flex: 1.5;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-image {
    width: 100%;
    max-width: 900px;
    height: auto;
    object-fit: contain;
    transform: scale(1.15);
}

/* Admin Layout */
.admin-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.admin-nav {
    width: 250px;
    flex-shrink: 0;
}

.admin-content {
    flex-grow: 1;
    width: calc(100% - 250px - 2rem);
}

/* Admin Dashboard Specifics */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* Mobile touch scrolling for product sliders */
@media (max-width: 900px) {
    .slider-container {
        overflow-x: auto; /* Enable touch scrolling */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    
    .slider-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }
    
    .slider-track {
        animation: none !important; /* Disable infinite animation on mobile */
    }

    .hero-inner {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }
    .hero-section {
        padding: 3rem 2rem 2rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-actions {
        justify-content: center;
    }

    .hero-image {
        transform: scale(1);
    }

    .main-layout,
    .admin-container {
        flex-direction: column;
    }

    .brands-sidebar,
    .admin-nav {
        position: fixed;
        top: 0;
        left: -300px; /* Hide off-screen by default */
        width: 280px;
        height: 100vh;
        z-index: 1020;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        background-color: var(--bg-color); /* Ensure background is solid when sliding out */
    }

    .brands-sidebar.active,
    .admin-nav.active {
        left: 0;
    }

    .main-content-wrapper,
    .admin-content {
        width: 100%;
    }

    .mobile-menu-toggle {
        display: block;
    }

    header .container {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .search-container {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 0.5rem;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
}

/* Featured Products Section */
.featured-section {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 10px 0; /* Reduced top and bottom spacing to 10px */
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.slider-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.slider-track {
    display: flex;
    width: max-content;
    animation: scroll-slide 20s linear infinite;
}

.slider-track:hover {
    animation-play-state: paused;
}

.slide-set {
    display: flex;
    gap: 2rem;
    padding: 0 1rem;
}

@keyframes scroll-slide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.product-card-dark {
    width: 280px; /* Fixed width for slider cards */
    flex-shrink: 0;
    background-color: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.product-image-container {
    width: 100%;
    height: 230px;
    background-color: #f0f0f0; /* Light background for the image to pop */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

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

.product-card-dark:hover .product-image-container img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    text-transform: uppercase;
}

.product-details {
    padding: 10px 12px;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #ffffff; /* White background for text and buttons */
    color: #111111; /* Dark text for contrast */
}

.product-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.product-title-row h3 {
    color: #111111; /* Override default white text inherited from section */
}

.product-title-row p.product-price {
    color: #111111;
    font-weight: 700;
}

.product-name {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    white-space: nowrap;
}

.btn-add-cart {
    width: 100%;
    padding: 0.3rem;
    background-color: transparent;
    border: 1px solid #444;
    color: #ffffff;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-featured-cart {
    width: 100%;
    padding: 0.5rem;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #ffffff;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-featured-cart:hover {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

.btn-featured-cart:disabled {
    background-color: #555 !important;
    color: #999 !important;
    border-color: #555 !important;
    cursor: not-allowed;
}

.btn-featured-view {
    width: 100%;
    padding: 0.5rem;
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #000000;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-featured-view:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* New Arrivals Section */
.new-arrivals-section {
    padding: 10px 2rem 40px 2rem;
    width: 100%;
    background-color: #f7f7f7; /* Very light grey */
    box-sizing: border-box;
}

.new-arrivals-section .section-header {
    margin-bottom: 2rem;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.new-arrivals-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.product-details-light {
    padding: 12px 15px; /* Added horizontal padding */
    height: 70px; /* Slightly taller to accommodate padding */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.btn-add-cart-light {
    width: 100%;
    padding: 0.3rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-cart-light:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

@media (max-width: 1400px) {
    .new-arrivals-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .new-arrivals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .new-arrivals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .new-arrivals-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   GLOBAL PRODUCT GALLERY LIGHTBOX
   ========================================================================== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 100000;
    transition: color 0.2s ease;
}
.lightbox-close:hover {
    color: #DF0708;
}
.lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#global-product-gallery-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    cursor: zoom-in;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
    z-index: 100000;
}
.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

.lightbox-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 100000;
}
.lightbox-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background 0.2s ease;
}
.lightbox-dot.active {
    background: #DF0708;
}
