/* ========================================
   Martizz Bakery — Custom Styles
   ======================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    overflow-x: hidden;
}

::selection {
    background-color: #7B2D3B;
    color: #FFFBF7;
}

/* ========================================
   Navigation
   ======================================== */
#navbar {
    background: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

#navbar.scrolled {
    background: rgba(255, 251, 247, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(123, 45, 59, 0.08);
}

.nav-text {
    transition: color 0.3s ease;
}

#navbar:not(.scrolled) .nav-text {
    color: #7B2D3B;
}

#navbar.scrolled .nav-link {
    color: #5E4332;
}

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

#mobile-menu.open .mobile-link {
    animation: fadeUp 0.4s ease forwards;
    opacity: 1;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#mobile-menu-btn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

#mobile-menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    width: 20px;
}

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

/* ========================================
   Hero Animations
   ======================================== */
.hero-shape {
    animation: float 6s ease-in-out infinite;
}

.shape-circle-1 {
    animation-delay: 0s;
    animation-duration: 8s;
}

.shape-circle-2 {
    animation-delay: -2s;
    animation-duration: 7s;
}

.shape-rect-1 {
    animation-delay: -4s;
    animation-duration: 9s;
}

.shape-triangle {
    animation-delay: -1s;
    animation-duration: 10s;
}

.shape-dot {
    animation-delay: -3s;
    animation-duration: 5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(3deg);
    }
}

/* ========================================
   Menu Cards
   ======================================== */
.menu-card {
    transform: translateY(0);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(123, 45, 59, 0.2);
}

/* ========================================
   Gallery
   ======================================== */
.gallery-item {
    cursor: pointer;
    transition: transform 0.4s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(123, 45, 59, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* ========================================
   Testimonials
   ======================================== */
.testimonial-card {
    transform: translateY(0);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.testimonial-card:hover {
    transform: translateY(-6px);
}

/* ========================================
   Scroll Reveal Animations
   (Progressive Enhancement — content visible without JS)
   ======================================== */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

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

    /* These start visible; JS adds the 'revealed' class for animation */
    .reveal-up {
        opacity: 1;
        transform: translateY(30px);
    }

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

    .reveal-left {
        opacity: 1;
        transform: translateX(-30px);
    }

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

    .reveal-right {
        opacity: 1;
        transform: translateX(30px);
    }

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

    .reveal-scale {
        opacity: 1;
        transform: scale(0.95);
    }

    .reveal-scale.revealed {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fallback: if JS doesn't run, all content is visible */
.no-js .reveal-up,
.no-js .reveal-left,
.no-js .reveal-right,
.no-js .reveal-scale {
    opacity: 1;
    transform: none;
}

/* ========================================
   Form Styles
   ======================================== */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235E4332' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ========================================
   Smooth Scroll Offset for Fixed Nav
   ======================================== */
[id] {
    scroll-margin-top: 80px;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    #hero h1 {
        font-size: 3rem;
    }

    .menu-card {
        margin: 0 -0.5rem;
    }

    #visit .grid > div:last-child {
        height: 350px;
    }
}

@media (max-width: 480px) {
    #hero h1 {
        font-size: 2.5rem;
    }

    .font-display.text-5xl {
        font-size: 2.25rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    #navbar,
    .hero-shape,
    #mobile-menu {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    a {
        color: #7B2D3B;
    }
}
