/**
 * Overrides - Prioridad máxima sobre todos los temas.
 * Se carga al final para garantizar que layout y secciones se apliquen en todas las plantillas.
 * No modificar layout estructural aquí; los temas solo definen identidad visual.
 */
/* Hero: texto centrado verticalmente en altura (todas las plantillas) */
body .hero,
body .hero-carousel-section {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
body .hero .hero-content {
    flex: 0 1 auto !important;
}
/* Hero: cuando la sección está en "center", debe ganar sobre cualquier tema */
body .hero .hero-content.hero-content-center:not(.hero-content-left):not(.hero-content-right),
body .hero-carousel-section .hero-content.hero-content-center:not(.hero-content-left):not(.hero-content-right) {
    align-items: center !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
body .hero .hero-content.hero-content-center:not(.hero-content-left):not(.hero-content-right) .hero-title,
body .hero .hero-content.hero-content-center:not(.hero-content-left):not(.hero-content-right) .hero-subtitle,
body .hero-carousel-section .hero-content.hero-content-center:not(.hero-content-left):not(.hero-content-right) .hero-title,
body .hero-carousel-section .hero-content.hero-content-center:not(.hero-content-left):not(.hero-content-right) .hero-subtitle {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
/* Neutraliza desplazamientos verticales de algunos temas/configs previas */
body .hero.hero-vertical-top,
body .hero.hero-vertical-bottom,
body .hero-carousel-section.hero-vertical-top,
body .hero-carousel-section.hero-vertical-bottom {
    align-items: center !important;
    justify-content: center !important;
    padding-top: 48px !important;
    padding-bottom: 48px !important;
}
/* Hero: mantener nitidez al escalar fondos en pantallas grandes */
body .hero,
body .hero-carousel .carousel-slide {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
}
/* Tipografía por sección: la configuración de la sección tiene la última palabra */
body .section-font-inter, body .section-font-inter * { font-family: "Inter", sans-serif !important; }
body .section-font-poppins, body .section-font-poppins * { font-family: "Poppins", sans-serif !important; }
body .section-font-playfair-display, body .section-font-playfair-display * { font-family: "Playfair Display", serif !important; }
body .section-font-roboto, body .section-font-roboto * { font-family: "Roboto", sans-serif !important; }
body .section-font-open-sans, body .section-font-open-sans * { font-family: "Open Sans", sans-serif !important; }
body .section-font-montserrat, body .section-font-montserrat * { font-family: "Montserrat", sans-serif !important; }
body .section-font-lato, body .section-font-lato * { font-family: "Lato", sans-serif !important; }
body .section-font-nunito, body .section-font-nunito * { font-family: "Nunito", sans-serif !important; }
body .section-font-dm-sans, body .section-font-dm-sans * { font-family: "DM Sans", sans-serif !important; }
body .section-font-plus-jakarta-sans, body .section-font-plus-jakarta-sans * { font-family: "Plus Jakarta Sans", sans-serif !important; }
/* Fondo por sección: prioridad final sobre temas con !important */
body .section-has-custom-bg {
    background: var(--section-bg) !important;
}
/* Header: grid 3 columnas para que el menú quede centrado en la página (home, categoría, etc.) */
body .site-header.store-header .container.header-wrapper {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: var(--container-width, 1200px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}
/* Logo: columna izquierda, alineado al inicio */
body .site-header.store-header .logo {
    grid-column: 1 !important;
    justify-self: start !important;
    flex-shrink: 0 !important;
    max-width: 320px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
}
body .site-header.store-header .logo a { display: flex !important; align-items: center; max-width: 100%; height: 100%; min-height: 64px; }
body .site-header.store-header .logo a img.logo-img {
    height: 64px !important;
    width: auto !important;
    max-height: 64px !important;
    max-width: 100% !important;
    object-fit: contain !important;
    object-position: left center !important;
    display: block !important;
}
/* Menú desktop: columna central, siempre centrado en la página (Inicio, Alojamientos, Contacto, etc.) */
body .site-header.store-header .desktop-nav {
    grid-column: 2 !important;
    justify-self: center !important;
    min-width: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}
body .site-header.store-header .desktop-nav ul {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* Iconos (búsqueda, etc.): columna derecha */
body .site-header.store-header .header-icons {
    grid-column: 3 !important;
    justify-self: end !important;
    flex-shrink: 0 !important;
}
.categories-header { padding: 24px 0 10px !important; margin-bottom: 0 !important; }
.categories-header h1 { font-size: 1.75rem; margin: 0 0 6px 0 !important; }
.categories-header p { margin: 0; font-size: 0.95rem; }
/* Espacios: página Tienda y página producto (sin hueco entre menú y contenido) */
.category-page-content { padding-top: 0 !important; margin-top: 0 !important; }
.category-page-content.section { padding-top: 0 !important; margin-top: 0 !important; }
body .category-page-content.section,
body .category-page-content { padding-top: 0 !important; margin-top: 0 !important; }
/* Breadcrumb en una línea, compacto */
.product-breadcrumb { margin: 0 0 2px 0 !important; padding: 0 !important; font-size: 0.7rem !important; line-height: 1.2 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; display: flex !important; flex-wrap: nowrap !important; align-items: center !important; }
.product-breadcrumb a, .product-breadcrumb span { display: inline !important; white-space: nowrap !important; }
.product-breadcrumb .product-category { min-width: 0 !important; overflow: hidden !important; text-overflow: ellipsis !important; }
/* Página producto: sin espacio arriba */
.product-detail-wrapper.section { padding-top: 0 !important; }
.product-detail-wrapper { padding-top: 0 !important; margin-top: 0 !important; }
body .product-detail-wrapper.section,
body .product-detail-wrapper { padding-top: 0 !important; margin-top: 0 !important; }
/* Móvil: logo al centro, lupa y carrito a la derecha */
@media (max-width: 768px) {
    body .site-header.store-header .container.header-wrapper {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 12px;
    }
    body .site-header.store-header .mobile-menu-toggle { grid-column: 1; justify-self: start; display: flex !important; align-items: center; justify-content: center; }
    body .site-header.store-header .logo { grid-column: 2; justify-self: center; max-width: 220px; }
    body .site-header.store-header .logo a { min-height: 52px; }
    body .site-header.store-header .desktop-nav { display: none !important; visibility: hidden !important; }
    body .site-header.store-header .desktop-nav ul { display: none !important; }
    body .site-header.store-header .header-icons { grid-column: 3; justify-self: end; display: flex !important; align-items: center; gap: 12px; margin-left: 0 !important; }
    body .site-header.store-header .logo a img.logo-img { height: 52px !important; max-height: 52px !important; width: auto !important; max-width: 100% !important; }
}
/* ===== LAYOUT SECCIONES MÓVIL: prioridad sobre temas/config ===== */
.features-section.features {
    margin-top: 0 !important;
    margin-bottom: 24px !important;
    padding-top: 48px !important;
    padding-bottom: 56px !important;
    isolation: isolate;
    z-index: auto !important;
}
.features-section .feature-card:hover,
.feature-card:hover {
    transform: translateY(-4px) !important;
}
/* Features: 4 columnas desktop, 2x2 móvil (prioridad sobre temas) */
@media (min-width: 769px) {
    body .features-section .features-grid,
    body .features-section.features .features-grid,
    body .features .features-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
    }
}
/* Móvil: features 2x2, flujo horizontal, about 3 cols, galería carrusel visible */
@media (max-width: 768px) {
    body .features-section .features-grid,
    body .features-section.features .features-grid,
    body .features .features-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    body .flujo-reserva-section { padding: 28px 12px 36px !important; }
    body .flujo-reserva-steps {
        flex-direction: row !important;
        justify-content: center !important;
        gap: 8px !important;
    }
    body .flujo-step-card {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 12px 8px !important;
    }
    body .flujo-reserva-arrow { display: none !important; }
    body .about-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    body .about-stats .stat-item { padding: 10px 8px !important; }
    body .gallery-section.gallery-carousel-wrap {
        opacity: 1 !important;
        min-height: 200px !important;
    }
    body .gallery-section.gallery-carousel-wrap .gallery-carousel { min-height: 200px !important; }
    body .gallery-section.gallery-carousel-wrap .gallery-carousel .gallery-item {
        width: 260px !important;
        height: 180px !important;
    }
}
/* Contenedor página producto: centrado en todos los sitios */
body .container.product-detail-wrapper,
body .product-detail-wrapper.container {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: var(--container-width, 1280px) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
/* Sección "También te puede interesar": centrada y ancho completo */
.related-products-section {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
    display: block !important;
}
.related-products-section .section-title {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
}
.related-products-section .products-grid {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 1rem !important;
}
/* Sitio desplegado: evitar que las secciones y el contenido se achiquen respecto al preview del editor */
body:not(.in-editor-preview) .page-content,
body:not(.in-editor-preview) main {
    min-width: 100%;
}
body:not(.in-editor-preview) .section {
    min-height: 1px;
}

/* Accesibilidad: respetar preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .related-products-carousel { scroll-behavior: auto; }
}
