/* ============================================================
    MORRIS CSS (LUTA / TEMPLATE COMPARTIDO)
    - Mantiene intención visual
    - Elimina rastros específicos de cards/modales de piezas
    - Conserva hero de piezas
    - Ajusta títulos h3 de cards para reservar 2 líneas
    - Añade botón "+" superior derecho para detalle en cards
    - Compacta el componente al quitar descripción visible en card
    - Bloques enumerados como coordenadas
    ============================================================ */

/* ============================================================
    CSS1) Smooth scroll
    ============================================================ */
html {
    scroll-behavior: smooth;
}

/* ============================================================
    CSS2) Reset básico
    ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================
    CSS3) Tipografía Outfit
    ============================================================ */
.outfit-gorda,
.outfit-regular {
    font-family: "Outfit", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

.outfit-gorda {
    font-weight: 800;
}

.outfit-regular {
    font-weight: 300;
}

/* ============================================================
    CSS4) MORRIS THEME
    - Variables globales del sitio
    ============================================================ */
body.morris-theme {
    --m-dark: #181C14;
    --m-dark2: #3C3D37;
    --m-accent: #697565;
    --m-light: #ECDFCC;

    --m-white: #FFFFFF;
    --m-warm: #F7F4EE;

    --m-border-16: rgba(60, 61, 55, 0.16);
    --m-border-18: rgba(60, 61, 55, 0.18);
    --m-border-22: rgba(60, 61, 55, 0.22);
    --m-border-28: rgba(60, 61, 55, 0.28);
    --m-border-45: rgba(60, 61, 55, 0.45);
    --m-border-55: rgba(60, 61, 55, 0.55);

    --m-muted-72: rgba(60, 61, 55, 0.72);
    --m-light-72: rgba(236, 223, 204, 0.72);

    --m-focus-18: rgba(105, 117, 101, 0.18);
    --m-focus-22: rgba(105, 117, 101, 0.22);
    --m-focus-25: rgba(105, 117, 101, 0.25);
    --m-focus-35: rgba(105, 117, 101, 0.35);

    background: #FFFFFF;
    color: var(--m-dark);
}

/* ============================================================
    CSS5) Utilidades globales Bootstrap (scoped al sitio)
    ============================================================ */
body.morris-theme .bg-light {
    background: var(--m-warm) !important;
}

body.morris-theme .bg-dark {
    background: var(--m-dark) !important;
}

body.morris-theme .bg-white {
    background: #FFFFFF !important;
}

body.morris-theme .text-muted {
    color: var(--m-muted-72) !important;
}

body.morris-theme .text-black {
    color: var(--m-dark) !important;
}

body.morris-theme .border {
    border-color: var(--m-border-28) !important;
}

body.morris-theme .bg-dark .text-white,
body.morris-theme .bg-dark.text-white {
    color: #FFFFFF !important;
}

body.morris-theme .bg-dark .text-white-50 {
    color: var(--m-light-72) !important;
}

body.morris-theme .badge.text-bg-dark {
    background: var(--m-dark) !important;
    color: var(--m-light) !important;
}

/* ============================================================
    CSS6) Botones
    ============================================================ */
body.morris-theme .btn.btn-dark {
    background: var(--m-dark) !important;
    border-color: var(--m-dark) !important;
    color: var(--m-light) !important;
}

body.morris-theme .btn.btn-dark:hover,
body.morris-theme .btn.btn-dark:focus {
    background: var(--m-dark2) !important;
    border-color: var(--m-dark2) !important;
    color: var(--m-light) !important;
}

body.morris-theme .btn.btn-light {
    background: #FFFFFF !important;
    border-color: var(--m-border-45) !important;
    color: var(--m-dark) !important;
}

body.morris-theme .btn.btn-light:hover,
body.morris-theme .btn.btn-light:focus {
    border-color: var(--m-accent) !important;
    box-shadow: 0 0 0 0.25rem var(--m-focus-18);
}

body.morris-theme .btn.btn-outline-dark {
    border-color: var(--m-border-55) !important;
    color: var(--m-dark2) !important;
}

body.morris-theme .btn.btn-outline-dark:hover,
body.morris-theme .btn.btn-outline-dark:focus {
    background: var(--m-accent) !important;
    border-color: var(--m-accent) !important;
    color: var(--m-dark) !important;
    box-shadow: 0 0 0 0.25rem var(--m-focus-18);
}

body.morris-theme .bg-dark .btn.btn-outline-light {
    border-color: rgba(236, 223, 204, 0.85) !important;
    color: rgba(236, 223, 204, 0.92) !important;
}

body.morris-theme .bg-dark .btn.btn-outline-light:hover,
body.morris-theme .bg-dark .btn.btn-outline-light:focus {
    background: var(--m-accent) !important;
    border-color: var(--m-accent) !important;
    color: var(--m-dark) !important;
    box-shadow: 0 0 0 0.25rem var(--m-focus-18);
}

/* ============================================================
    CSS7) Links generales
    - No toca navbar ni nav-links
    ============================================================ */
body.morris-theme a:not(.navbar-brand):not(.nav-link) {
    color: var(--m-dark2);
}

body.morris-theme a:not(.navbar-brand):not(.nav-link):hover,
body.morris-theme a:not(.navbar-brand):not(.nav-link):focus {
    color: var(--m-accent);
}

/* ============================================================
    CSS8) Navbar MORRIS
    ============================================================ */
body.morris-theme .morris-navbar {
    background: var(--m-dark) !important;
    border-bottom-color: var(--m-dark2) !important;
}

body.morris-theme .morris-navbar .navbar-brand,
body.morris-theme .morris-navbar .nav-link,
body.morris-theme .morris-navbar .nav-link.dropdown-toggle {
    color: var(--m-light) !important;
}

body.morris-theme .morris-navbar .nav-link:hover,
body.morris-theme .morris-navbar .nav-link:focus {
    color: var(--m-accent) !important;
}

body.morris-theme .morris-navbar .nav-link.active,
body.morris-theme .morris-navbar .nav-link[aria-current="page"] {
    color: var(--m-light) !important;
    text-decoration: underline;
    text-underline-offset: 0.25rem;
    text-decoration-color: var(--m-accent);
}

body.morris-theme .morris-navbar .navbar-toggler {
    border-color: var(--m-dark2) !important;
}

body.morris-theme .morris-navbar .navbar-toggler-icon,
body.morris-theme .morris-navbar .dropdown-toggle::after {
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

body.morris-theme .morris-navbar #langSelect {
    background: var(--m-dark) !important;
    color: var(--m-light) !important;
    border-color: var(--m-dark2) !important;
}

body.morris-theme .morris-navbar #langSelect:focus {
    border-color: var(--m-accent) !important;
    box-shadow: 0 0 0 0.25rem var(--m-focus-25);
}

