:root {
    /* Commercial catering theme colors */
    --primary-red: #E53E3E;
    --light-gray: #F7FAFC;
    --medium-gray: #E2E8F0;
    --dark-gray: #4A5568;
    --text-dark: #2D3748;
    --white: #FFFFFF;
    
    --transition-timing: 0.3s;
    --transition-timing-function: ease-in-out;
}

body {
    margin: 0;
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

.navbar {
    background: linear-gradient(to bottom, black 20%, rgba(0, 0, 0, 0) 100%) ;
    color: black;
    border-bottom: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    background: var(--white);
    color: var(--text-dark);
    border-bottom: 1px solid var(--medium-gray);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar.scrolled .navbar-brand,
.navbar.scrolled .nav-link,
.navbar.scrolled .navbar-subtitle,
.navbar.scrolled .btn-contact,
.navbar.scrolled .language-selector,
.navbar.scrolled .search-icon
 {
    color: var(--text-dark);
}

.navbar .navbar-brand,
.navbar .navbar-subtitle {
    color: var(--white);
    font-weight: 700;
}

.navbar .navbar-subtitle.has-mega-menu:hover {
    color: #C53030;
}


.cart-icon {
    color:  var(--white);
    text-decoration: none;
}

.cart-icon.scrolled {
    color: var(--text-dark);
    text-decoration: none;
}

/* Navbar background change on hover of "Produits" */
.navbar:has(.navbar-subtitle.has-mega-menu:hover) {
    background: var(--white);
    color: var(--text-dark);
    border-bottom: 1px solid var(--medium-gray);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar:has(.navbar-subtitle.has-mega-menu:hover) .navbar-brand,
.navbar:has(.navbar-subtitle.has-mega-menu:hover) .nav-link,
.navbar:has(.navbar-subtitle.has-mega-menu:hover) .navbar-subtitle,
.navbar:has(.navbar-subtitle.has-mega-menu:hover) .btn-contact,
.navbar:has(.navbar-subtitle.has-mega-menu:hover) .language-selector,
.navbar:has(.navbar-subtitle.has-mega-menu:hover) .search-icon {
    color: var(--text-dark);
}

/* Navigation links on the left */
.navbar-nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-left: 2rem;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: normal;
    padding: 1rem 0;
    position: relative;
    transition: color var(--transition-timing) var(--transition-timing-function);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px; /* 2px space below text */
    width: 0;
    height: 2px; /* 2px height underline */
    background-color: var(--primary-red); /* same color as hover */
}

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

.nav-link.active::after {
    width: 100%;
    transition: none;
}

.nav-link:hover {
    color: var(--primary-red);
}

/* Navbar subtitle with mega menu */
.navbar-subtitle {
    color: var(--primary-red);
    letter-spacing:1px;
    font-size: 0.8rem;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: normal;
    text-transform: uppercase; /* Keep uppercase for navbar links */
    letter-spacing: 0.5px;
    position: relative;
    cursor: pointer;
    padding: 1rem 0;
    text-decoration: none;
    font-weight: normal !important;
}

/* Mega menu links */
.mega-menu .category-name,
.mega-menu .product-link {
    text-transform: none !important; /* Remove uppercase in mega menu */
}

.navbar-subtitle::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 8px; /* 2px space below text */
    width: 0;
    height: 3px; /* 2px height underline */
    background-color: var(--primary-red);
}

.navbar-subtitle:hover::after {
    width: 100%;
}

.navbar-subtitle.active::after {
    width: 100%;
    transition: none;
}

.navbar-subtitle:hover {
    text-decoration: none;
}

.navbar-subtitle.has-mega-menu:hover {
    color: #C53030;
}

/* Mega Menu - Wiesheu Style */
.mega-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    visibility: hidden;
    opacity: 0;
    background: var(--white);
    border-top: 1px solid var(--medium-gray);
    border-bottom: 1px solid var(--medium-gray);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    z-index: 1000;
    width: 100vw;
    transform: translateY(-10px);
    transition: 
        visibility 0s var(--transition-timing-function) var(--transition-timing),
        opacity var(--transition-timing) var(--transition-timing-function),
        transform var(--transition-timing) var(--transition-timing-function);
}

