/* ============================================
   DON INACIO — MERMELADAS PAGE
   Inherits design system tokens & style
   ============================================ */

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

/* ---- DESIGN TOKENS (mirror de index) ---- */
:root {
    --gold: #c8962a;
    --gold-light: #e8b84b;
    --gold-pale: #f5e6c0;
    --cream: #faf6ee;
    --dark: #1a1208;
    --dark-mid: #2c1e0a;
    --text: #3a2e1a;
    --text-muted: #7a6a50;
    --white: #ffffff;
    --nav-h: 64px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- RESET ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--cream);
    color: var(--text);
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 900;
    transition: background 0.4s ease, box-shadow 0.4s ease;
    background: linear-gradient(to bottom, rgba(20, 10, 2, 0.9) 0%, rgba(20, 10, 2, 0.75) 100%);
    /* FIX: safe-area-inset for devices with notch/home indicator */
    padding-left: max(40px, env(safe-area-inset-left));
    padding-right: max(40px, env(safe-area-inset-right));
}

.navbar.scrolled {
    background: rgba(20, 12, 3, 0.97);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.nav-logo img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(200, 150, 42, 0.3));
    transition: transform 0.3s var(--ease-spring);
}

.nav-logo img:hover {
    transform: scale(1.06);
}

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

.nav-back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-back-btn:hover {
    color: var(--gold-light);
    border-color: rgba(200, 150, 42, 0.4);
    background: rgba(200, 150, 42, 0.1);
}

.nav-back-btn .material-symbols-outlined {
    font-size: 1rem;
}

.nav-reservar {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--dark);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 9px 20px;
    border-radius: 40px;
    transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
    white-space: nowrap;
}

.nav-reservar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 150, 42, 0.4);
}

/* ---- 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: var(--gold-light);
}


.subpage-hero {
    position: relative;
    min-height: 62vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--dark);
}

/* Decorative gradient background (no image needed) */
.subpage-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 30% 40%, rgba(200, 150, 42, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 70%, rgba(200, 100, 42, 0.12) 0%, transparent 55%),
        linear-gradient(135deg, #1a1208 0%, #2c1e0a 50%, #1a1208 100%);
    pointer-events: none;
}

/* Subtle texture lines */
.subpage-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(0deg,
            transparent,
            transparent 40px,
            rgba(200, 150, 42, 0.03) 40px,
            rgba(200, 150, 42, 0.03) 41px);
    pointer-events: none;
}

.subpage-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 10, 2, 0.25);
    pointer-events: none;
}

.subpage-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 120px 24px 80px;
    max-width: 760px;
    margin: 0 auto;
}

.section-label {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-light);
    background: rgba(200, 150, 42, 0.12);
    border: 1px solid rgba(200, 150, 42, 0.35);
    padding: 5px 16px;
    border-radius: 40px;
    margin-bottom: 22px;
}

.subpage-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.subpage-hero-title em {
    font-style: italic;
    color: var(--gold-light);
}

.hero-divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0 auto 24px;
    border-radius: 2px;
}

.subpage-hero-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.85;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

.subpage-hero-scroll {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.35);
    animation: bounce 2.2s ease-in-out infinite;
}

.subpage-hero-scroll .material-symbols-outlined {
    font-size: 1.8rem;
}

