/**
 * May & Co Navbar Styles - Clean Rewrite
 * Focused on perfect centering and responsive design
 */

/* ===== PROMOTIONAL BAR ===== */
.promo-bar {
    background: linear-gradient(135deg, #8B0000, #A52A2A);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2px 0;
    position: relative;
    z-index: 100;
}

.promo-content {
    text-align: center;
    position: relative;
}

.promo-text {
    color: white;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    animation: promoGlow 4s ease-in-out infinite;
}

@keyframes promoGlow {
    0%, 100% { 
        opacity: 0.9;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
    50% { 
        opacity: 1;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 8px rgba(255, 255, 255, 0.2);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .promo-text {
        font-size: 11px;
        letter-spacing: 0.1em;
    }
}

/* Reset and base navbar styles */
.navbar-custom {
    padding: 0.5rem 0;
    position: relative;
    width: 100%;
    /* Red background */
    background: linear-gradient(135deg, #8B0000, #A52A2A);
    padding-bottom: calc(0.5rem + 30px); /* Add space for the scaled trim image */
}

.navbar-custom::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 150px;
    background-image: url('../assets/navbartrim.png');
    background-repeat: no-repeat;
    background-position: bottom center;
    background-size: auto 150px;
    pointer-events: none;
}

/* Main navbar container - perfectly centered */
.navbar-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

/* Desktop layout - three column grid */
@media (min-width: 992px) {
    .navbar-desktop {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        width: 100%;
        gap: 40px;
    }

    .navbar-left {
        display: flex;
        justify-content: flex-end;
        gap: 30px;
    }

    .navbar-center {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .navbar-right {
        display: flex;
        justify-content: flex-start;
        gap: 30px;
    }

    .navbar-mobile {
        display: none;
    }
}

/* Mobile layout */
@media (max-width: 991.98px) {
    .navbar-desktop {
        display: none;
    }

    .navbar-mobile {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .navbar-container {
        padding: 0 15px;
    }
}

/* Logo styling */
.navbar-brand {
    display: inline-block;
    text-decoration: none;
}

.navbar-brand img {
    height: 75px;
    width: auto;
    filter: invert(1) brightness(0.9);
    transition: filter 0.3s ease;
}

.navbar-brand img:hover {
    filter: invert(1) brightness(1.1);
}

/* Navigation links - Art Deco Enhancement */
.nav-link {
    color: white !important;
    text-decoration: none;
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    padding: 12px 0 25px 0;
    position: relative;
    overflow: visible;
}

/* Add a subtle entrance animation for nav links */
.nav-link {
    animation: navLinkEntrance 1s ease-out backwards;
}

.nav-link:nth-child(1) { animation-delay: 0.1s; }
.nav-link:nth-child(2) { animation-delay: 0.2s; }
.nav-link:nth-child(3) { animation-delay: 0.3s; }
.nav-link:nth-child(4) { animation-delay: 0.4s; }
.nav-link:nth-child(5) { animation-delay: 0.5s; }
.nav-link:nth-child(6) { animation-delay: 0.6s; }

@keyframes navLinkEntrance {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 100px;
    height: 20px;
    background-image: url('../assets/nav-underline.png');
    background-size: auto 100%;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0) saturate(90%) invert(90%);
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 10;
    clip-path: inset(0 50% 0 50%);
    transition: all 0.8s ease-in-out;
}

.nav-link::after {
    content: '';
    display: none;
}

.nav-link:hover {
    color: #FFFFFF !important;
    transform: translateY(-2px);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
    letter-spacing: 0.12em;
}

.nav-link:hover::before {
    opacity: 1;
    clip-path: inset(0 0% 0 0%);
}

.nav-link.active {
    color: #FFFFFF !important;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.nav-link.active::before {
    opacity: 1;
    clip-path: inset(0 0% 0 0%);
    filter: brightness(0) saturate(100%) invert(100%) drop-shadow(0 2px 6px rgba(255, 255, 255, 0.4));
}

/* Smooth center-outward transition - no keyframes needed, using CSS transitions */

/* Mobile menu toggle */
.navbar-toggler {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

/* Hamburger icon */
.hamburger {
    display: flex;
    flex-direction: column;
    width: 25px;
    height: 20px;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile menu dropdown */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 400px;
    background-color: #A52A2A;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.3s ease;
}

.mobile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mobile-menu .nav-link {
    display: block;
    padding: 15px 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0;
}

.mobile-menu .nav-link:last-child {
    border-bottom: none;
}

.mobile-menu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    transform: none;
}

/* Scroll behavior */
.navbar-custom.navbar-hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
}

.navbar-custom.navbar-visible {
    transform: translateY(0);
    transition: transform 0.3s ease-in-out;
}

/* Cart Count Styling */
.cart-count {
    background: #c9302c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 5px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cart-link {
    position: relative;
    display: flex;
    align-items: center;
}

/* Ensure no overflow issues */
.navbar-custom * {
    box-sizing: border-box;
}