/* RESET */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

/* Tipografía */
body {
    font-family: "AvantGarde", "ITC Avant Garde Gothic", Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: #111;
}

/* ============================
   TOPBAR FIJA
============================ */
.topbar {
    width: 100%;
    background: #3a2d25;
    color: #fff;
    padding: 10px 20px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    font-size: 14px;
    letter-spacing: 0.5px;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3000;

    padding-top: calc(env(safe-area-inset-top) + 8px);
}

/* ============================
   MENÚ FIJO
============================ */
.menu-fixed {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 28px);
    left: 0;
    right: 0;
    z-index: 2500;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
}

/* ============================
   MENÚ ESCRITORIO (OCULTO)
============================ */
header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none !important;
}

/* ============================
   HAMBURGUESA
============================ */
.hamburger {
    display: block !important;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 20px;
}

/* ============================
   MENÚ MÓVIL
============================ */
.mobile-menu {
    display: none;
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-menu a {
    text-decoration: none;
    color: #111;
    font-size: 18px;
}

.mobile-menu.show {
    display: block;
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 600px) {
    header nav ul {
        display: none;
    }
    .hamburger {
        display: block;
    }
}

/* ============================
   ESPACIADO PARA SLIDER
============================ */
body {
    padding-top: calc(env(safe-area-inset-top) + 28px + 80px);
}

/* ============================
   SLIDER
============================ */
.slider {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;

    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.6);
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 50%;
    z-index: 10;
}

.arrow.left { left: 20px; }
.arrow.right { right: 20px; }

/* ============================
   GALERÍA
============================ */
.galeria {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.galeria img {
    width: 100%;
    border-radius: 8px;
}

/* ============================
   FOOTER
============================ */
footer {
    background: #3a2d25;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid #ddd;
    color: #fff;
}

.social {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-icon i {
    font-size: 22px;
    color: #fafafa;
    transition: 0.3s ease;
}

.social-icon i:hover {
    color: #ffffff;
    transform: scale(1.15);
}

.phone i {
    color: #fafafa;
    font-size: 20px;
    margin-right: 6px;
}

.autor a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.autor a:hover {
    text-decoration: underline;
}

html {
    scroll-behavior: smooth;
}

/* ============================
   GALERÍA PC (3 columnas)
============================ */
@media (min-width: 900px) {
    .galeria {
        max-width: 1200px;
        margin: 0 auto;
        padding: 40px 20px;

        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .galeria img {
        width: 100%;
        border-radius: 10px;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .galeria img:hover {
        transform: scale(150%);
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    }
}

/* ============================
   BANNERS
============================ */
.categoria-banner {
    grid-column: 1 / -1;
    width: 100%;
    margin: 40px 0 10px;
}

.categoria-banner img {
    width: 50%;
    border-radius: 12px;
}

@media (max-width: 899px) {
    .categoria-banner img {
        width: 100%;
    }
}

/* ============================
   SLIDER PC
============================ */
@media (min-width: 900px) {
    .slider {
        height: 880px;
    }

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

/* ============================
   ZOOM — VERSIÓN 100% REAL HEIGHT
============================ */

.zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh; /* ⭐ altura REAL del móvil */
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: calc(env(safe-area-inset-top) + 5px);
    overflow: hidden;
    z-index: 999999;
}

.zoom-modal.show {
    display: flex;
}

.zoom-modal img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 20px); /* ⭐ evita recorte inferior */
    object-fit: contain;
    touch-action: none;
    display: block;
    margin: auto;
}

.zoom-close {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 10px);
    right: 15px;
    z-index: 1000000;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 28px;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
}

/* ============================
   PRELOADER
============================ */
#preloader {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 999999999;
}

.preloader-content {
    text-align: center;
}

.preloader-img {
    width: 160px;
    margin-bottom: 25px;
    opacity: 0;
    animation: fadeIn 1s forwards, latido 1.4s ease-in-out infinite;
    transform-origin: center center;
}

.preloader-bar {
    width: 260px;
    height: 12px;
    background: #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
}

.preloader-progress {
    width: 0%;
    height: 100%;
    background: #3a2d25;
    transition: width 0.2s ease;
}

#preloaderPorcentaje {
    margin-top: 12px;
    font-size: 18px;
    font-weight: bold;
    color: #3a2d25;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes latido {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.08); }
    50%  { transform: scale(1); }
    75%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}