@keyframes bounce {

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

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

/* ============================================
   MAIN PRODUCTOS AREA
   ============================================ */
.productos-main {
    max-width: 1380px;
    margin: 0 auto;
    padding: 60px 40px 100px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    /* FIX: flex-wrap prevents horizontal overflow on mobile when many breadcrumb items */
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 52px;
    /* FIX: overflow-x hidden as safety net */
    overflow-x: hidden;
}

.breadcrumb a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.breadcrumb .material-symbols-outlined {
    font-size: 1rem;
    color: var(--gold);
}

.bc-sep {
    font-size: 0.9rem;
    color: rgba(122, 106, 80, 0.4);
}

/* Section header */
.productos-section-header {
    text-align: center;
    margin-bottom: 56px;
    /* FIX: padding-inline protects text from touching viewport edges on 320-375px screens */
    padding-inline: 8px;
}

.productos-section-header h2 {
    font-family: 'Playfair Display', serif;
    /* FIX: improved clamp — lower minimum (1.5rem) to prevent orphaned words at 320-375px,
       middle value uses svw units for finer linear scaling */
    font-size: clamp(1.5rem, 3.5vw + 0.5rem, 2.8rem);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
    line-height: 1.2;
}

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

.productos-section-header p {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.75;
}

/* ============================================
   PRODUCTOS GRID
   ============================================ */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
}

/* ---- CARD ---- */
.producto-card {
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(200, 150, 42, 0.1);
    box-shadow: 0 4px 20px rgba(58, 46, 26, 0.07);
    cursor: pointer;
    transition: transform 0.35s var(--ease-spring), box-shadow 0.35s ease, border-color 0.3s;
    animation: cardIn 0.5s var(--ease-out) backwards;
}

.producto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 48px rgba(200, 150, 42, 0.18);
    border-color: rgba(200, 150, 42, 0.35);
}

.producto-card.sin-stock {
    opacity: 0.72;
    cursor: default;
}

.producto-card.sin-stock:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(58, 46, 26, 0.1);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

/* Card image */
.card-img-wrap {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: var(--cream);
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s var(--ease-out);
}

.producto-card:hover .card-img-wrap img {
    transform: scale(1.07);
}

.card-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 18, 8, 0.45) 0%, transparent 55%);
    transition: opacity 0.3s;
}

.producto-card.sin-stock .card-img-overlay {
    background: rgba(26, 18, 8, 0.3);
}

.card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--dark);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 40px;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.card-badge.agotado {
    background: linear-gradient(135deg, #5a4a3a, #3a2e1a);
    color: rgba(255, 255, 255, 0.7);
}

/* Card body */
.card-body {
    padding: 22px 22px 20px;
}

.card-nombre {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.4;
    margin-bottom: 14px;
    /* Clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* FIX: use min-height based on line-height (1.4) × 2 lines = 2.8em, expressed in em
       to naturally follow the element's own font-size rather than a fixed 3em */
    min-height: 2.8em;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--gold-pale);
}

.card-precio {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.card-cta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    transition: gap 0.2s, color 0.2s;
}

.card-cta .material-symbols-outlined {
    font-size: 0.95rem;
}

.producto-card:hover .card-cta {
    gap: 8px;
    color: var(--gold-light);
}

/* ============================================
   PRODUCT MODAL
   ============================================ */
.product-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 2, 0.82);
    backdrop-filter: blur(8px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease;
}

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

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

.product-modal {
    position: relative;
    background: var(--white);
    border-radius: 22px;
    max-width: 860px;
    width: 100%;
    max-height: 90dvh;
    overflow-y: auto;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(30px);
    transition: transform 0.4s var(--ease-out);
    border-top: 3px solid var(--gold);
}

.product-modal::-webkit-scrollbar {
    width: 4px;
}

.product-modal::-webkit-scrollbar-thumb {
    background: var(--gold);
}

.product-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.07);
    border-radius: 50%;
    color: var(--text);
    z-index: 10;
    transition: background 0.2s, transform 0.25s, color 0.2s;
}

.product-modal-close:hover {
    background: #e53935;
    color: #fff;
    transform: rotate(90deg);
}

.product-modal-close .material-symbols-outlined {
    font-size: 1.2rem;
}

.product-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
}

/* Left — image */
.modal-img-col {
    position: relative;
    background: var(--cream);
    border-radius: 22px 0 0 22px;
    overflow: hidden;
    min-height: 380px;
}

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

