/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --color-bg: #0a0a0a;
    --color-text: #f0f0f0;
    --color-primary: #d4a373;
    /* Gold/Bread crust */
    --color-secondary: #faedcd;
    /* Flour/Cream */
    --color-accent: #bc6c25;
    /* Deep baked color */

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 400;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: background-color 0.3s ease, padding 0.3s ease;
    mix-blend-mode: difference;
}

header.scrolled {
    background-color: rgba(10, 10, 10, 0.95);
    padding: var(--spacing-xs) var(--spacing-md);
    mix-blend-mode: normal;
    backdrop-filter: blur(10px);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--color-text);
}

nav ul {
    display: flex;
    gap: var(--spacing-md);
}

nav a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

nav a:hover {
    opacity: 1;
    color: var(--color-primary);
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    z-index: -1;
    transform: scale(1.1);
    /* For parallax effect */
    transition: transform 0.1s linear;
}

.hero-content {
    text-align: center;
    z-index: 1;
    padding: var(--spacing-md);
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease forwards 0.5s;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease forwards 0.8s;
}

/* Sections General */
section {
    padding: var(--spacing-xl) var(--spacing-md);
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.section-title span {
    display: block;
    font-family: var(--font-body);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

/* About / L'Obrador */
.about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.about-text p {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    color: #ccc;
}

.about-image {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.about-image img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

/* Gallery / Els Nostres Productes */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-sm);
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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


.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: all 0.4s ease;
}

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

.gallery-overlay h3 {
    font-size: 1.5rem;
    color: var(--color-primary);
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.product-desc {
    color: #ddd;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    transform: translateY(20px);
    transition: transform 0.4s 0.1s ease;
}

.gallery-item:hover .gallery-overlay h3,
.gallery-item:hover .product-desc {
    transform: translateY(0);
}


/* Footer */
footer {
    background-color: #050505;
    padding: var(--spacing-lg) var(--spacing-md);
    border-top: 1px solid #222;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.footer-col h4 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1.25rem;
}

.footer-col p {
    color: #888;
    margin-bottom: 0.5rem;
}

.social-links {
    margin-top: var(--spacing-sm);
    display: flex;
    gap: 1rem;
}

.copyright {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: #444;
    font-size: 0.8rem;
}

/* Animations */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: ALL 0.8s ease;
}

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

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background-color: var(--color-text);
    transition: all 0.3s ease;
}

/* Mobile Styles */
@media (max-width: 768px) {
    header {
        padding: var(--spacing-sm);
    }

    .mobile-menu-btn {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--color-bg);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: right 0.4s ease;
        z-index: 999;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-lg);
    }

    nav a {
        font-size: 1.5rem;
    }

    /* Burger Animation */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

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

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    /* Layout Adjustments */
    .hero h1 {
        font-size: 3rem;
    }

    .about {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
        /* Image first on mobile */
        max-height: 400px;
    }

    .about-image img {
        height: 100%;
        object-fit: cover;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    section {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .section-title {
        font-size: 2.5rem;
    }
}