/* ============================================================
    CSS8.1) Dropdowns del navbar
    ============================================================ */
body.morris-theme .morris-navbar .dropdown-menu {
    background: var(--m-dark) !important;
    border: 1px solid var(--m-dark2) !important;
    border-radius: 0.75rem;
    padding: 0.35rem;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

body.morris-theme .morris-navbar .dropdown-item {
    color: var(--m-light) !important;
    border-radius: 0.55rem;
    padding: 0.5rem 0.75rem;
    line-height: 1.1;
    background: transparent !important;
}

body.morris-theme .morris-navbar .dropdown-item:hover,
body.morris-theme .morris-navbar .dropdown-item:focus {
    background: var(--m-focus-22) !important;
    color: var(--m-light) !important;
}

body.morris-theme .morris-navbar .dropdown-item.active,
body.morris-theme .morris-navbar .dropdown-item:active {
    background: var(--m-focus-35) !important;
    color: var(--m-light) !important;
}

body.morris-theme .morris-navbar .dropdown-divider {
    border-top-color: rgba(236, 223, 204, 0.18) !important;
    opacity: 1 !important;
    margin: 0.35rem 0.25rem;
}

body.morris-theme .morris-navbar .dropdown-toggle:focus,
body.morris-theme .morris-navbar .dropdown-item:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem var(--m-focus-18);
}

