/* Fondos globales — pro (internas) + hero (solo inicio) */

:root {
    --mx-pro-bg: #0b0f18;
    --mx-pro-bg-mid: #0f1628;
    --mx-pro-bg-deep: #080b12;
}

body.modern-ui {
    background: var(--mx-pro-bg) !important;
}

body.modern-ui.has-site-bg {
    background: var(--mx-pro-bg) !important;
}

/* —— Capa base (todas las páginas modern-ui) —— */
.site-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.site-bg--pro {
    background: var(--mx-pro-bg);
}

.site-bg-pro-base {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        168deg,
        var(--mx-pro-bg-deep) 0%,
        var(--mx-pro-bg) 38%,
        var(--mx-pro-bg-mid) 72%,
        var(--mx-pro-bg) 100%
    );
}

.site-bg-pro-accent {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 85% 42% at 50% -8%, rgba(59, 130, 246, 0.11) 0%, transparent 58%),
        radial-gradient(ellipse 38% 28% at 100% 92%, rgba(6, 182, 212, 0.06) 0%, transparent 52%),
        radial-gradient(ellipse 32% 24% at 0% 75%, rgba(59, 130, 246, 0.05) 0%, transparent 48%);
}

.site-bg-pro-grid {
    position: absolute;
    inset: 0;
    opacity: 0.55;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 75% 55% at 50% 12%, black 10%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 12%, black 10%, transparent 72%);
}

