/* ============================================
   DON INACIO — ENCURTIDOS ARTESANALES STYLES
   ============================================ */

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

/* ============ VARIABLES ============ */
:root {
    --color-crema: #faf6f0;
    --color-arena: #f0e8d8;
    --color-tierra: #8b5e3c;
    --color-dorado: #c9963a;
    --color-dorado-claro: #e8b86d;
    --color-oscuro: #1a1209;
    --color-texto: #3d2b1a;
    --color-texto-suave: #7a5c42;
    --color-blanco: #ffffff;
    --color-verde-wa: #25D366;
    --color-verde-wa2: #128C7E;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Lora', Georgia, serif;

    --sombra-suave: 0 2px 12px rgba(139, 94, 60, 0.10);
    --sombra-media: 0 8px 30px rgba(139, 94, 60, 0.15);
    --sombra-fuerte: 0 20px 60px rgba(26, 18, 9, 0.30);

    --radio-sm: 8px;
    --radio-md: 16px;
    --radio-lg: 24px;

    --trans-rapida: 0.2s ease;
    --trans-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ RESET & BASE ============ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-crema);
    color: var(--color-texto);
    min-height: 100vh;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

/* ============ NAVBAR ============ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 4vw, 48px);
    background: transparent;
    transition: background var(--trans-normal), box-shadow var(--trans-normal);
}

.navbar.scrolled {
    background: rgba(26, 18, 9, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-logo img {
    height: 42px;
    width: auto;
    display: block;
    transition: opacity var(--trans-rapida);
}

.nav-logo img:hover {
    opacity: 0.85;
}

.nav-back-group {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    color: var(--color-blanco);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    transition: all var(--trans-rapida);
    background: rgba(255, 255, 255, 0.08);
}

.nav-back-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.nav-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.nav-btn-text {
    display: inline;
}

.nav-reservar {
    padding: 9px 22px;
    background: var(--color-dorado);
    color: var(--color-blanco);
    text-decoration: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: all var(--trans-rapida);
    box-shadow: 0 3px 12px rgba(201, 150, 58, 0.4);
}

.nav-reservar:hover {
    background: var(--color-dorado-claro);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 150, 58, 0.5);
}

/* ---- Nav right group ---- */
.nav-right-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- Language Switcher ---- */
.lang-switcher {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 7px 11px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.25s ease;
    background: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.lang-current:hover,
.lang-switcher.open .lang-current {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.lang-flag {
    font-size: 1rem;
    line-height: 1;
}

.lang-code {
    font-size: 0.7rem;
}

.lang-arrow {
    font-size: 0.95rem !important;
    transition: transform 0.25s ease;
}

.lang-switcher.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(20, 12, 3, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(200, 150, 42, 0.25);
    border-radius: 12px;
    padding: 6px;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1100;
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.18s ease;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    width: 100%;
    text-align: left;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.lang-option.active {
    background: rgba(200, 150, 42, 0.15);
    color: #e8b84b;
}

/* ============ HERO ============ */
.hero-section {
    position: relative;
    height: 100svh;
    min-height: 580px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 60%, rgba(201, 150, 58, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 30%, rgba(139, 94, 60, 0.15) 0%, transparent 50%),
        linear-gradient(160deg, #2a1e0f 0%, #1a1209 50%, #0f0a04 100%);
    z-index: 0;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(201, 150, 58, 0.12) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(26, 18, 9, 0.2) 0%, rgba(26, 18, 9, 0) 40%, rgba(26, 18, 9, 0.6) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 0 clamp(20px, 6vw, 80px);
    max-width: 760px;
}

.section-label {
    display: inline-block;
    padding: 5px 18px;
    border: 1px solid rgba(201, 150, 58, 0.6);
    border-radius: 50px;
    color: var(--color-dorado-claro);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 24px;
    background: rgba(201, 150, 58, 0.08);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    font-weight: 700;
    color: var(--color-blanco);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.hero-title em {
    font-style: italic;
    color: var(--color-dorado-claro);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 28px;
}

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 0 auto 28px;
    max-width: 260px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(201, 150, 58, 0.7));
}

.divider-line:last-child {
    background: linear-gradient(to left, transparent, rgba(201, 150, 58, 0.7));
}

.divider-ornament {
    color: var(--color-dorado);
    font-size: 0.9rem;
}

.hero-description {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.85;
    max-width: 600px;
    margin: 0 auto;
}

.hero-description strong {
    color: var(--color-dorado-claro);
    font-weight: 600;
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    animation: heroScroll 2s ease-in-out infinite;
}

.hero-scroll svg {
    width: 26px;
    height: 26px;
    stroke: rgba(255, 255, 255, 0.5);
}

@keyframes heroScroll {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.5;
    }

    50% {
        transform: translateX(-50%) translateY(6px);
        opacity: 1;
    }
}

/* ============ PRODUCTS SECTION ============ */
.products-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(40px, 6vw, 80px) clamp(16px, 4vw, 48px) 80px;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 52px;
    flex-wrap: wrap;
}

.breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-texto-suave);
    text-decoration: none;
    font-size: 0.82rem;
    font-family: var(--font-body);
    transition: color var(--trans-rapida);
}

