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

/* Add padding to body to account for fixed navbar */
body {
    padding-top: 140px; /* Adjust based on navbar height */
}

@media (max-width: 768px) {
    body {
        padding-top: 120px; /* Smaller padding for mobile */
    }
}

/* ===== 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: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    /* Red background */
    background: linear-gradient(135deg, #8B0000, #A52A2A);
    padding-bottom: calc(0.5rem + 30px); /* Add space for the scaled trim image */
    z-index: 1000;
}

.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;
        align-items: center;
        gap: 25px;
    }

    .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;
}

/* Removed scroll behavior - navbar stays fixed at top */

/* 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;
}

/* Authentication buttons styling */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-left: auto;
}

/* Auth button base styles - no flourish animation */
.auth-btn {
    color: white !important;
    text-decoration: none;
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 400;
    font-size: 12px !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    padding: 6px 12px !important;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: visible;
}

/* Remove flourish animation for auth buttons */
.auth-btn::before {
    display: none !important;
}

.auth-btn::after {
    display: none !important;
}

.auth-btn:hover {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    text-shadow: none;
    letter-spacing: 0.06em;
}

.auth-separator {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin: 0 3px;
    font-weight: 300;
}

/* Mobile auth buttons */
.mobile-auth-buttons {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 10px;
    padding-top: 10px;
}

.mobile-auth-btn {
    display: block;
    padding: 12px 0 !important;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0;
    color: white !important;
    text-decoration: none;
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin-bottom: 8px;
}

.mobile-auth-btn:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mobile-auth-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white !important;
    text-decoration: none;
    transform: none;
}

/* Remove flourish animation for mobile auth buttons */
.mobile-auth-btn::before {
    display: none !important;
}

.mobile-auth-btn::after {
    display: none !important;
}

/* ===== SHOP DROPDOWN STYLES ===== */
.shop-dropdown {
    position: relative;
    display: inline-block;
}

.shop-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.shop-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.shop-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 600px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    margin-top: 10px;
}

.shop-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content {
    display: flex;
    min-height: 300px;
}

.collections-side {
    flex: 1;
    padding: 30px;
    border-right: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 8px 0 0 8px;
}

.collections-side h3 {
    font-family: 'Playfair Display', serif;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 600;
}

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

.collections-list li {
    margin-bottom: 12px;
}

.collection-link {
    display: block;
    padding: 12px 16px;
    color: #6c757d !important;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 0.05em;
    border-radius: 5px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.collection-link:hover {
    background: white;
    color: #2c3e50 !important;
    border-left-color: #c9302c;
    transform: translateX(5px);
}

.collection-link.active {
    background: white;
    color: #c9302c !important;
    border-left-color: #c9302c;
    font-weight: 500;
}

/* Remove flourish animation for collection links */
.collection-link::before {
    display: none !important;
}

.collection-link::after {
    display: none !important;
}

.preview-side {
    flex: 1;
    position: relative;
    border-radius: 0 8px 8px 0;
    overflow: hidden;
}

.collection-preview {
    width: 100%;
    height: 100%;
    position: relative;
}

.collection-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 30px 25px 25px;
}

.preview-overlay h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.preview-overlay p {
    font-family: 'Crimson Text', serif;
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.9;
    line-height: 1.4;
}

/* ===== CART BUTTON STYLES ===== */
.cart-btn {
    color: white !important;
    text-decoration: none;
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

/* Remove flourish animation for cart button */
.cart-btn::before {
    display: none !important;
}

.cart-btn::after {
    display: none !important;
}

.cart-btn:hover {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    text-shadow: none;
}

/* Mobile cart button */
.mobile-cart-btn {
    display: block;
    padding: 12px 0 !important;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0;
    color: white !important;
    text-decoration: none;
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin-bottom: 8px;
}

.mobile-cart-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white !important;
    text-decoration: none;
    transform: none;
}

/* Remove flourish animation for mobile cart button */
.mobile-cart-btn::before {
    display: none !important;
}

.mobile-cart-btn::after {
    display: none !important;
}

/* Hide dropdown on mobile */
@media (max-width: 991.98px) {
    .shop-dropdown-menu {
        display: none;
    }
}

/* ===== AUTHENTICATION MODAL STYLES ===== */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.show {
    opacity: 1;
    visibility: visible;
}

.auth-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.auth-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px;
    border-bottom: 1px solid #eee;
}

.auth-modal-header h2 {
    font-family: 'Playfair Display', serif;
    color: #2c3e50;
    margin: 0;
    font-size: 1.5rem;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.auth-modal-close:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.auth-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-family: 'Crimson Text', serif;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #c9302c;
    box-shadow: 0 0 0 3px rgba(201, 48, 44, 0.1);
}

.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #c9302c 0%, #a02622 100%);
    color: white;
    border: none;
    padding: 15px;
    font-family: 'Cinzel', serif;
    font-weight: 500;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #a02622 0%, #8b1e1b 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(201, 48, 44, 0.3);
}

.auth-submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #6c757d;
    font-family: 'Crimson Text', serif;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #c9302c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-footer {
    padding: 0 30px 30px;
    text-align: center;
}

.auth-footer p {
    margin: 0;
    font-family: 'Crimson Text', serif;
    color: #6c757d;
}

.auth-footer a {
    color: #c9302c;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ===== ACCOUNT DROPDOWN STYLES ===== */
.account-dropdown {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    overflow: hidden;
    animation: dropdownFadeIn 0.3s ease;
}

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

.account-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.account-header strong {
    display: block;
    font-family: 'Playfair Display', serif;
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 4px;
}

.account-header small {
    color: #6c757d;
    font-family: 'Crimson Text', serif;
    font-size: 14px;
}

.account-links {
    padding: 10px 0;
}

.account-links a {
    display: block;
    padding: 12px 20px;
    color: #2c3e50;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.account-links a:hover {
    background: #f8f9fa;
    color: #c9302c;
}

.account-links hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #eee;
}

/* ===== NOTIFICATION STYLES ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #2c3e50;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    font-family: 'Crimson Text', serif;
    font-size: 14px;
    z-index: 10001;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

/* Mobile responsiveness for modals */
@media (max-width: 768px) {
    .auth-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .auth-modal-header,
    .auth-form,
    .auth-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

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