@media (max-width: 991.98px) {
    body.morris-theme .morris-navbar .dropdown-menu {
        margin-top: 0.35rem;
    }

    body.morris-theme .morris-navbar .dropdown-item {
        padding: 0.65rem 0.85rem;
    }
}

/* ============================================================
    CSS9) Footer MORRIS
    ============================================================ */
body.morris-theme .morris-footer {
    background: var(--m-dark) !important;
    border-top-color: var(--m-dark2) !important;
    color: var(--m-light) !important;
}

body.morris-theme .morris-footer .text-white {
    color: var(--m-light) !important;
}

body.morris-theme .morris-footer .text-white-50 {
    color: var(--m-accent) !important;
}

body.morris-theme .morris-footer a,
body.morris-theme .morris-footer .btn.btn-link {
    color: var(--m-light) !important;
}

body.morris-theme .morris-footer a:hover,
body.morris-theme .morris-footer a:focus,
body.morris-theme .morris-footer .btn.btn-link:hover,
body.morris-theme .morris-footer .btn.btn-link:focus {
    color: var(--m-accent) !important;
    text-decoration-color: var(--m-accent);
}

body.morris-theme .morris-footer .border-top,
body.morris-theme .morris-footer .border-white.border-opacity-10,
body.morris-theme .morris-footer hr.border-white.border-opacity-10 {
    border-color: var(--m-dark2) !important;
    opacity: 1 !important;
}

body.morris-theme .morris-footer .badge.text-bg-secondary {
    background: var(--m-dark2) !important;
    color: var(--m-light) !important;
}

body.morris-theme .morris-footer .btn-danger {
    background: var(--m-dark2) !important;
    border-color: var(--m-dark2) !important;
    color: var(--m-light) !important;
}

body.morris-theme .morris-footer .btn-danger:hover,
body.morris-theme .morris-footer .btn-danger:focus {
    background: var(--m-accent) !important;
    border-color: var(--m-accent) !important;
    color: var(--m-dark) !important;
}

/* ============================================================
    CSS10) Heroes
    - Props comunes
    - Conserva hero de piezas
    ============================================================ */
#hero-index,
#hero-estudio,
#hero-espacios,
#hero-piezas,
#hero-decoracion,
#hero-contacto,
#hero-plantas,
#hero-serie7 {
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;
}

#hero-index {
    background-image: url('https://morris-carpinteria.com/images/-compo.webp') !important;
}

#hero-estudio {
    background-image: url('https://morris-carpinteria.com/images/estdioCw.webp') !important;
}

#hero-espacios {
    background-image: url('https://morris-carpinteria.com/images/eMC.webp') !important;
}

#hero-piezas {
    background-image: url('https://morris-carpinteria.com/images/assambly.webp') !important;
}

#hero-decoracion {
    background-image: url('https://morris-carpinteria.com/images/-woodDecor.webp') !important;
}

#hero-contacto {
    background-image: url('https://morris-carpinteria.com/images/-ultraCon.webp') !important;
}

#hero-plantas {
    background-image: url('https://morris-carpinteria.com/images/plantas.webp') !important;
}

#hero-serie7 {
    background-image: url('https://morris-carpinteria.com/images/tarimas.webp') !important;
}

.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    color: #FFFFFF;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* ============================================================
    CSS11) Template compartido tipo decoracion
    - Sin rastros específicos de piezas.php
    - Ajuste de alineación para títulos h3 de 1 o 2 líneas
    - Botón "+" como trigger de detalle
    ============================================================ */
body.morris-theme .morris-card {
    position: relative;
}

body.morris-theme .morris-card-media {
    background: #F2F2F2 !important;
}

body.morris-theme .morris-media {
    max-width: 100%;
    height: auto;
}

body.morris-theme .morris-card-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