.breadcrumb a:hover {
    color: var(--color-dorado);
}

.bc-icon {
    width: 13px;
    height: 13px;
}

.bc-sep {
    width: 14px;
    height: 14px;
    stroke: rgba(122, 92, 66, 0.4);
    flex-shrink: 0;
}

.breadcrumb span {
    font-size: 0.82rem;
    color: var(--color-dorado);
    font-family: var(--font-body);
    font-style: italic;
}

/* ---- Section header ---- */
.section-header {
    text-align: center;
    margin-bottom: 56px;
    padding-inline: 8px;
    /* FIX: protects text at 320-375px */
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4.5vw, 2.8rem);
    font-weight: 700;
    color: var(--color-oscuro);
    line-height: 1.2;
    margin-bottom: 14px;
}

.section-header h2 em {
    font-style: italic;
    color: var(--color-dorado);
}

.section-header p {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-texto-suave);
    font-style: italic;
}

/* ============ PRODUCTS GRID — 2 columnas ============ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

/* ============ PRODUCT CARD — vertical ============ */
.product-card {
    background: var(--color-blanco);
    border-radius: var(--radio-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--sombra-suave);
    border: 1px solid rgba(201, 150, 58, 0.12);
    cursor: pointer;
    transition: transform var(--trans-normal), box-shadow var(--trans-normal);
    opacity: 0;
    animation: fadeInUp 0.55s ease forwards;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--sombra-media);
}

.product-card.out-of-stock {
    opacity: 0.65;
    cursor: default;
}

.product-card.out-of-stock .product-image {
    filter: grayscale(0.45);
}

/* Image wrapper — cuadrada */
.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--color-arena);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-card:hover .product-image {
    transform: scale(1.06);
}

/* Badge agotado */
.out-of-stock-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: linear-gradient(135deg, #e03333, #a80000);
    color: white;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-body);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(224, 51, 51, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Product content */
.product-content {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-oscuro);
    line-height: 1.3;
    margin-bottom: 16px;
}

/* Footer: precio + CTA */
.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(201, 150, 58, 0.18);
}

.product-price {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--color-dorado);
    line-height: 1;
}

.product-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-tierra);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: gap var(--trans-rapida), color var(--trans-rapida);
    white-space: nowrap;
}

.product-cta svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform var(--trans-rapida);
}

.product-card:hover .product-cta {
    color: var(--color-dorado);
    gap: 10px;
}

.product-card:hover .product-cta svg {
    transform: translateX(3px);
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(26, 18, 9, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--trans-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    position: relative;
    background: var(--color-blanco);
    border-radius: var(--radio-lg);
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--sombra-fuerte);
    transform: translateY(24px) scale(0.97);
    transition: transform var(--trans-normal);
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-container::-webkit-scrollbar {
    width: 5px;
}

.modal-container::-webkit-scrollbar-thumb {
    background: var(--color-arena);
    border-radius: 4px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--color-arena);
    color: var(--color-tierra);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-rapida);
}

.modal-close:hover {
    background: var(--color-tierra);
    color: var(--color-blanco);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 16px;
    height: 16px;
}