.modal-img-col::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(200, 150, 42, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* Right — info */
.modal-info-col {
    padding: 40px 36px 36px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.modal-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 12px;
}

.modal-nombre {
    font-family: 'Playfair Display', serif;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
    margin-bottom: 10px;
}

.modal-precio {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.modal-divider {
    height: 1px;
    background: var(--gold-pale);
    margin-bottom: 20px;
}

.modal-descripcion {
    font-size: 0.88rem;
    line-height: 1.85;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 28px;
}

.modal-acciones {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

/* WhatsApp button */
.btn-wsp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    border-radius: 40px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.35);
    transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
    border: none;
    cursor: pointer;
}

.btn-wsp:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(37, 211, 102, 0.5);
}

.btn-wsp .wsp-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

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

.btn-wsp.disabled:hover {
    transform: none;
}

/* ============================================
   SCROLL TO TOP
   ============================================ */
.scroll-top {
    position: fixed;
    /* FIX: safe-area-inset for devices with home indicator at bottom */
    bottom: max(24px, env(safe-area-inset-bottom, 24px));
    right: max(24px, env(safe-area-inset-right, 24px));
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(200, 150, 42, 0.9);
    color: var(--dark);
    border-radius: 50%;
    z-index: 800;
    box-shadow: 0 4px 16px rgba(200, 150, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s var(--ease-spring);
}

.scroll-top.visible {
    opacity: 1;
    pointer-events: all;
}

.scroll-top:hover {
    transform: translateY(-3px) scale(1.08);
}

.scroll-top .material-symbols-outlined {
    font-size: 1.2rem;
}

/* ============================================
   RESPONSIVE — Reescrito tras auditoría
   Breakpoints (desktop-first, acumulativo):
   1200 → 1024 → 900 → 768 → 600 → 480 → 360
   ============================================ */

/* ── 1200px: large desktop subtle tweaks ── */
@media (max-width: 1200px) {
    .productos-main {
        max-width: 100%;
        padding: 60px 32px 100px;
    }

    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 28px;
    }
}

/* ── 1024px: tablet landscape / small desktop ── */
@media (max-width: 1024px) {
    .navbar {
        padding: 0 28px;
    }

    .productos-main {
        padding: 56px 28px 90px;
    }

    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 24px;
    }

    .card-img-wrap {
        height: 220px;
    }

    /* FIX: smaller top-padding at 1024 avoids content being pushed below fold */
    .subpage-hero-content {
        padding: 100px 24px 70px;
    }
}

/* ── 900px: tablet portrait ── */
@media (max-width: 900px) {

    /* FIX: collapse modal to single column so image + text both fit */
    .product-modal-body {
        grid-template-columns: 1fr;
    }

    .modal-img-col {
        height: 280px;
        border-radius: 22px 22px 0 0;
        /* FIX: unset min-height so the column collapses to declared height */
        min-height: unset;
    }

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

    .modal-nombre {
        font-size: 1.35rem;
    }
}

