/* ============================================
   La Morcilla Serrana de Burgos
   Custom Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

body {
    font-family: 'Nunito', system-ui, sans-serif;
    line-height: 1.7;
    color: #0f1a2e;
    -webkit-font-smoothing: antialiased;
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* --- Container --- */
.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Section Headers --- */
.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #38a16b;
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: #0f1a2e;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.section-desc {
    font-size: 1.1rem;
    color: #527096;
    max-width: 600px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 4rem;
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #5ebf8e, #38a16b);
    color: #fff;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(94, 191, 142, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(94, 191, 142, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: #fff;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #5ebf8e;
    color: #5ebf8e;
    transform: translateY(-2px);
}

/* --- Mobile Header --- */
.mobile-header {
    display: none;
}

/* --- Mobile Menu --- */
.mobile-menu-overlay {
    display: none;
}

.mobile-menu-content {
    display: none;
}

.mobile-nav-link {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    color: #d0dbe8;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: #5ebf8e;
    background: rgba(94, 191, 142, 0.1);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
}

.hero-bg {
    position: absolute;
    inset: 0;
}

.hero-img {
    object-fit: cover;
}

.hero-gradient {
    background: linear-gradient(
        135deg,
        rgba(8, 15, 26, 0.95) 0%,
        rgba(15, 26, 46, 0.85) 50%,
        rgba(22, 38, 61, 0.8) 100%
    );
}

.hero-content {
    max-width: 48rem;
}

.hero-badge {
    animation: fadeInDown 0.8s ease-out;
}

.hero-content h2 {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-content p {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-content .flex {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-stats {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.hero-scroll {
    animation: fadeInUp 0.8s ease-out 1s both;
}

.hero-scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, #5ebf8e, transparent);
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0%, 100% { opacity: 0; transform: scaleY(0); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
}

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

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

/* --- Products Section --- */
.section-products {
    position: relative;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.product-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 26, 46, 0.06);
    transition: all 0.4s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(15, 26, 46, 0.12);
}

.product-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3/2;
}

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

.product-card:hover .product-img {
    transform: scale(1.08);
}

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #5ebf8e, #38a16b);
    color: #fff;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f1a2e;
    margin-bottom: 0.5rem;
}

.product-desc {
    font-size: 0.9rem;
    color: #527096;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.product-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #38a16b;
    transition: all 0.2s ease;
}

.product-link:hover {
    color: #247a4e;
    gap: 0.75rem;
}

/* --- Tradition Section --- */
.section-tradicion {
    position: relative;
}

.tradicion-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.tradicion-images {
    position: relative;
}

.tradicion-img-main {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(15, 26, 46, 0.15);
}

.tradicion-img-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 7/9;
}

.tradicion-img-float {
    position: absolute;
    bottom: -2rem;
    right: -1rem;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(15, 26, 46, 0.2);
    border: 4px solid #f0f4f8;
    max-width: 280px;
}

.tradicion-img-float-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tradicion-content {
    position: relative;
    z-index: 1;
}

.tradicion-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    color: #0f1a2e;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.tradicion-text {
    font-size: 1rem;
    color: #527096;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.tradicion-feature {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tradicion-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e1f5eb, #c3eald);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38a16b;
}

.tradicion-feature-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f1a2e;
}

.tradicion-feature-text {
    font-size: 0.85rem;
    color: #527096;
    line-height: 1.5;
}

/* --- Gallery Section --- */
.section-gallery {
    position: relative;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
}

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

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

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8, 15, 26, 0.7) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-overlay span {
    color: #fff;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
}

/* --- Contact Section --- */
.section-contact {
    position: relative;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.contact-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(94, 191, 142, 0.3);
    transform: translateX(4px);
}

.contact-card-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #5ebf8e, #38a16b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.contact-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.contact-card-text {
    font-size: 0.9rem;
    color: #a3b8d6;
    line-height: 1.6;
}

.contact-card-link {
    font-size: 0.9rem;
    color: #5ebf8e;
    transition: color 0.2s ease;
}

.contact-card-link:hover {
    color: #95dbb5;
}

/* --- Contact Form --- */
.contact-form-wrap {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #d0dbe8;
    letter-spacing: 0.02em;
}

.form-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    width: 100%;
}

.form-input::placeholder {
    color: #7695c4;
}

.form-input:focus {
    border-color: #5ebf8e;
    background: rgba(94, 191, 142, 0.08);
    box-shadow: 0 0 0 3px rgba(94, 191, 142, 0.15);
}

.form-select {
    appearance: none;
    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='%237695c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-select option {
    background: #0f1a2e;
    color: #fff;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #5ebf8e, #38a16b);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(94, 191, 142, 0.3);
    width: 100%;
}

.btn-form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(94, 191, 142, 0.4);
}

.btn-form-submit svg {
    transition: transform 0.3s ease;
}

.btn-form-submit:hover svg {
    transform: translate(4px, -4px);
}

/* Success Message */
.form-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    gap: 1rem;
}

.form-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5ebf8e, #38a16b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.form-success-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.form-success-text {
    font-size: 0.95rem;
    color: #a3b8d6;
}

.hidden {
    display: none !important;
}

/* --- Footer --- */
.footer {
    position: relative;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5ebf8e, #38a16b);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-icon span {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #0f1a2e;
}

.footer-logo-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.footer-logo-tagline {
    font-size: 0.8rem;
    color: #5ebf8e;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-text {
    font-size: 0.9rem;
    color: #7695c4;
    line-height: 1.7;
}

.footer-heading {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #d0dbe8;
    margin-bottom: 1rem;
}

.footer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-link {
    font-size: 0.9rem;
    color: #7695c4;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.footer-link:hover {
    color: #5ebf8e;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* --- Sidebar --- */
.sidebar {
    background: #0f1a2e;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #a3b8d6;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
    color: #5ebf8e;
    background: rgba(94, 191, 142, 0.12);
}

.sidebar-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active svg,
.sidebar-link:hover svg {
    opacity: 1;
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    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; }

/* --- Responsive: Tablet --- */
@media (min-width: 768px) {
    .mobile-header {
        display: none;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tradicion-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 250px;
    }

    .gallery-item--large {
        grid-row: span 2;
    }

    .gallery-item--wide {
        grid-column: span 2;
    }

    .contact-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* --- Responsive: Desktop --- */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 220px;
    }
}

/* --- Responsive: Mobile Menu --- */
@media (max-width: 767px) {
    .mobile-header {
        display: block;
    }

    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 40;
    }

    .mobile-menu-overlay.open {
        display: block;
    }

    .mobile-menu-bg {
        position: absolute;
        inset: 0;
    }

    .mobile-menu-content {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
    }

    .mobile-nav-link {
        display: block;
    }

    main {
        padding-top: 0;
    }
}

/* --- Utility --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
