/* ============================================================
   CAPA VISUAL "PREMIUM"
   Se carga al final. Respeta los colores de web_config.
   Para volver al diseño anterior, quitar su <link> en layout.php.
   ============================================================ */
:root {
    --font-display: 'Plus Jakarta Sans', var(--font-sans);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;
    --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .04);
    --shadow-lg: 0 24px 48px -18px rgba(15, 23, 42, .24), 0 4px 12px rgba(15, 23, 42, .05);
    --brand-glow: color-mix(in srgb, var(--fm-blue) 38%, transparent);
}

body {
    background:
        radial-gradient(1100px 520px at 100% 0, color-mix(in srgb, var(--fm-blue) 6%, transparent), transparent 70%),
        radial-gradient(900px 600px at 0 30%, color-mix(in srgb, var(--fm-orange) 6%, transparent), transparent 70%),
        var(--surface-sunken);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: color-mix(in srgb, var(--fm-orange) 30%, transparent);
}

/* — Cabecera translúcida — */
.navbar.bg-white {
    border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent) !important;
    box-shadow: 0 8px 28px -20px rgba(15, 23, 42, .35);
}

/* Solo en escritorio: en móvil el desenfoque rompe la posición fija del menú. */
@media (min-width: 992px) {
    .navbar.bg-white {
        background: color-mix(in srgb, var(--surface) 86%, transparent) !important;
        backdrop-filter: saturate(180%) blur(14px);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
    }
}

.navbar .brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -.03em;
    max-width: 240px;
    color: var(--color-texto-principal);
}

.nav-search input {
    border-radius: var(--radius-pill);
    min-height: 46px;
}

.nav-search input:focus {
    background: var(--surface);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--fm-blue) 14%, transparent);
}

.nav-search .nav-search__submit,
.navbar .btn-nav-link {
    border-radius: var(--radius-pill);
}

.navbar .cart-btn {
    border-radius: 14px;
    box-shadow: 0 8px 18px -8px var(--brand-glow);
}

/* — Hero — */
.slide-overlay {
    background: linear-gradient(90deg, rgba(4, 12, 24, .72) 0%, rgba(4, 12, 24, .34) 45%, transparent 75%);
}

.slide-title {
    font-size: clamp(1.75rem, 4.2vw, 3.5rem);
    letter-spacing: -.035em;
}

.slide-cta {
    border-radius: var(--radius-pill);
    box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--fm-orange) 70%, transparent);
}

#hero-carousel .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border: 0;
    border-radius: 999px;
    transition: width .3s var(--ease-out), opacity .2s;
}

#hero-carousel .carousel-indicators .active {
    width: 28px;
}

/* — Accesos directos del inicio — */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    padding: 0 .75rem;
    margin: 1.25rem 0 .25rem;
    position: relative;
    z-index: 3;
}

#hero-carousel + .container-xl > .quick-links {
    margin-top: -1.75rem;
    padding-inline: 1.5rem;
}

.quick-links__item {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--text);
    transition: transform .25s var(--ease-out), box-shadow .25s, border-color .25s;
}

.quick-links__item:hover {
    color: var(--text);
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--fm-blue) 35%, var(--border));
    box-shadow: var(--shadow-lg);
}

.quick-links__icon {
    flex: 0 0 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--fm-blue) 11%, var(--surface));
    color: var(--primario-legible);
    font-size: 1.05rem;
    transition: background-color .25s, color .25s;
}

.quick-links__item:hover .quick-links__icon {
    background: var(--fm-blue);
    color: var(--on-primario);
}

.quick-links__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.3;
}

.quick-links__copy strong {
    font-family: var(--font-display);
    font-size: .98rem;
}

.quick-links__copy small {
    color: var(--text-muted);
}

.quick-links__arrow {
    color: var(--primario-legible);
    opacity: .45;
    transition: transform .25s var(--ease-out), opacity .25s;
}

.quick-links__item:hover .quick-links__arrow {
    transform: translateX(4px);
    opacity: 1;
}

/* — Títulos de sección — */
.sec-title {
    font-size: clamp(1.35rem, 1.4vw + 1rem, 1.85rem);
    letter-spacing: -.03em;
}

.sec-title .sec-dot {
    width: 6px;
    height: 1.35em;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--fm-blue), var(--fm-orange));
}

