@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Fraunces:opsz,wght@9..144,300;400;600;700&display=swap');

:root {
    --color-midnight: #3E2723;
    /* Dark Brown */
    --color-gold: #D4AF37;
    --color-cream: #FFF8E1;
    --color-ivory: #FFF8E1;
    /* Unified with Cream */
    --color-sage: #A7C7B1;
    --color-brown: #795548;
    --color-black: #121212;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: var(--color-ivory);
    color: var(--color-black);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Fraunces', serif;
}

.bg-ivory {
    background-color: var(--color-ivory);
}

.bg-cream {
    background-color: var(--color-cream);
}

.theme-midnight {
    background-color: var(--color-midnight);
    color: white;
}

.theme-midnight h1,
.theme-midnight h2,
.theme-midnight h3 {
    color: var(--color-gold);
}

.theme-midnight p {
    color: rgba(255, 255, 255, 0.9);
}

.text-gold {
    color: var(--color-gold);
}

.bg-pastel-pink {
    background-color: var(--color-sage);
    /* Mapped to Sage */
}

.bg-pastel-blue {
    background-color: var(--color-brown);
    /* Mapped to Brown */
    color: white;
    /* Ensure contrast */
}

.bg-pastel-yellow {
    background-color: var(--color-gold);
    /* Mapped to Gold */
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes imageFadeInScale {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.slide-in {
    animation: slideInFromLeft 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.image-entrance {
    animation: imageFadeInScale 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.testimonials-section {
    background: linear-gradient(180deg, var(--bg-dark) 0%, #1a1a2e 100%);
    position: relative;
    overflow: hidden;
    contain: content;
}

/* Carousel styles */
.carousel-container {
    position: relative;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in-out, visibility 1.5s ease-in-out;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.carousel-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    will-change: opacity;
}

.carousel-slide:nth-child(2) img {
    /* Caribbean Spice Cake - zoom in slightly to crop purple edges */
    object-position: center;
    object-fit: cover;
    transform: scale(1.1);
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 20;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background-color: white;
    border-color: white;
    transform: scale(1.2);
}

/* Smooth hover transitions for all interactive elements */
button,
a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

/* Image hover effects - more pronounced */
img:not(.parallax-slow):not(.parallax-medium):not(.parallax-fast):hover {
    transform: scale(1.08);
}

/* Icon hover effects */
.icon-container:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.icon-container:hover svg {
    transform: scale(1.1);
}

/* Ingredient image hover - more pronounced */
.ingredient-image:not(.parallax-slow):not(.parallax-medium):not(.parallax-fast):hover {
    transform: scale(1.12);
    filter: brightness(1.05);
}

/* Navigation link hover */
nav a:not(.bg-black):hover {
    transform: translateY(-2px);
}

/* Parallax elements */
.parallax-slow {
    will-change: transform;
    transform: translateZ(0);
}

.parallax-medium {
    will-change: transform;
    transform: translateZ(0);
}

.parallax-fast {
    will-change: transform;
    transform: translateZ(0);
}

/* Mobile logo size reduction */
@media (max-width: 768px) {
    .logo-container img {
        height: 102px !important;
        /* 15% reduction from 120px */
    }

    /* Mobile headline size reduction - 20% smaller */
    .hero-headline {
        font-size: 2.4rem !important;
        /* 20% reduction from text-6xl (3rem) */
        line-height: 1.1 !important;
    }

    /* Mobile description size reduction - 20% smaller */
    .hero-description {
        font-size: 1rem !important;
        /* 20% reduction from text-xl (1.25rem) */
    }
}

/* FAQ Accordion Styles */
.faq-item button[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-item button[aria-expanded="true"] span {
    color: var(--color-gold);
}

/* Testimonial Card Hover Effects */
.testimonial-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    /* Global Spacing Reduction */
    section {
        padding-top: 5rem !important;
        padding-bottom: 5rem !important;
    }

    /* Typography Scaling */
    h1 {
        font-size: 3rem !important;
        line-height: 1.1 !important;
    }

    h2 {
        font-size: 2.5rem !important;
    }

    /* Hero Section Stacking */
    .hero-section .flex-col {
        flex-direction: column-reverse !important;
    }

    .hero-section .w-1\/2 {
        width: 100% !important;
    }

    .hero-section img {
        margin-top: 2rem;
        max-height: 400px;
        object-fit: cover;
    }

    /* Grid Stacking */
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Margin Calculator Mobile */
    .calculator-container {
        padding: 1.5rem !important;
    }

    input[type="range"] {
        height: 40px;
        /* Larger touch target */
    }
}

/* Accessibility Focus Styles */
:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* Sweet Numbers Section */
.sweet-numbers-card {
    border-left: 12px solid #E94E77;
    /* Pink accent */
    border-top: 12px solid #E94E77;
    padding: 2rem;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sweet-stat-number {
    font-family: 'Fraunces', serif;
    font-size: 8rem;
    line-height: 1;
    color: #D99A88;
    /* Pinkish Tan */
}

.sweet-stat-number-alt {
    font-family: 'Fraunces', serif;
    font-size: 8rem;
    line-height: 1;
    color: #D99A88;
}

/* Custom Arrow Graphics */
.arrow-graphic {
    position: relative;
    width: 100px;
    height: 100px;
}

.arrow-path {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Product Grid */
.product-card {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    transform: translateZ(0);
    /* Safari fix for overflow:hidden with border-radius */
    border-radius: 1.5rem;
}

.product-image-default,
.product-image-hover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease-in-out;
    border-radius: 1.5rem;
    /* Ensure images themselves are rounded */
}

.product-image-hover {
    opacity: 0;
}

.product-card:hover .product-image-default {
    opacity: 0;
}

.product-card:hover .product-image-hover {
    opacity: 1;
}