/* ============================================
   Minga's Dulceria — Custom Styles
   ============================================ */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(123, 45, 59, 0.15);
    color: #7B2D3B;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FDF8F4;
}
::-webkit-scrollbar-thumb {
    background: #d4a8b0;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #7B2D3B;
}

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

#navbar.scrolled {
    background: rgba(253, 248, 244, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(123, 45, 59, 0.08);
}

.nav-link {
    position: relative;
}

/* Mobile Menu */
#mobile-menu {
    z-index: 50;
}

#mobile-menu.open {
    opacity: 1 !important;
    pointer-events: all !important;
}

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

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

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

/* Menu Toggle Animation */
#menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
#menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#menu-toggle.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ============================================
   Hero Animations
   ============================================ */
.hero-anim {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-anim.animated {
    opacity: 1;
    transform: translateY(0);
}

.hero-anim:nth-child(1) { transition-delay: 0.1s; }
.hero-anim:nth-child(2) { transition-delay: 0.25s; }
.hero-anim:nth-child(3) { transition-delay: 0.4s; }
.hero-anim:nth-child(4) { transition-delay: 0.55s; }

.hero-img-anim {
    opacity: 0;
    transform: translateX(32px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-img-anim.animated {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   Scroll Reveal
   ============================================ */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* For reduced motion preference, ensure content is always visible */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .hero-anim,
    .hero-img-anim {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    img {
        transition: none;
    }
}

/* ============================================
   Buttons & Links
   ============================================ */
a {
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
}

/* ============================================
   Menu Cards
   ============================================ */
#menu .border-b {
    border-color: rgba(237, 212, 184, 0.6);
}

#menu ul li:last-child {
    border-bottom: none !important;
    padding-bottom: 0;
}

/* ============================================
   Form Styles
   ============================================ */
#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    border-color: #7B2D3B;
    box-shadow: 0 0 0 3px rgba(123, 45, 59, 0.08);
}

#contact-form button[type="submit"] {
    position: relative;
    overflow: hidden;
}

#contact-form button[type="submit"]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#contact-form button[type="submit"]:hover::after {
    opacity: 1;
}

/* ============================================
   Image Hover Effects
   ============================================ */
.gallery-img {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-img:hover {
    transform: scale(1.03);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 767px) {
    .hero-img-anim {
        margin-top: 2rem;
    }
    
    #hero {
        min-height: auto;
        padding: 8rem 0 4rem;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #hero {
        padding-top: 6rem;
    }
}

/* ============================================
   Utility / Misc
   ============================================ */
.gap-16 > * {
    break-inside: avoid;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #7B2D3B;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    #navbar,
    #menu-toggle,
    #mobile-menu {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