.featured-section__view-all {
    padding: .4rem .95rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: .85rem;
    transition: border-color .2s, box-shadow .2s;
}

.featured-section__view-all:hover {
    border-color: var(--primario-legible);
    box-shadow: var(--shadow-md);
}

/* — Tarjetas de producto — */
.prod-card {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.prod-card:hover {
    transform: translateY(-6px);
}

/* Fondo blanco: las fotos de producto se integran sin recuadros. */
.prod-img {
    background: #fff;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.1rem;
}

.prod-img img {
    mix-blend-mode: multiply;
}

.prod-card:hover .prod-img img {
    transform: scale(1.08);
}

.prod-body {
    padding: .95rem 1rem 1rem;
}

.prod-brand {
    text-transform: uppercase;
    letter-spacing: .08em;
}

.prod-actions .add-btn,
.prod-actions .prod-tool-btn,
.add-btn--lg {
    border-radius: var(--radius-pill);
}

.add-btn.btn-fm-orange:not(.add-btn--disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -10px color-mix(in srgb, var(--fm-orange) 75%, transparent);
}

/* — Catálogo — */
.catalog-filters-card,
.catalog-side-nav {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

@media (min-width: 992px) {
    #catalog-sidebar-mount {
        position: sticky;
        top: 160px;
    }
}

.catalog-side-nav__link {
    border-radius: var(--radius-pill);
    transition: background-color .15s, transform .2s var(--ease-out);
}

.catalog-side-nav__link:hover {
    transform: translateX(3px);
}

.catalog-side-nav__link.is-active,
.catalog-side-nav__link.is-active:hover {
    background: var(--fm-blue);
    color: var(--on-primario);
    box-shadow: 0 10px 18px -10px var(--brand-glow);
}

.pagination .page-link {
    border-radius: 999px;
    margin-inline: 2px;
}

/* — Marcas — */
.brand-strip__item {
    transition: transform .2s var(--ease-out), box-shadow .2s;
}

.brand-strip__item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* — Pie de página — */
.app-footer {
    position: relative;
}

.app-footer::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--fm-blue), var(--fm-orange));
}

.app-footer__grid .app-footer__col {
    background: transparent;
    border-color: transparent;
    padding-inline: .25rem;
}

/* — Controles generales — */
.modal-content {
    border: 0;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.dropdown-menu {
    border-radius: var(--radius-md);
}

@media (max-width: 576px) {
    .quick-links {
        grid-template-columns: 1fr 1fr;
        gap: .65rem;
    }

    #hero-carousel + .container-xl > .quick-links {
        margin-top: .85rem;
        padding-inline: .75rem;
    }

    .quick-links__item {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
        padding: .8rem;
    }

    .quick-links__icon {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }

    .quick-links__copy {
        flex: 0 0 auto;
    }

    .quick-links__arrow {
        display: none;
    }

    .prod-img {
        padding: 2rem .7rem .7rem;
    }

    .prod-body {
        padding: .65rem;
    }

    .prod-actions {
        gap: .35rem;
    }

    .prod-actions .add-btn {
        min-width: 0;
        padding-inline: .4rem;
    }

    .prod-actions .add-btn i {
        display: none;
    }
}

.featured-section__view-all {
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .quick-links__item:hover,
    .prod-card:hover,
    .brand-strip__item:hover,
    .catalog-side-nav__link:hover {
        transform: none;
    }
}

/* — Cabeceras oscuras (empresa y legales): sin velo blanquecino al pie — */
.empresa-hero::after {
    content: none;
}

.empresa-hero {
    border-bottom: 4px solid var(--fm-orange);
}

/* — Preventas y A pedido — */
.preventa-page .sec-title:not(:has(.sec-dot))::before {
    content: "";
    width: 6px;
    height: 1.35em;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--fm-blue), var(--fm-orange));
}

.preventa-categories__grid .preventa-categories__link {
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: transform .2s var(--ease-out), box-shadow .2s, border-color .2s;
}

.preventa-categories__grid .preventa-categories__link:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--fm-blue) 40%, var(--border));
    box-shadow: var(--shadow-md);
}

/* — Acceso (la vista trae estilos propios: se usa mayor especificidad) — */
.auth-bg {
    background: transparent;
}

.auth-bg .auth-card:hover {
    transform: none;
}

