
:root {
    --sm-primary: #3e4a3d;
    --sm-accent: #8b5a2b;
    --sm-bg: #e8e4d9;
    --sm-radius: 0px;
}

#smGlobalModal * { box-sizing: border-box; }

.clic-modal { cursor: pointer; }

.sm-overlay {
    display: none; position: fixed; z-index: 999999;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(20, 25, 20, 0.8);
    backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
/* 1. Contenedor de contenido con máscara de degradado */
.sm-body {
    overflow-y: auto;
    flex: 1;
    padding: 0; /* Quitamos padding aquí para que la máscara llegue al borde */
    position: relative;
    
    /* Efecto Fade: El texto se desvanece arriba y abajo al hacer scroll */
    mask-image: linear-gradient(to bottom, 
        transparent 0%, 
        black 5%, 
        black 95%, 
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(to bottom, 
        transparent 0%, 
        black 5%, 
        black 95%, 
        transparent 100%
    );
}
/* Esto en tu style-modales.css es mil veces mejor que hacerlo por JS */
.sm-grid-overlay, .sm-grid-title, .sm-grid-subtitle {
    font-family: 'Sora', sans-serif !important;
    font-size: xx-small;
    text-align: center;
}
/* 2. Scrollbar Minimalista (Estilo Apple/Moderno) */
.sm-body::-webkit-scrollbar {
    width: 4px; /* Muy fino */
}
.sm-body::-webkit-scrollbar-track {
    background: transparent; 
}
.sm-body::-webkit-scrollbar-thumb {
    background: rgba(62, 74, 61, 0.2); /* Tu verde musgo muy suave */
    border-radius: 20px;
    transition: background 0.3s;
}
.sm-body:hover::-webkit-scrollbar-thumb {
    background: rgba(62, 74, 61, 0.5); /* Se nota más al pasar el mouse */
}
/* 3. Ajuste de contenido interno para que el fade no tape el título */
.sm-content {
    padding: 30px;
    padding-top: 20px;
}
.sm-wrapper {
    background: var(--sm-bg);
    width: 95%;
    max-width: 550px;
    /* LIMITAR ALTURA */
    max-height: 90vh; /* El modal nunca medirá más del 90% de la altura de la pantalla */
    display: flex;
    flex-direction: column;    
    border-radius: var(--sm-radius);
    overflow: hidden; /* Mantiene los bordes redondos */
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    animation: smEmerger 0.3s ease-out;
}
@keyframes smEmerger {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.sm-close {
    position: absolute; top: 10px; right: 10px;
    width: 30px; height: 30px; background: rgba(0,0,0,0.4);
    color: #fff; border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    cursor: pointer; z-index: 5; font-size: 20px;
}

#sm-img {
    width: 100%; height: 250px;
    object-fit: cover;
    display: block; /* Elimina espacio inferior blanco */
    margin: 0; padding: 0;
    filter: sepia(10%) contrast(1.1);
}
#sm-title {
    color: var(--sm-primary);
    font-family: 'Sora', sans-serif !important;
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    border-bottom: 2px solid var(--sm-accent);
    display: inline-block;
}
#sm-desc {
    color: #333;
    line-height: 1.7;
    font-size: 1.05rem;
}
/* Contenedor del botón para dar espacio */
/* Contenedor del botón centrado */
/* Contenedor del botón centrado */
.sm-footer {
    margin-top: 30px; /* Espacio entre la descripción y el botón */
    display: flex;    /* Activamos Flexbox */
    justify-content: center; /* Centrado horizontal */
    align-items: center;     /* Alineación vertical (si fuera necesario) */
    width: 100%;      /* Aseguramos que ocupe todo el ancho disponible */
}
/* El Botón con fuente Sora */
.sm-btn-nature {
    font-family: 'Sora', sans-serif !important;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 35px; /* Un poco más de ancho para que se vea equilibrado */
    background-color: var(--sm-accent);
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--sm-radius);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.sm-btn-nature:hover {
    background-color: var(--sm-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
}
/* Micro-animación del icono (si decides poner una flecha en el JS) */
/* Efecto de pulsación activa */
.sm-btn-nature:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}
.clic-modal {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: block; /* Asegura que ocupe el espacio */
}
.clic-modal:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(62, 74, 61, 0.2);
}
.clic-modal img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.clic-modal:hover img {
    transform: scale(1.1);
}
.clic-modal {
    position: relative;
    overflow: hidden;
    transform: translateZ(0); /* Crea un nuevo contexto de capas para el navegador */
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}
.sm-grid-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
    color: #ffffff;
    z-index: 10;
    /* ESTO EVITA QUE SE MUEVA AL HACER HOVER */
    pointer-events: none; /* Hace que el mouse "atraviese" el texto y toque la imagen */
    transform: translateZ(0); /* Lo ancla a su propia capa */
    will-change: transform;
}
.clic-modal img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.sm-grid-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Georgia', serif; /* O la fuente montañera que prefieras */
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}
.sm-grid-subtitle {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.85;
    line-height: 1.4;
}
.clic-modal {
    overflow: hidden !important; 
    -webkit-mask-image: -webkit-radial-gradient(white, black); 
}
.sm-grid-overlay {
    border-bottom-left-radius: var(--sm-radius);
    border-bottom-right-radius: var(--sm-radius);
}