/* ── 768px: large mobile / small tablet ── */
@media (max-width: 768px) {
    .navbar {
        /* FIX: safe-area-inset override for narrower screens */
        padding: 0 16px;
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    /* FIX: nav-back-group uses position:absolute which can collide with logo+lang-switcher
       at <768px. Switch to static flow so it fills space naturally within flex parent. */
    .nav-back-group {
        position: static;
        transform: none;
        left: auto;
    }

    /* Hide text labels, keep icon-only buttons for compact navbar */
    .nav-back-btn span:not(.material-symbols-outlined) {
        display: none;
    }

    .nav-back-btn {
        padding: 8px 10px;
        /* FIX: ensure 44px minimum touch target */
        min-width: 44px;
        height: 44px;
        justify-content: center;
    }

    /* FIX: hide reservar CTA to save space */
    .nav-reservar {
        display: none;
    }

    .productos-main {
        padding: 40px 16px 80px;
    }

    .productos-section-header {
        margin-bottom: 40px;
    }

    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .card-img-wrap {
        height: 200px;
    }

    /* FIX: reduce hero top-padding so content is fully visible above the fold on mobile */
    .subpage-hero-content {
        padding: 88px 20px 52px;
    }

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

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

/* ── 600px: medium mobile ── */
@media (max-width: 600px) {

    /* FIX: add intermediate breakpoint — 768→480 gap was too wide */
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }

    .card-img-wrap {
        height: 190px;
    }

    /* FIX: tighter card body padding when in 2-col layout at ~600px */
    .card-body {
        padding: 18px 18px 16px;
    }

    .modal-img-col {
        height: 240px;
    }

    /* FIX: step down font-size for section header before clamp bottoms out */
    .productos-section-header h2 {
        font-size: 1.7rem;
    }

    .subpage-hero-content {
        padding: 80px 20px 48px;
    }
}

/* ── 480px: standard mobile ── */
@media (max-width: 480px) {
    .navbar {
        gap: 6px;
    }

    .nav-back-group {
        gap: 4px;
    }

    /* Force single column: cards are too narrow for 2-col at <480px */
    .productos-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .card-img-wrap {
        height: 220px;
    }

    .card-body {
        padding: 20px 20px 16px;
    }

    .product-modal-overlay {
        padding: 10px;
    }

    /* FIX: was 420px — far too tall on small screens, leaving no room for text.
       240px gives a comfortable image preview without eating modal space. */
    .modal-img-col {
        height: 240px;
    }

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

    .modal-nombre {
        font-size: 1.2rem;
    }

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

    .modal-descripcion {
        font-size: 0.85rem;
    }

    /* FIX: WhatsApp button full-width for easy tapping (>44px height guaranteed) */
    .btn-wsp {
        width: 100%;
        padding: 14px 20px;
    }

    .subpage-hero {
        /* FIX: landscape safety — min-height reduced so hero doesn't consume full screen */
        min-height: 50vh;
    }

    .subpage-hero-content {
        padding: 76px 20px 44px;
    }

    .breadcrumb {
        font-size: 0.72rem;
        gap: 4px;
    }

    /* FIX: safe-area-inset for scroll-top at standard mobile sizes */
    .scroll-top {
        bottom: max(16px, env(safe-area-inset-bottom, 16px));
        right: max(16px, env(safe-area-inset-right, 16px));
    }
}

/* ── 360px: small phones (Samsung Galaxy A, Moto G, etc.) ── */
@media (max-width: 360px) {
    .navbar {
        padding: 0 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    /* FIX: logo shrinks slightly to prevent collision at 360px */
    .nav-logo img {
        height: 32px;
    }

    .productos-main {
        padding: 32px 14px 72px;
    }

    /* FIX: section header explicit font-size — clamp bottoms at ~1.5rem,
       but at 360px we want 1.4rem so the h2 stays on 1–2 compact lines */
    .productos-section-header h2 {
        font-size: 1.4rem;
    }

    .productos-section-header p {
        font-size: 0.88rem;
    }

    .card-img-wrap {
        height: 200px;
    }

    .card-body {
        padding: 16px;
    }

    .card-nombre {
        font-size: 1.15rem;
    }

    .card-precio {
        font-size: 1.4rem;
    }

    .subpage-hero-content {
        padding: 72px 16px 40px;
    }

    .section-label {
        font-size: 0.6rem;
        letter-spacing: 0.15em;
    }

    /* FIX: modal overlay padding reduced so modal uses max available width */
    .product-modal-overlay {
        padding: 8px;
    }

    .modal-img-col {
        height: 200px;
    }

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

    .modal-nombre {
        font-size: 1.1rem;
    }

    .modal-precio {
        font-size: 1.45rem;
    }

    /* FIX: WhatsApp button full-width with min 44px height for touch accessibility */
    .btn-wsp {
        width: 100%;
        min-height: 44px;
        padding: 12px 16px;
        font-size: 0.82rem;
    }

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

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}