/* —— Capa hero (solo portada, encima del pro) —— */
.site-bg--hero {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    bottom: auto;
    background: #000;
    will-change: transform;
    transition: transform 0.15s ease-out;
    mask-image: linear-gradient(to bottom, #000 0%, #000 68%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 68%, transparent 100%);
}

.site-bg--hero .hero-landing-grid,
.site-bg--hero .hero-landing-stars,
.site-bg--hero .hero-landing-mist,
.site-bg--hero .hero-landing-horizon {
    position: absolute;
}

body.modern-ui main,
body.modern-ui footer,
body.modern-ui .auth-header {
    position: relative;
    z-index: 1;
}

body.modern-ui > header {
    z-index: 1000;
}

body.modern-ui.has-site-bg .hero-landing,
body.modern-ui.has-site-bg .hero-sm {
    background: transparent !important;
    border: none !important;
}

body.modern-ui.has-site-bg .section,
body.modern-ui.has-site-bg section.section-alt,
body.modern-ui.has-site-bg .section.section-dark {
    background: transparent !important;
}

body.modern-ui.auth-page main {
    background: transparent;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .site-bg--hero .hero-landing-grid {
        animation: none !important;
    }

    .site-bg--hero .hero-landing-stars {
        animation: none !important;
        opacity: 0.75;
    }

    .site-bg--hero .hero-landing-mist {
        animation: none !important;
    }
}

/* —— Tarjetas y paneles (páginas internas sobre fondo pro) —— */

body.modern-ui.has-site-bg:not(.page-home) {
    --mx-elevated-bg: linear-gradient(
        165deg,
        rgba(30, 40, 68, 0.98) 0%,
        rgba(18, 26, 48, 0.97) 100%
    );
    --mx-elevated-border: rgba(255, 255, 255, 0.12);
    --mx-elevated-shadow:
        0 10px 36px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --mx-elevated-shadow-hover:
        0 18px 52px rgba(0, 0, 0, 0.52),
        0 0 0 1px rgba(59, 130, 246, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.modern-ui.has-site-bg:not(.page-home) .uiverse-card,
body.modern-ui.has-site-bg:not(.page-home) .card,
body.modern-ui.has-site-bg:not(.page-home) .feature,
body.modern-ui.has-site-bg:not(.page-home) .process-step,
body.modern-ui.has-site-bg:not(.page-home) .review-summary,
body.modern-ui.has-site-bg:not(.page-home) .review-form,
body.modern-ui.has-site-bg:not(.page-home) .review-item,
body.modern-ui.has-site-bg:not(.page-home) .summary-card,
body.modern-ui.has-site-bg:not(.page-home) .cart-item,
body.modern-ui.has-site-bg:not(.page-home) .catalog-intro,
body.modern-ui.has-site-bg:not(.page-home) .catalog-header-bar,
body.modern-ui.has-site-bg:not(.page-home) .mini-categories-wrapper,
body.modern-ui.has-site-bg:not(.page-home) .service-card,
body.modern-ui.has-site-bg:not(.page-home) .service-card-pro,
body.modern-ui.has-site-bg:not(.page-home) .catalog-page .product-card:not(.product-card--catalog),
body.modern-ui.has-site-bg:not(.page-home) .contact-card,
body.modern-ui.has-site-bg:not(.page-home) .contact-map-card,
body.modern-ui.has-site-bg:not(.page-home) .checkout-form-card,
body.modern-ui.has-site-bg:not(.page-home) .checkout-summary-card,
body.modern-ui.has-site-bg:not(.page-home) .order-card,
body.modern-ui.has-site-bg:not(.page-home) .pedido-card,
body.modern-ui.has-site-bg:not(.page-home) .auth-form-card,
body.modern-ui.has-site-bg:not(.page-home) .auth-card,
body.modern-ui.has-site-bg:not(.page-home) .auth-form--sheet,
body.modern-ui.has-site-bg:not(.page-home) .auth-panel,
body.modern-ui.has-site-bg:not(.page-home) .auth-shell {
    background: var(--mx-elevated-bg) !important;
    border-color: var(--mx-elevated-border) !important;
    box-shadow: var(--mx-elevated-shadow) !important;
}

body.modern-ui.has-site-bg:not(.page-home) .uiverse-card:hover,
body.modern-ui.has-site-bg:not(.page-home) .card:hover,
body.modern-ui.has-site-bg:not(.page-home) .process-step:hover,
body.modern-ui.has-site-bg:not(.page-home) .catalog-page .product-card:not(.product-card--catalog):hover,
body.modern-ui.has-site-bg:not(.page-home) .contact-card:hover,
body.modern-ui.has-site-bg:not(.page-home) .service-card-pro:hover,
body.modern-ui.has-site-bg:not(.page-home) .cart-item:hover,
body.modern-ui.has-site-bg:not(.page-home) .order-card:hover {
    border-color: rgba(96, 165, 250, 0.28) !important;
    box-shadow: var(--mx-elevated-shadow-hover) !important;
}

/* Inicio: sección «Por qué elegirnos» sobre fondo pro */
body.modern-ui.page-home.has-site-bg .why-card {
    background: linear-gradient(
        165deg,
        rgba(30, 40, 68, 0.98) 0%,
        rgba(18, 26, 48, 0.97) 100%
    ) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow:
        0 10px 36px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.modern-ui.has-site-bg:not(.page-home) .catalog-summary {
    background: rgba(14, 20, 38, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-radius: 14px !important;
}

body.modern-ui.has-site-bg:not(.page-home) .product-thumb,
body.modern-ui.has-site-bg:not(.page-home) .cart-item-thumb {
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.modern-ui.has-site-bg:not(.page-home) .group .input,
body.modern-ui.has-site-bg:not(.page-home) .search-input,
body.modern-ui.has-site-bg:not(.page-home) .catalog-header-bar .input,
body.modern-ui.has-site-bg:not(.page-home) .checkout-field input,
body.modern-ui.has-site-bg:not(.page-home) .checkout-field select,
body.modern-ui.has-site-bg:not(.page-home) .checkout-field textarea,
body.modern-ui.has-site-bg:not(.page-home) .auth-field input {
    background: rgba(8, 12, 24, 0.65) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Texto legible en todo el sitio con fondo oscuro */
body.modern-ui.has-site-bg:not(.admin-app) {
    color: #ffffff;
}

body.modern-ui.has-site-bg:not(.admin-app) input,
body.modern-ui.has-site-bg:not(.admin-app) select,
body.modern-ui.has-site-bg:not(.admin-app) textarea {
    color: #ffffff !important;
}

body.modern-ui.has-site-bg:not(.admin-app) input::placeholder,
body.modern-ui.has-site-bg:not(.admin-app) textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}