.auth-bg .auth-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.auth-bg .auth-header {
    background:
        radial-gradient(420px 200px at 100% 0, color-mix(in srgb, var(--fm-blue) 50%, transparent), transparent 70%),
        radial-gradient(360px 180px at 0 100%, color-mix(in srgb, var(--fm-orange) 38%, transparent), transparent 70%),
        #0f172a;
    border-bottom: 4px solid var(--fm-orange);
}

.auth-bg .auth-header-icon {
    background: none;
    -webkit-text-fill-color: var(--acento-sobre-oscuro);
    color: var(--acento-sobre-oscuro);
    animation: none;
}

.auth-bg .btn-auth-primary {
    background: var(--fm-blue);
    border-color: var(--fm-blue);
    color: var(--on-primario);
    border-radius: var(--radius-pill);
}

.auth-bg .btn-auth-primary:hover {
    background: var(--fm-blue-dark);
    border-color: var(--fm-blue-dark);
    color: var(--on-primario);
}

.auth-bg .btn-google {
    border-radius: var(--radius-pill);
}

/* — Carrito — */
#cart-offcanvas {
    box-shadow: -24px 0 60px -24px rgba(15, 23, 42, .35);
}

#cart-offcanvas .btn {
    border-radius: var(--radius-pill);
}

@media (prefers-reduced-motion: reduce) {
    .preventa-categories__grid .preventa-categories__link:hover {
        transform: none;
    }
}

.preventa-page .form-control {
    border-radius: var(--radius-sm);
}

@media (max-width: 576px) {
    .preventa-page .preventa-categories__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem;
    }
}

/* ============================================================
   TEMA MARKETPLACE (tema activo en producción)
   Mismos selectores que marketplace.css para poder pisarlo.
   ============================================================ */
body.theme-marketplace {
    background:
        radial-gradient(1100px 520px at 100% 0, color-mix(in srgb, var(--fm-blue) 7%, transparent), transparent 70%),
        radial-gradient(900px 620px at 0 35%, color-mix(in srgb, var(--fm-orange) 7%, transparent), transparent 70%),
        var(--surface-sunken);
}

body.theme-marketplace .navbar { box-shadow: 0 8px 28px -20px rgba(15, 23, 42, .35); }
body.theme-marketplace .nav-search input { border-radius: var(--radius-pill); }
body.theme-marketplace .nav-search input:focus { border-color: color-mix(in srgb, var(--fm-blue) 45%, var(--border)); }

/* — Campañas — */
body.theme-marketplace .modern-carousel .carousel-inner,
body.theme-marketplace .modern-hero,
body.theme-marketplace .modern-promo { border-radius: var(--radius-xl); }

body.theme-marketplace .modern-campaigns { margin-bottom: 20px; }
body.theme-marketplace .modern-carousel .carousel-inner { box-shadow: var(--shadow-lg); }
body.theme-marketplace .modern-hero { min-height: clamp(360px, 33vw, 440px); }
body.theme-marketplace .modern-hero img,
body.theme-marketplace .modern-promo img { object-fit: cover; }

body.theme-marketplace .modern-hero:not(.modern-campaign--image-only)::before {
    background: linear-gradient(90deg, rgba(4, 12, 24, .78) 0%, rgba(4, 12, 24, .4) 48%, transparent 78%);
}

body.theme-marketplace .modern-hero__content { padding: clamp(24px, 4.5vw, 60px); max-width: 640px; }

body.theme-marketplace .modern-hero .modern-hero__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2rem, 4.4vw, 3.6rem);
    text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

body.theme-marketplace .modern-cta {
    border-radius: var(--radius-pill);
    padding-inline: 26px;
    box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--color-acento) 70%, transparent);
    transition: transform .2s var(--ease-out), background-color .2s;
}

body.theme-marketplace .modern-cta:hover { transform: translateY(-2px); }

body.theme-marketplace .modern-store > .quick-links { padding: 0; margin: 0 0 40px; }

/* — Encabezados — */
body.theme-marketplace .modern-section-heading h2,
body.theme-marketplace .featured-section .sec-title {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.3rem, 1.2vw + 1rem, 1.7rem);
}

body.theme-marketplace .modern-section-heading h2::before,
body.theme-marketplace .featured-section .sec-title::before {
    content: "";
    flex: 0 0 6px;
    height: 1.3em;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--fm-blue), var(--fm-orange));
}