body.morris-theme .morris-card-body h3 {
    line-height: 1.25;
    min-height: calc(1.25em * 2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.morris-theme .morris-card-meta {
    margin-top: 1rem;
}

body.morris-theme .morris-card-desc {
    display: none !important;
}

body.morris-theme .morris-price-badge {
    background: var(--m-dark) !important;
    color: var(--m-light) !important;
    letter-spacing: 0.02em;
}

body.morris-theme .morris-panel {
    border-color: var(--m-border-22) !important;
}

/* ============================================================
    CSS11.1) Botón plus en card
    ============================================================ */
body.morris-theme .morris-card-plus-btn {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 5;

    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(24, 28, 20, 0.58);
    color: #FFFFFF;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    backdrop-filter: blur(0.4rem);
    -webkit-backdrop-filter: blur(0.4rem);

    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

body.morris-theme .morris-card-plus-btn:hover,
body.morris-theme .morris-card-plus-btn:focus {
    background: rgba(24, 28, 20, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.12);
    transform: scale(1.04);
    outline: none;
}

body.morris-theme .morris-card-plus-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.25rem var(--m-focus-18);
}

body.morris-theme .morris-card-plus-icon {
    font-size: 1.15rem;
    line-height: 1;
    font-weight: 500;
    transform: translateY(-0.03rem);
    pointer-events: none;
}

/* ============================================================
    CSS11.2) Ajustes compactos para card sin descripción
    ============================================================ */
body.morris-theme .morris-card-body .text-uppercase.small {
    padding-right: 2.75rem;
}

body.morris-theme .morris-card-body hr {
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
}

body.morris-theme .morris-card-body .morris-card-meta:last-child {
    margin-bottom: 0;
}

/* ============================================================
    CSS12) Carruseles
    ============================================================ */
body.morris-theme .morris-carousel .carousel-control-prev,
body.morris-theme .morris-carousel .carousel-control-next {
    width: 18%;
    opacity: 0;
    transition: opacity 0.18s ease;
}

body.morris-theme .morris-carousel:hover .carousel-control-prev,
body.morris-theme .morris-carousel:hover .carousel-control-next {
    opacity: 0.85;
}

body.morris-theme .morris-carousel .carousel-control-prev-icon,
body.morris-theme .morris-carousel .carousel-control-next-icon {
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
    opacity: 0.95;
}

/* ============================================================
    CSS13) Modal compartido tipo decoracion
    - Sin rastros específicos de piezas.php
    ============================================================ */
body.morris-theme .morris-modal-media {
    border-color: var(--m-border-18) !important;
}

/* ============================================================
    CSS14) Hero overlay CRT + shimmer
    ============================================================ */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Crect width='10' height='10' fill='none'/%3E%3Ccircle cx='4' cy='4' r='0.78' fill='rgba(255,0,0,0.60)'/%3E%3Ccircle cx='6' cy='4' r='0.78' fill='rgba(0,255,0,0.60)'/%3E%3Ccircle cx='5' cy='6' r='0.78' fill='rgba(0,140,255,0.65)'/%3E%3C/svg%3E"),
        repeating-linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.18) 0px,
            rgba(0, 0, 0, 0.18) 1px,
            rgba(0, 0, 0, 0) 2px,
            rgba(0, 0, 0, 0) 4px
        );
    background-size: 3px 3px, 75% 56px;
    background-position: 0px 0px, 0px 0px;
    mix-blend-mode: screen;
    opacity: 0.26;
    animation: heroCrtShimmer 0.55s steps(4, end) infinite;
}