/* Modal body: imagen izquierda + info derecha */
.modal-body {
    display: flex;
    flex-direction: row;
    min-height: 420px;
}

.modal-img-col {
    flex-shrink: 0;
    width: 320px;
    background: var(--color-arena);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-img-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-info-col {
    flex: 1;
    padding: 40px 36px 36px;
    display: flex;
    flex-direction: column;
}

.modal-label {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-dorado);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 700;
    color: var(--color-oscuro);
    line-height: 1.2;
    margin-bottom: 14px;
}

.modal-price {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-dorado);
    line-height: 1;
}

.modal-price-note {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-texto-suave);
    margin-top: 4px;
    margin-bottom: 20px;
    font-style: italic;
}

.modal-divider {
    height: 1px;
    background: linear-gradient(to right, rgba(201, 150, 58, 0.4), transparent);
    margin-bottom: 20px;
}

.modal-description {
    font-family: var(--font-body);
    font-size: 0.93rem;
    color: var(--color-texto-suave);
    line-height: 1.85;
    flex: 1;
    margin-bottom: 28px;
}

.modal-actions {
    margin-top: auto;
}

/* Botón WhatsApp */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 28px;
    background: linear-gradient(135deg, var(--color-verde-wa), var(--color-verde-wa2));
    color: var(--color-blanco);
    border: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--trans-normal);
    box-shadow: 0 5px 18px rgba(37, 211, 102, 0.35);
    white-space: nowrap;
}

.btn-whatsapp svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-whatsapp:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-verde-wa2), var(--color-verde-wa));
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
}

.btn-whatsapp:disabled,
.btn-whatsapp.disabled {
    background: linear-gradient(135deg, #aaa, #777);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

/* ============ SCROLL TO TOP ============ */
.scroll-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 900;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--color-dorado);
    color: var(--color-blanco);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(201, 150, 58, 0.45);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: all var(--trans-normal);
}

.scroll-top svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--color-dorado-claro);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(201, 150, 58, 0.55);
}

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

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

/* ============ RESPONSIVE ============ */

/* Tablet grande */
@media (max-width: 900px) {
    .products-grid {
        gap: 20px;
    }

    .modal-img-col {
        width: 260px;
    }

    .modal-info-col {
        padding: 32px 28px 28px;
    }
}

/* Modal se vuelve vertical */
@media (max-width: 680px) {
    .modal-body {
        flex-direction: column;
        min-height: unset;
    }

    .modal-img-col {
        width: 100%;
        /* FIX: was 420px */
        height: 240px;
        flex-shrink: 0;
    }

    .modal-img-col img {
        object-fit: cover;
        object-position: center;
    }

    .modal-info-col {
        padding: 28px 24px 24px;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .modal-price {
        font-size: 1.8rem;
    }

    .btn-whatsapp {
        width: 100%;
        justify-content: center;
    }
}

/* Móviles: 1 columna */
@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .product-image-wrapper {
        aspect-ratio: 4 / 3;
    }

    /* Navbar móvil: sin "Reservar Mesa" */
    .nav-reservar {
        display: none;
    }

    /* FIX: nav-back-group position:absolute collides with logo+lang-switcher at narrow screens */
    .nav-back-group {
        position: static;
        transform: none;
        left: auto;
    }

    .nav-back-btn {
        min-width: 44px;
        height: 44px;
        justify-content: center;
    }

    .nav-btn-text {
        display: inline;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .products-section {
        padding-left: 14px;
        padding-right: 14px;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .product-content {
        padding: 18px 16px 16px;
    }

    .product-name {
        font-size: 1.1rem;
    }

    .product-price {
        font-size: 1.5rem;
    }

    /* FIX: was 360px — too tall for 480px mobile screens; 220px gives a balanced preview */
    .modal-img-col {
        height: 220px;
    }

    .modal-info-col {
        padding: 22px 18px 20px;
    }

    .modal-price {
        font-size: 1.6rem;
    }

    .modal-description {
        font-size: 0.88rem;
    }

    .scroll-top {
        bottom: 18px;
        right: 18px;
        width: 40px;
        height: 40px;
    }
}