body.theme-marketplace .modern-section-heading a {
    padding: .4rem .95rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 600;
    text-decoration: none;
}

body.theme-marketplace .modern-section-heading a:hover { border-color: var(--primario-legible); box-shadow: var(--shadow-md); }

/* — Categorías — */
body.theme-marketplace .modern-categories { margin-bottom: 44px; }
body.theme-marketplace .modern-category-grid { gap: 16px; }

body.theme-marketplace .modern-category {
    border-radius: var(--radius-lg);
    font-size: .92rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: transform .25s var(--ease-out), box-shadow .25s, border-color .25s;
}

body.theme-marketplace .modern-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--fm-blue) 40%, var(--border));
}

body.theme-marketplace .modern-category__image > i {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 22px;
    font-size: 1.6rem;
    background: color-mix(in srgb, var(--fm-blue) 11%, var(--surface));
    transition: background-color .25s, color .25s;
}

body.theme-marketplace .modern-category:hover .modern-category__image > i { background: var(--fm-blue); color: var(--on-primario); }

body.theme-marketplace .modern-category--all {
    background: linear-gradient(140deg, var(--color-fondo-oscuro), color-mix(in srgb, var(--color-fondo-oscuro) 65%, var(--fm-blue)));
    border-color: transparent;
    color: var(--on-oscuro);
}

body.theme-marketplace .modern-category--all:hover { color: var(--on-oscuro); }
body.theme-marketplace .modern-category--all .modern-category__image > i { background: rgba(255, 255, 255, .12); color: var(--on-oscuro); }

/* — Productos — */
body.theme-marketplace .prod-card {
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

body.theme-marketplace .prod-card:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--fm-blue) 30%, var(--border));
    box-shadow: var(--shadow-lg);
}

body.theme-marketplace .prod-img,
body.theme-marketplace .featured-section .prod-img { height: 215px; background: #fff; }
body.theme-marketplace .prod-price { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; }
body.theme-marketplace .prod-actions .add-btn { border-radius: var(--radius-pill); }

body.theme-marketplace .prod-tool-btn { border-color: var(--border); background: var(--surface); }

/* — Bloques inferiores — */
body.theme-marketplace .brand-strip,
body.theme-marketplace #software { border-radius: var(--radius-xl); }
body.theme-marketplace #software { box-shadow: var(--shadow-lg); }

@media (max-width: 767px) {
    body.theme-marketplace .modern-hero { min-height: 300px; align-items: flex-end; }
    body.theme-marketplace .modern-hero:not(.modern-campaign--image-only)::before {
        background: linear-gradient(0deg, rgba(4, 12, 24, .85) 0%, rgba(4, 12, 24, .35) 60%, transparent);
    }
    body.theme-marketplace .modern-hero .modern-hero__title { font-size: 1.9rem; }
    body.theme-marketplace .modern-store > .quick-links { margin-bottom: 28px; }
    body.theme-marketplace .modern-category-grid { gap: 10px; }
    body.theme-marketplace .modern-category:hover { transform: none; }
    body.theme-marketplace .modern-category__image > i { width: 50px; height: 50px; border-radius: 16px; font-size: 1.2rem; }
    body.theme-marketplace .prod-img,
    body.theme-marketplace .featured-section .prod-img { height: 150px; padding: 12px; }
    body.theme-marketplace .prod-price { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    body.theme-marketplace .prod-card:hover,
    body.theme-marketplace .modern-category:hover,
    body.theme-marketplace .modern-cta:hover { transform: none; }
}

/* Velo configurable por slide (slides_detalles.overlay, 0-100). */
body.theme-marketplace .modern-promo.modern-promo--overlay:not(.modern-campaign--image-only)::before {
    background: linear-gradient(0deg,
            rgb(0 0 0 / var(--promo-overlay)),
            rgb(0 0 0 / calc(var(--promo-overlay) * .5)) 60%,
            rgb(0 0 0 / calc(var(--promo-overlay) * .12)));
}

/* Con poco velo, la sombra mantiene legible el texto sobre fotos claras. */
body.theme-marketplace .modern-promo--overlay .modern-promo__content {
    text-shadow: 0 1px 10px rgb(0 0 0 / .65);
}