@keyframes heroCrtShimmer {
    0% {
        opacity: 0.18;
        background-position: 0px 0px, 0px 0px;
        filter: blur(0px);
    }

    12% {
        opacity: 0.34;
        background-position: 1.2px -0.8px, 0px 0.8px;
        filter: blur(0.20px);
    }

    25% {
        opacity: 0.22;
        background-position: -1.0px 1.1px, 0px 0px;
        filter: blur(0px);
    }

    37% {
        opacity: 0.36;
        background-position: 0.9px 0.3px, 0px 0.8px;
        filter: blur(0.18px);
    }

    50% {
        opacity: 0.20;
        background-position: -0.7px -1.0px, 0px 0px;
        filter: blur(0px);
    }

    62% {
        opacity: 0.35;
        background-position: 1.1px 1.0px, 0px 0.8px;
        filter: blur(0.22px);
    }

    75% {
        opacity: 0.23;
        background-position: -1.2px 0.6px, 0px 0px;
        filter: blur(0px);
    }

    87% {
        opacity: 0.38;
        background-position: 0.6px -1.2px, 0px 0.8px;
        filter: blur(0.20px);
    }

    100% {
        opacity: 0.18;
        background-position: 0px 0px, 0px 0px;
        filter: blur(0px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero::after {
        animation: none;
    }
}

/* ============================================================
    CSS15) H1 luxe
    ============================================================ */
.h1-luxe {
    position: relative;
    display: inline-block;
    margin: 0;
    padding: 0.18em 0.42em;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.28);
    border: 0;
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    overflow: visible;
}

.h1-luxe > span {
    position: relative;
    z-index: 3;
    color: #FFFFFF;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    text-shadow:
        0 2px 18px rgba(0, 0, 0, 0.45),
        0 1px 0 rgba(255, 255, 255, 0.08);
}

.h1-luxe::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 0;
    z-index: 2;
    background-image: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0.00) 0%,
        rgba(255, 255, 255, 0.00) 35%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.00) 65%,
        rgba(255, 255, 255, 0.00) 100%
    );
    background-size: 220% 100%;
    background-position: 0% 50%;
    opacity: 0.9;
    animation: luxeShimmer 3.2s ease-in-out infinite;
    pointer-events: none;
}

.h1-luxe::after {
    content: "";
    position: absolute;
    inset: -22px;
    z-index: 1;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.18);
    filter: blur(16px);
    opacity: 0.85;
    -webkit-mask-image: radial-gradient(
        closest-side,
        rgba(0, 0, 0, 1) 62%,
        rgba(0, 0, 0, 0) 100%
    );
    mask-image: radial-gradient(
        closest-side,
        rgba(0, 0, 0, 1) 62%,
        rgba(0, 0, 0, 0) 100%
    );
    animation: luxeFadeOut 3.6s ease-in-out infinite;
}

@keyframes luxeShimmer {
    0% {
        background-position: 0% 50%;
        opacity: 0.55;
    }

    50% {
        background-position: 120% 50%;
        opacity: 0.95;
    }

    100% {
        background-position: 220% 50%;
        opacity: 0.55;
    }
}

@keyframes luxeFadeOut {
    0% {
        -webkit-mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 58%, rgba(0, 0, 0, 0) 100%);
        mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 58%, rgba(0, 0, 0, 0) 100%);
        opacity: 0.70;
    }

    50% {
        -webkit-mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 74%, rgba(0, 0, 0, 0) 100%);
        mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 74%, rgba(0, 0, 0, 0) 100%);
        opacity: 0.90;
    }

    100% {
        -webkit-mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 58%, rgba(0, 0, 0, 0) 100%);
        mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 58%, rgba(0, 0, 0, 0) 100%);
        opacity: 0.70;
    }
}

@media (prefers-reduced-motion: reduce) {
    .h1-luxe::before,
    .h1-luxe::after {
        animation: none;
    }
}

/* ============================================================
    CSS16) Bloque loque
    ============================================================ */
.loque-wrap {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: antiquewhite;
}

.loque-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.loque-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.56;
    filter: grayscale(10%) brightness(0.78) contrast(1.04);
    transform: scale(1.03);
}

.loque-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        #111111D6 0%,
        #181C14B0 24%,
        #22262094 52%,
        #111111D8 100%
    );
}

/*
.loque-noise {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        #FFFFFF08 0%,
        #FFFFFF00 26%,
        #FFFFFF06 58%,
        #00000012 100%
    );
}
*/

.loque-content {
    position: relative;
    z-index: 3;
}

.loque-card {
    height: 100%;
    padding: 1.25rem 1.25rem;
    backdrop-filter: blur(2px);
}

@media (max-width: 991.98px) {
    .loque-video {
        opacity: 0.48;
        filter: grayscale(12%) brightness(0.72) contrast(1.03);
    }

    .loque-overlay {
        background: linear-gradient(
            to bottom,
            #111111DE 0%,
            #181C14C2 40%,
            #111111DC 100%
        );
    }
}

@media (prefers-reduced-motion: reduce) {
    .loque-video {
        animation: none !important;
    }
}