.has-mega-menu:hover .mega-menu,
.mega-menu:hover {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

.mega-menu-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px; /* Added 20px gap between columns */
    max-width: 1400px;
    margin: 0 auto;
    min-height: 400px;
    background: var(--white);
}

/* Categories Sidebar - Left Column */
.categories-sidebar {
    background: var(--white);
    padding: 0;
}

.category-item {
    display: block;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    border-right: none; /* Removed vertical border */
    cursor: pointer;
    transition: all var(--transition-timing) var(--transition-timing-function);
    position: relative;
    color: var(--dark-gray);
    background: var(--white);
    text-decoration: none;
}

.category-item > a {
    text-decoration: none;
}

.category-item:hover {
    background: #ff4d4d;
    color: var(--white);
}

.category-item.active {
    background: #ff4d4d;
    color: var(--white);
}

.category-link {
     text-decoration: none;
}

.category-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: inherit;
    display: block;
    text-decoration: none;
}

/* Products List - Middle Column */
.products-list-section {
    background: var(--white);
    padding: 0;
}

.products-list {
    display: none;
    padding: 1rem 0;
}

.products-list.active {
    display: block;
}

.product-item {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all var(--transition-timing) var(--transition-timing-function);
    color: var(--dark-gray);
    font-size: 0.9rem;
    background: var(--white);
}

.product-item:hover {
    background: #ff4d4d;
    color: var(--white);
}

.product-link {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
}

.product-link:hover {
    color: inherit;
    text-decoration: none;
}

.product-item:hover .product-link {
    color: var(--white);
}

/* Product Details - Right Column */
.product-details-section {
    background: var(--white);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-details {
    display: none;
    width: 100%;
    text-align: center;
}

.category-details.active {
    display: block;
}

.product-details {
    display: none;
    width: 100%;
}

.product-details.active {
    display: block;
    width: 100%;
}

/* Simple Product Preview Styles */
.simple-product-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 280px;
    margin: 0 auto;
}

.product-image-container {
    width: 100px;
    height: 250px;
    margin-bottom: 2rem;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:30px;
}

.product-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.4;
}

.simple-product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.3;
    text-align: center;
}

/* Category Info Styles */
.category-info {
    text-align: center;
    padding: 2rem;
}

.category-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.category-description {
    color: var(--dark-gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    max-width: 300px;
    margin: 0 auto;
}

/* Responsive design */
@media (max-width: 1024px) {
    .mega-menu {
        min-width: 600px;
    }
    
    .mega-menu-content {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-column:nth-child(4),
    .category-column:nth-child(5) {
        grid-column: span 1;
        margin-top: 1rem;
        border-right: none;
        border-top: 1px solid var(--light-gray);
        padding-top: 1rem;
    }
}

@media (max-width: 768px) {
    .navbar-subtitle {
        display: none;
    }
    
    .mega-menu {
        position: static;
        visibility: visible;
        opacity: 1;
        transform: none;
        min-width: auto;
        width: 100%;
        border: none;
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid var(--medium-gray);
    }
    
    .mega-menu-content {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .category-column {
        border-right: none;
        border-bottom: 1px solid var(--light-gray);
        padding: 1rem 0;
    }
    
    .category-column:last-child {
        border-bottom: none;
    }
}

/* New styles for navbar right section */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: 2rem;
}

.btn-contact {
    background-color: #004080;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

.btn-contact:hover {
    background-color: #003366;
}

.language-selector {
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    user-select: none;
}

.search-icon {
    font-size: 1.2rem;
    cursor: pointer;
    user-select: none;
    padding: 0.2rem;
    border-radius: 4px;
    transition: background-color 0.3s ease-in-out;
}

.search-icon:hover,
.search-icon:focus {
    background-color: var(--medium-gray);
    outline: none;
}
