/* ===== Custom Styles for Nakahara Grocery Store ===== */

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

body {
    overflow-x: hidden;
}

/* ===== Animations ===== */

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scrollIndicator {
    0% {
        top: -16px;
        opacity: 1;
    }
    100% {
        top: 48px;
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Hero Animations */
.hero-eyebrow {
    animation: fadeInLeft 0.8s ease forwards;
    animation-delay: 0.3s;
}

.hero-headline {
    animation: fadeInUp 0.9s ease forwards;
    animation-delay: 0.5s;
}

.hero-subtitle {
    animation: fadeInUp 0.9s ease forwards;
    animation-delay: 0.7s;
}

.hero-ctas {
    animation: fadeInUp 0.9s ease forwards;
    animation-delay: 0.9s;
}

.hero-scroll {
    animation: fadeInUp 0.9s ease forwards;
    animation-delay: 1.3s;
}

.scroll-indicator {
    animation: scrollIndicator 1.5s ease-in-out infinite;
}

/* Scroll-triggered Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }

/* ===== Section Labels ===== */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c8956c;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.section-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, #c8956c, transparent);
}

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

#navbar.scrolled {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(200, 149, 108, 0.08);
}

/* ===== Hero ===== */
#hero {
    position: relative;
}

#hero-img {
    transition: transform 8s ease;
}

#hero:hover #hero-img {
    transform: scale(1.02);
}

/* ===== Product Cards ===== */
.product-card {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.5s ease,
                border-color 0.5s ease;
}

.product-card:hover {
    box-shadow: 0 20px 60px -20px rgba(200, 149, 108, 0.15);
}

/* ===== Section Animations ===== */
.about-images {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-images.visible {
    opacity: 1;
    transform: translateX(0);
}

.about-text > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.about-text.visible > * {
    opacity: 1;
    transform: translateY(0);
}

.about-text.visible > *:nth-child(1) { transition-delay: 0.1s; }
.about-text.visible > *:nth-child(2) { transition-delay: 0.2s; }
.about-text.visible > *:nth-child(3) { transition-delay: 0.3s; }
.about-text.visible > *:nth-child(4) { transition-delay: 0.4s; }
.about-text.visible > *:nth-child(5) { transition-delay: 0.5s; }
.about-text.visible > *:nth-child(6) { transition-delay: 0.6s; }

.products-header {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.products-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, 
                box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.5s ease;
}

.product-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-card:nth-child(1) { transition-delay: 0.05s; }
.product-card:nth-child(2) { transition-delay: 0.1s; }
.product-card:nth-child(3) { transition-delay: 0.15s; }
.product-card:nth-child(4) { transition-delay: 0.2s; }
.product-card:nth-child(5) { transition-delay: 0.25s; }
.product-card:nth-child(6) { transition-delay: 0.3s; }

.fresh-text > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fresh-text.visible > * {
    opacity: 1;
    transform: translateY(0);
}

.fresh-text.visible > *:nth-child(1) { transition-delay: 0.1s; }
.fresh-text.visible > *:nth-child(2) { transition-delay: 0.2s; }
.fresh-text.visible > *:nth-child(3) { transition-delay: 0.3s; }
.fresh-text.visible > *:nth-child(4) { transition-delay: 0.4s; }
.fresh-text.visible > *:nth-child(5) { transition-delay: 0.5s; }

.fresh-image {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fresh-image.visible {
    opacity: 1;
    transform: translateX(0);
}

.visit-header {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.visit-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.visit-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.visit-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.visit-info > * {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.visit-info.visible > * {
    opacity: 1;
    transform: translateX(0);
}

.visit-info.visible > *:nth-child(1) { transition-delay: 0.1s; }
.visit-info.visible > *:nth-child(2) { transition-delay: 0.2s; }
.visit-info.visible > *:nth-child(3) { transition-delay: 0.3s; }

.contact-text > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.contact-text.visible > * {
    opacity: 1;
    transform: translateY(0);
}

.contact-text.visible > *:nth-child(1) { transition-delay: 0.1s; }
.contact-text.visible > *:nth-child(2) { transition-delay: 0.2s; }
.contact-text.visible > *:nth-child(3) { transition-delay: 0.3s; }
.contact-text.visible > *:nth-child(4) { transition-delay: 0.4s; }

.contact-form-wrapper {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.contact-form-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Back to Top ===== */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

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

#back-to-top:hover {
    transform: translateY(-2px);
}

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

/* ===== Utility ===== */
.glass {
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ===== Selection ===== */
::selection {
    background: rgba(200, 149, 108, 0.3);
    color: #f5f5f5;
}

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

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

    .hero-headline span:nth-child(3) {
        font-size: 1.75rem;
    }
}

@media (max-width: 640px) {
    .hero-headline {
        font-size: 2rem;
    }

    .hero-headline span:nth-child(3) {
        font-size: 1.5rem;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
