/* ============================================
   B Street Bakery & Deli — Custom Styles
   Classic & Elegant | Emerald + Cream
   ============================================ */

/* --- Custom Properties --- */
:root {
    --color-emerald-950: #052e16;
    --color-emerald-900: #14532d;
    --color-emerald-800: #166534;
    --color-emerald-700: #15803d;
    --color-emerald-600: #16a34a;
    --color-cream-50: #fefdf8;
    --color-cream-100: #fdf9ee;
    --color-cream-200: #fbf3d9;
    --color-cream-300: #f7e9b8;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(22, 101, 52, 0.2);
    color: var(--color-emerald-950);
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-cream-100);
}
::-webkit-scrollbar-thumb {
    background: var(--color-emerald-300);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-emerald-500);
}

/* --- Navbar Transition States --- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* --- Hero Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-ornament {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.hero-eyebrow {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-headline {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.hero-sub {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

.hero-cta {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 1s;
    opacity: 0;
}

.hero-scroll {
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.4s;
    opacity: 0;
}

/* --- Scroll Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* --- About Section --- */
.about-image-container {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-image-container.revealed {
    opacity: 1;
    transform: translateX(0);
}

.about-text {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-text.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* --- Specialty Cards --- */
.specialty-card {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.specialty-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Gallery Items --- */
.gallery-item {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Mobile Menu --- */
#mobile-menu {
    transition: opacity 0.5s ease, pointer-events 0.5s ease;
}

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

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

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

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

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

/* --- Hamburger Animation --- */
.menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

#menu-btn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Navbar Background State --- */
.nav-scrolled {
    background: rgba(254, 253, 248, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(20, 83, 45, 0.08), 0 4px 20px rgba(20, 83, 45, 0.06);
}

.nav-scrolled .nav-logo-text {
    color: var(--color-emerald-900) !important;
}

.nav-scrolled .nav-logo-sub {
    color: var(--color-emerald-600) !important;
}

.nav-scrolled .nav-link {
    color: var(--color-emerald-800) !important;
}

/* --- Back to Top --- */
#back-to-top {
    transition: all 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

/* --- Form Styling --- */
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='%23166534' 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 1rem center;
    padding-right: 2.5rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .hero-headline {
        font-size: 2.75rem;
    }
}

@media (min-width: 768px) {
    .hero-headline {
        font-size: 4.5rem;
    }
}

@media (min-width: 1024px) {
    .hero-headline {
        font-size: 5.5rem;
    }
}

/* --- Print Styles --- */
@media print {
    nav, #back-to-top, #contact-form, #form-success {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .bg-emerald-900, .bg-emerald-800 {
        background: #166534 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
