/* ============================================================
   === Global Spacing & Responsive ===
   Origen: Astra Hook 461150 "Global Spacing Responsive v1 - 2026-04-17"
   wp_head priority 1100 — migrado al child theme 2026-04-29
   ------------------------------------------------------------
   Goal: reduce excessive whitespace + fluid responsive padding/margins
   ============================================================ */

/* --- Force light color scheme (defeats Chrome "Force Dark Mode") --- */
html,
body {
    color-scheme: light only !important;
    forced-color-adjust: none;
}
html { background-color: #ffffff !important; }
body { background-color: #ffffff !important; }

/* --- Tokens fluidos globales -------------------------------- */
:root {
    --ucn-gutter-x: clamp(12px, 3vw, 32px);
    --ucn-section-y: clamp(24px, 5vw, 56px);
    --ucn-block-y: clamp(16px, 3vw, 32px);
    --ucn-stack: clamp(8px, 1.5vw, 16px);
    --ucn-container-max: 1240px;
}

/* --- Contenedor principal Astra -----------------------------
   Excluye plantillas personalizadas (home-native, page-servicio, page-servicios)
   que gestionan su propio layout full-bleed. */
body:not(.page-template-home-native):not(.page-template-home-native-v2):not(.page-template-page-servicio):not(.page-template-page-servicio-php):not(.page-template-page-servicios):not(.page-template-page-servicios-php) .ast-container,
body:not(.page-template-home-native):not(.page-template-home-native-v2):not(.page-template-page-servicio):not(.page-template-page-servicio-php):not(.page-template-page-servicios):not(.page-template-page-servicios-php) .site-content > .ast-container,
body:not(.page-template-home-native):not(.page-template-home-native-v2):not(.page-template-page-servicio):not(.page-template-page-servicio-php):not(.page-template-page-servicios):not(.page-template-page-servicios-php) #content > .ast-container {
    max-width: min(100%, var(--ucn-container-max)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--ucn-gutter-x) !important;
    padding-right: var(--ucn-gutter-x) !important;
    box-sizing: border-box;
}

/* --- Reducir padding vertical excesivo en #content ---------- */
body #content,
body .site-content {
    padding-top: clamp(8px, 2vw, 24px) !important;
    padding-bottom: clamp(12px, 2.5vw, 28px) !important;
}

/* --- Entry header/content spacing --------------------------- */
body .entry-header {
    margin-bottom: var(--ucn-block-y) !important;
    padding-top: clamp(8px, 1.5vw, 16px) !important;
    padding-bottom: 0 !important;
}
body .entry-content { margin-top: 0 !important; }
body .entry-content > * + * { margin-top: var(--ucn-stack); }

/* --- WooCommerce pages: tighter spacing --------------------- */
body.woocommerce .site-content,
body.woocommerce-page .site-content {
    padding-top: clamp(8px, 1.5vw, 20px) !important;
}
body.woocommerce ul.products,
body.woocommerce-page ul.products {
    margin-top: clamp(12px, 2vw, 24px) !important;
    margin-bottom: clamp(12px, 2vw, 24px) !important;
}
body.woocommerce .woocommerce-result-count,
body.woocommerce .woocommerce-ordering {
    margin-bottom: clamp(8px, 1.5vw, 16px) !important;
}

/* --- Headings: jerarquía fluida ----------------------------- */
body h1.entry-title {
    font-size: clamp(1.6rem, 3.2vw, 2.4rem) !important;
    line-height: 1.15 !important;
    margin-top: 0 !important;
    margin-bottom: clamp(8px, 1.5vw, 16px) !important;
}
body .entry-content h2 {
    font-size: clamp(1.3rem, 2.4vw, 1.8rem) !important;
    margin-top: clamp(16px, 3vw, 32px) !important;
    margin-bottom: clamp(8px, 1.2vw, 14px) !important;
    line-height: 1.2 !important;
}
body .entry-content h3 {
    font-size: clamp(1.1rem, 1.8vw, 1.4rem) !important;
    margin-top: clamp(12px, 2vw, 22px) !important;
    margin-bottom: clamp(6px, 1vw, 10px) !important;
}

/* --- Párrafos y listas: interlineado cómodo ----------------- */
body .entry-content p,
body .entry-content li {
    line-height: 1.55;
}
body .entry-content p {
    margin-top: 0 !important;
    margin-bottom: clamp(10px, 1.5vw, 16px) !important;
}
body .entry-content ul,
body .entry-content ol {
    margin-top: 0 !important;
    margin-bottom: clamp(10px, 1.5vw, 16px) !important;
    padding-left: clamp(20px, 3vw, 32px) !important;
}

/* --- Footer spacing compacto -------------------------------- */
body .site-footer {
    padding-top: clamp(20px, 3vw, 40px) !important;
    padding-bottom: clamp(16px, 2.5vw, 32px) !important;
}

/* --- Breadcrumbs: menos margen ------------------------------ */
body .ast-breadcrumbs-wrapper,
body nav.woocommerce-breadcrumb {
    margin-bottom: clamp(8px, 1.5vw, 16px) !important;
    padding-top: clamp(4px, 1vw, 10px) !important;
}

/* --- Formularios: spacing consistente ----------------------- */
body form .form-row,
body .wpcf7-form p {
    margin-bottom: clamp(10px, 1.5vw, 16px) !important;
}

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

/* Tablet: 768-1023 */
@media (min-width: 768px) and (max-width: 1023.98px) {
    body .ast-container { max-width: 100% !important; }
}

/* Phablet/Mobile: 600-767 */
@media (min-width: 600px) and (max-width: 767.98px) {
    :root {
        --ucn-gutter-x: 14px;
        --ucn-section-y: 24px;
        --ucn-block-y: 16px;
    }
    body .entry-header { padding-top: 8px !important; }
}

/* Mobile pequeño: <=599 */
@media (max-width: 599.98px) {
    :root {
        --ucn-gutter-x: 12px;
        --ucn-section-y: 20px;
        --ucn-block-y: 14px;
        --ucn-stack: 10px;
    }
    body #content,
    body .site-content {
        padding-top: 8px !important;
        padding-bottom: 12px !important;
    }
    body h1.entry-title { font-size: 1.5rem !important; }
    body .entry-content h2 { font-size: 1.25rem !important; }
    body .entry-content h3 { font-size: 1.08rem !important; }
}

/* Mobile muy pequeño: <=380 */
@media (max-width: 380px) {
    :root {
        --ucn-gutter-x: 10px;
        --ucn-section-y: 16px;
    }
    body h1.entry-title { font-size: 1.35rem !important; }
}

/* Previene overflow horizontal en todo el sitio */
body { overflow-x: hidden; }
body img,
body video,
body iframe {
    max-width: 100%;
    height: auto;
}
/* === /Global Spacing & Responsive === */
