/* ===== Custom Styles for Ma Belle Sweets ===== */

/* Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0A1628;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #C9A84C, #1A8B6A);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #D4AF61, #22A872);
}

/* Selection */
::selection {
    background: rgba(201, 168, 76, 0.3);
    color: #E8D5A3;
}

/* ===== Navbar ===== */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(4, 11, 20, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(201, 168, 76, 0.1);
}

/* Nav link underline animation */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #C9A84C, #6FD1A8);
    transition: width 0.3s ease;
}

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

/* Mobile menu animations */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

#mobileMenu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }
#mobileMenu.open .mobile-link:nth-child(6) { transition-delay: 0.35s; }

/* Hamburger animation */
#menuToggle.active #bar1 {
    transform: translateY(5px) rotate(45deg);
}

#menuToggle.active #bar2 {
    opacity: 0;
    transform: scaleX(0);
}

#menuToggle.active #bar3 {
    transform: translateY(-5px) rotate(-45deg);
}

/* ===== Hero ===== */
@keyframes scroll-down {
    0% { top: -16px; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 48px; opacity: 0; }
}

.animate-scroll-down {
    animation: scroll-down 1.5s ease-in-out infinite;
}

/* ===== Menu Tabs ===== */
.menu-tab {
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    border: none;
    cursor: pointer;
}

.menu-tab.active {
    background: linear-gradient(135deg, #C9A84C, #D4AF61);
    color: #0A1628;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
}

.menu-tab:not(.active):hover {
    color: #E8D5A3;
    background: rgba(255, 255, 255, 0.05);
}

/* Menu content transition */
.menu-content {
    animation: fadeSlideIn 0.4s ease forwards;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Reveal Animations ===== */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-up.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal-left {
        opacity: 0;
        transform: translateX(-40px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-left.revealed {
        opacity: 1;
        transform: translateX(0);
    }

    .reveal-right {
        opacity: 0;
        transform: translateX(40px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-right.revealed {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Buttons ===== */
button, a[type="submit"] {
    cursor: pointer;
}

/* ===== Gold gradient text utility ===== */
.text-gold-gradient {
    background: linear-gradient(135deg, #E8D5A3, #C9A84C, #B8943F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Focus styles ===== */
:focus-visible {
    outline: 2px solid #C9A84C;
    outline-offset: 2px;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 767px) {
    html {
        scroll-padding-top: 70px;
    }
}

/* ===== Image aspect ratios ===== */
img {
    max-width: 100%;
    height: auto;
}
