/* 1. RESET Y CONFIGURACIÓN BASE PWA */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

button:focus, input:focus, textarea:focus, span:focus {
    outline: none !important;
}

html, body {
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    background-color: #f8f8f8;
    font-family: 'Poppins', sans-serif;
    color: #1A1A1A;
}

/* 2. CONTENEDOR ADAPTABLE (Limpio) */
.app-container {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    position: relative;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    touch-action: pan-x pan-y;
    overflow-y: auto;
    user-select: none; /* Opcional: evita selección de texto accidental */
}

/* Evitar que el contenido se esconda detrás del menú */
main {
    padding-bottom: 70px;
}

/* 3. MEDIA QUERY PARA MÓVILES */
@media (max-width: 540px) {.app-container { width: 100% }}

/* MENU INFERIOR LIMPIO */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    height: 60px;
    background-color: #FFFFFF;
    display: flex;
    justify-content: space-around;
    align-items: center;
    /*border-top: 1px solid #f2f2f2;*/
    z-index: 1000;
}
.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20%;
    height: 100%;
    cursor: pointer;
}

.nav-item span {
    font-size: 28px;
    color: #a4a4a4;
    width: 37px;
    height: 37px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-variation-settings: 'FILL' 0, 'wght' 400;
}

/* Estado Activo: Círculo Verde e Icono Blanco */
.nav-item.active span {
    background: linear-gradient(45deg, #2E8B57, #50C878);
    color: #FFFFFF;
    font-variation-settings: 'FILL' 1, 'wght' 400;
    box-shadow: 0 3px 8px rgba(80, 200, 120, 0.4);
    transform: scale(1.40); /* Ligero aumento para resaltar la selección */
}

/* HEADER DE SECCIÓN ACTUALIZADO */
.section-header {
    display: flex;
    justify-content: space-between; /* Título a la izquierda, iconos a la derecha */
    align-items: center;
    padding: 0;
    margin: 0;
    background: #FFFFFF;
    position: sticky; /* Se queda fijo arriba al hacer scroll */
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease-in-out; /* Animación suave */
}

/* Esta clase se añadirá con JS para ocultarlo */
.section-header.header-hidden {
    transform: translateY(-100%);
}

.brand-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    /*text-transform: uppercase;*/
    background: linear-gradient(90deg, #2E8B57, #50C878);
    line-height: 1;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 3. SUBTÍTULO Y TEXTOS (POPPINS) */
.section-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.0rem;
    font-weight: 700;
    color: #2E8B57;
    padding: 10px 10px 0;
    letter-spacing: 0px;    
    line-height: 1.2;
}

.section-subtitle b {
    color: #50C878;
    font-size: 1.2rem;
}

.text-ofertas{
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    padding: 0 10px;
    line-height: 1.1;
    color: #757575;
}

.bgheader {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Por si la imagen es muy grande, que no se salga del círculo */
}

.header-logo {
    background: linear-gradient(90deg, #2E8B57, #50C878);
    padding: 2px 7px;
    width: 64px;   /* Ocupa el ancho del círculo */
    height: 100%;  /* Ocupa el alto del círculo */
    object-fit: cover; /* Ajusta la imagen para que rellene el círculo sin deformarse */
}

.brand-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 10px;
    line-height: 1.1; /* Ajusta el espacio entre líneas */
}

@keyframes intTitle {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

.brand-title-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1A1A1A;
    /*background: linear-gradient(90deg, #2E8B57, #50C878);
    line-height: 1;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);*/
    letter-spacing: -1.5px;
    animation: intTitle 0.4s ease-out;
}

/* Etiqueta de ubicación dinámica en el header */
.header-location-label {
    display: none; /* Se activa por JS */
    font-size: 0.75rem;
    font-weight: 600;
    color: #50C878; /* Tu verde esmeralda */
     /*background: rgba(80, 200, 120, 0.1);
    padding: 2px 8px;
    margin: 0 auto; */
    border-radius: 12px;
    vertical-align: middle;
    white-space: nowrap;
    animation: slideInLabel 0.4s ease-out;
}

@keyframes slideInLabel {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.header-icons {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 10px; /* Espacio elegante entre iconos */
}

.icon-btn {
    font-size: 28px;
    color: #1A1A1A;
    cursor: pointer;
    font-variation-settings: 'wght' 350; /* Peso ligero para elegancia */
    transition: transform 0.2s ease;
}

.icon-btn:active {
    transform: scale(0.9); /* Feedback visual al presionar */
    color: #50C878; /* Cambio momentáneo a esmeralda */
}

/* CONTENEDOR DE HISTORIAS */
.stories-wrapper {
    display: block; /* Asegura que sea visible por defecto */
    width: 100%;
    background: #F8F8F8;
    padding: 0;
    margin-bottom: 8px;
}

.stories-container {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 10px;
    scrollbar-width: none; /* Ocultar scroll en Firefox */
    scroll-snap-type: x mandatory; /* Opcional: para que las historias "encajen" al deslizar */
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
}

.stories-container::-webkit-scrollbar {
    display: none; /* Ocultar scroll en Chrome/Safari */
}

/* Si no hay historias, que no ocupe espacio */
.stories-container:empty {
    display: none;
}

/* TARJETA DE HISTORIA (Aspecto 9:16) */
.story-card {
    position: relative;
    min-width: 98px;
    width: 110px;
    aspect-ratio: 9 / 16; /* Mantiene la proporción */
    border-radius: 15px;
    overflow: hidden;
    background-color: #f0f0f0;
    cursor: pointer;
    flex-shrink: 0;
    /* SOMBRA SUAVE Y LIGERA */
    /* x=0, y=4, desenfoque=10, opacidad=5% negro */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); 
    /* Transición por si luego quieres un efecto al hacer hover o clic */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.story-card:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.story-card img.main-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background-color: #f8f8f8; /* Fondo neutro mientras carga */
    min-height: 100%; /* Evita que la tarjeta colapse */
}

/* LOGO DE LA EMPRESA (Superior Derecha) */
.story-logo {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
    object-fit: cover;
}

/* FOOTER CON NOMBRE Y DEGRADADO */
.story-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: left;
    /* GRADIENTE: Transparente 100% arriba, Negro 90% abajo */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0,0,0,0) 100%);
    z-index: 2;
    pointer-events: none; /* Para que no interfiera con el click */
}

.story-footer span {
    color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5); /* Sombra para leer en fondos claros */
    padding: 5px 8px;
}

/* VISOR DE HISTORIAS */
/* Animación para el contenido (el story en sí) */
@keyframes storyEntrance {
    from { 
        transform: scale(0.95); 
        opacity: 0; 
    }
    to { 
        transform: scale(1); 
        opacity: 1; 
    }
}

#story-viewer {
    display: none; /* Se mantiene oculto por defecto */
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    flex-direction: column;
    animation: storyEntrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animación para el contenido multimedia */
.story-media-anim {
    animation: mediaFade 0.4s ease-out;
}

@keyframes mediaFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Este es el contenedor que se anima al abrir */
.story-view-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: storyAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Efecto rebote suave */
}

.story-viewer {
    display: flex; /* Se cambia a flex desde JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 2000; /* Asegúrate que sea mayor que el nav y el header */
    flex-direction: column;
}

.story-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    display: none; /* Se activa por JS */
    flex-direction: column;
}

/* BARRAS DE PROGRESO */
.story-progress-fill {
    height: 100%;
    background-color: #50C878; /* Tu verde esmeralda */
    width: 0%;
    transition: width 0.1s linear; /* Esto hace que el avance sea fluido */
}

.story-progress-container {
    display: block;
    padding: 7px 10px;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 2020;
}

.progress-bar {
    height: 3px;
    background: rgba(255,255,255,0.3);
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #FFFFFF;
    width: 0%;
    transition: width 0.05s linear; /* Suaviza el movimiento */
}

.paused .progress-fill {
    background: #FFFFFF !important; /* Amarillo mostaza al pausar */
}

/* HEADER DEL VISOR */
.story-viewer-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px 10px 15px;
    z-index: 2010;
    background: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.story-user-info { 
    display: flex; 
    align-items: center; 
    gap: 10px; }

.viewer-user-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    object-fit: cover;
}

.viewer-user-details h4 { 
    color: white; 
    font-size: 0.85rem; 
    margin: 0;
    line-height: 1.2;
}

.viewer-user-details p { 
    color: rgba(255,255,255,0.8); 
    font-size: 0.7rem;
    line-height: 1.2;
    margin: 0;
}

.close-viewer { 
    color: white; 
    cursor: pointer;
}

/* CONTENIDO Y TAP AREAS */
.story-main-content { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.story-main-content img, .story-main-content video { 
    width: 100%; 
    max-height: 100vh; 
    object-fit: contain;
}

.story-tap-areas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 85%;
    display: flex; z-index: 2005;
}

.tap-area { height: 100%; }
.tap-area.prev, .tap-area.next { width: 25%; }
.tap-area.pause { width: 50%; z-index: 1001; }

/* FOOTER */
.story-viewer-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2010;
}

.footer-actions { 
    display: flex; 
    gap: 10px; 
    color: white;
}

/* Tamaño general de los iconos en el footer del viewer */
.footer-actions .material-symbols-outlined {
    font-size: 25px;
    font-variation-settings: 'FILL' 0, 'wght' 400;
}

/* Feedback visual al presionar (opcional) */
.footer-actions .material-symbols-outlined:active {
    transform: scale(1.4);
}

/* Asegura que el cambio de color y relleno sea total */
.icon-star {
    color: #FFFFFF;
    transition: color 0.3s ease, font-variation-settings 0.3s ease;
    cursor: pointer;
}

.icon-star.active {
    color: #EEDC00 !important; /* Amarillo premium */
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 25 !important;
}

.comment-input-wrapper {
    display: flex;
    flex: 1;
    background: rgba(255,255,255,0.2);
    border: 2.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 25px;
    padding: 5px 15px;
    color: white;
    align-items: center;
    min-width: 0;
}

.comment-input-wrapper input {
    font-family: 'Poppins', sans-serif !important;
    flex: 1; 
    background: transparent; 
    border: none; 
    color: white; 
    outline: none; 
    font-size: 0.8rem;
    min-width: 0;
}

/* Cambiar color del placeholder a blanco */
.comment-input-wrapper input::placeholder {font-family: 'Poppins', sans-serif !important; color: #FFFFFF !important;}
.comment-input-wrapper input::-webkit-input-placeholder {font-family: 'Poppins', sans-serif !important; color: #FFFFFF !important;}
.comment-input-wrapper input::-moz-placeholder {font-family: 'Poppins', sans-serif !important; color: #FFFFFF !important;}
.comment-input-wrapper input:-ms-input-placeholder {font-family: 'Poppins', sans-serif !important; color: #FFFFFF !important;}

.comment-input-wrapper button {
    background: transparent; 
    border: none; 
    color: #FFFFFF; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.comment-input-wrapper button:active {
    transform: scale(1.4);
    transition: color 0.3s ease, font-variation-settings 0.3s ease;
    font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24 !important;
}

.comment-input-wrapper button .material-symbols-outlined {
    font-size: 1.5rem; /* Ajusta el tamaño del icono */
    font-variation-settings: 'FILL' 1, 'wght' 300; /* Estilo fino para que se vea premium */
}

/* Opcional: Si quieres que el icono sea verde esmeralda al escribir */
.comment-input-wrapper input:not(:placeholder-shown) + button {
    color: #FFFFFF; /* Tu verde esmeralda */
}

/* FEED DE PUBLICACIONES */
.feed-container {
    background: #f8f8f8;
    padding: 10px 10px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.story-caption {
    position: absolute;
    bottom: 60px;
    width: 100%;
    padding: 0 20px;
    color: white;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* Solo 2 líneas inicialmente */
    line-clamp: 2;
    overflow: hidden;
    line-height: 1.3;
    font-size: 0.8rem !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 2009;
}

.story-caption b {
    font-size: 0.75rem;
}

/* Encabezado del Post */
.post-card {
    position: relative;
    background: #FFFFFF;
    border-radius: 15px;
    border: 0px solid #F0F0F0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.post-header {
    /* background: linear-gradient(45deg, #2E8B57, #50C878); */
    display: flex;
    align-items: center;
    padding: 12px;
    position: relative;
}

.post-user-img {
    width: 40px;
    height: 40px;
    border: 2px solid #FFFFFF;
    background-color: #F0F0F0;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.post-user-info { 
    flex: 1; 
    line-height: 1.3; 
}

.post-user-info h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #1A1A1A;
    font-weight: 700;
    line-height: 1.0; 
    margin: 0;
}

.post-city-tag {
    color: #323232;
    font-weight: 500;
    font-size: 0.75rem;
}

.post-meta {
    font-size: 0.7rem;
    color: #757575;
    font-family: 'Poppins', sans-serif;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-more-btn {
    cursor: pointer;
    color: #FFFFFF;
}

/* Contenedor principal (fondo oscuro) */
.modal-bottom-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* backdrop-filter: blur(4px); /* Desenfoque premium */
    display: none; /* Se activa con JS */
    justify-content: center;
    align-items: flex-end; /* Alinea al fondo de la pantalla */
    z-index: 10000;
}

/* El cuadro blanco que sube */
.modal-bottom-content {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border-radius: 24px 24px 0 0; /* Solo esquinas superiores */
    padding: 20px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-drag-indicator {
    width: 40px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 0;
    margin: 0 auto 20px auto;
}

.modal-option-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px 0px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a1a;
    border-radius: 12px;
    cursor: pointer;
}

.modal-option-item:active {
    background: #f5f5f5;
}

.modal-option-item span {
    font-size: 22px;
}

.modal-option-item .material-symbols-outlined {
    color: #50C878;
    font-size: 24px;
}

.btn-modal-cancelar {
    width: 100%;
    margin-top: 10px;
    padding: 16px;
    border: none;
    background: #f8f8f8;
    border-radius: 12px;
    font-weight: 700;
    color: #666;
    cursor: pointer;
}

/* Contenido Media */
.post-main-media {
    width: 100%;
    max-height: 100%;
    object-fit: cover;
    background: #f9f9f9;
    display: block;
}

.post-caption {
    position: relative;
    padding: 12px;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Contenedor de la descripción */
.desc-posts {
    font-size: 0.8rem;
    line-height: 1.4;
    color: #323232;
    transition: all 0.3s ease;
    display: block; /* Cambiado de webkit-box para permitir cálculos precisos */
    overflow: hidden;
}

/* Estado truncado: limita a 2 líneas exactas */
.desc-posts.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.8em; /* 1.4 line-height * 2 */
}

/* Botón Leer más: Oculto por defecto, JS lo activará si es necesario */
.btn-leer-mas {
    display: none; 
    color: #1A1A1A; /* Tu verde esmeralda */
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    background: white; /* Opcional: fondo blanco para tapar letras si chocan */
}

/* Separar los tags para que no se oculten con el texto */
.post-tags {display: block;margin-top: 2px;font-size: 0.75rem; font-weight: 300; color: #2E8B57;}

.post-divider {
    height: 1px;
    background-color: #F0F0F0;
    margin: 0 12px;
}

/* Acciones del Post */
.post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
}

.actions-left {
    display: flex;
    gap: 15px;
    align-items: center;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.action-item .material-symbols-outlined { font-size: 25px; color: #1A1A1A; font-variation-settings: 'FILL' 0, 'wght' 400; }
.action-item span { font-size: 0.75rem; font-weight: 500; color: #757575; }
.icon-star-post.active { color: #50C878 !important; font-variation-settings: 'FILL' 1;}

/* Botón Mensaje Directo */
.btn-direct-msg {
    background-color: #50C878;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-direct-msg .material-symbols-outlined { font-size: 25px; }

/* Forzar proporción */
.post-media-container {
    position: relative;
    width: 100%;
    background-color: #f0f0f0; 
    overflow: hidden;
    height: auto;
}

.post-media-container video{
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F0F0F0;
    overflow: hidden;
    cursor: pointer;
}

.post-media-container img {
    position: relative;
    object-fit: cover;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F0F0F0;
    overflow: hidden;
    cursor: pointer;
}

/* 1. El contenedor ahora es la base del skeleton */
.post-media-container.skeleton {
    position: relative;
    background-color: #e0e0e0; /* Color gris base */
    overflow: hidden;
    min-height: 250px; /* Evita que la card colapse antes de cargar */
}

/* 2. Creación del efecto de brillo animado (Shimmer) */
.post-media-container.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.3) 20%,
        rgba(255, 255, 255, 0.6) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 1.5s infinite;
}

/* 3. Definición de la animación */
@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* 4. Estado inicial de los medios (ocultos mientras cargan) */
.post-img, .post-video {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

/* 5. Estado final: Cuando se quita la clase .skeleton, el medio aparece suavemente */
.post-media-container:not(.skeleton) .post-img,
.post-media-container:not(.skeleton) .post-video {
    opacity: 1;
}

.post-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Centra y recorta el video para llenar el 16:9 */
    display: block;
}

.btn-volume {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 999 !important; /* Lo ponemos muy por delante de todo */
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto; /* Asegura que reciba clics */
}

.btn-volume.active {
    background: #50C878; /* Verde esmeralda */
}

/* Opcional: un indicador de que es video */
.video-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    padding: 5px;
    pointer-events: none;
}

/* Estilos para el Visualizador Completo */
.full-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 5000;
    display: none; /* Se activa con JS */
    align-items: center;
    justify-content: center;
}

.viewer-content {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-content img, 
.viewer-content video {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain; /* Aquí sí queremos ver la imagen completa */
}

.close-viewer-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 5001;
}

/* Contenedor del icono sobre la media */
.media-icon-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6); 
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Ajuste específico para el icono dentro */
.media-icon-overlay span {
    font-size: 27px; /* Un poco más pequeño y elegante */
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* FILTRO BOTTOM SHEET */
.filter-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none; align-items: flex-end; z-index: 6000;
}

.filter-sheet {
    background: white; border-radius: 20px;
    padding: 20px; animation: slideUp 0.3s ease-out;
    max-width: 540px; margin: auto;
    justify-content: center;
    align-items: center;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.filter-header {
    margin-top: 10px;
    padding: 10px 0 7px 0;
    text-align: left;
    line-height: 1.3;
}
.filter-header h3 { 
    font-size: 0.85rem;
    font-weight: 700;
}

/* Estilo para la ciudad */
.modal-city-info {
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    color: #1A1A1A;
    padding-bottom: 7px;
    border-bottom: 1px solid #f5f5f5;
}

.modal-city-info strong {
    font-weight: 700;
    color: #1A1A1A;
}

.filter-line { 
    width: 40px; 
    height: 4px; 
    background: #eee; 
    border-radius: 2px; 
    margin: -25px auto 15px; 
}

.filter-item {
    display: flex;
    align-items: center; /* Centra verticalmente el icono con los dos textos */
    gap: 15px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1.4;
}

.filter-item .material-symbols-outlined,
.manual-label .material-symbols-outlined {
    color: #50C878; /* Tu verde esmeralda */
    font-size: 26px;
}

.manual-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 10px;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

/* Aseguramos que el subtítulo sea suave */
.subtitulo-opcion {
    font-size: 0.7rem;
    color: #757575;
    font-weight: 400;
}

.select-group { display: flex; flex-direction: column; gap: 5px; margin: 0 auto; width: 230px;}
.select-group select {
    width: 100%; padding: 7px 20px; border: 1px solid #eee;
    border-radius: 20px; font-family: 'Poppins', sans-serif;
    background-color: #fcfcfc; outline: none; font-size: 0.8rem;
}

.filter-actions-row {
    display: flex;
    gap: 10px; /* Espacio entre botones */
    margin-top: 10px;
}

.filter-actions-row button {
    flex: 1; /* Hace que ambos botones tengan el mismo ancho */
    padding: 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-aplicar-filtro {
    width: 100%; background: #50C878; color: white; border: none;
}

.btn-cancelar-filtro {
    width: 100%; background: #f5f5f5;  color: #1A1A1A; border: 0;
}
/* Animación de entrada para los nuevos selects */
.select-aparecer {
    animation: fadeInSlide 0.4s ease forwards;
    opacity: 0;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Espaciado entre selects dinámicos */
#geo-filter-container select {
    margin-bottom: 3px;
}

/* Footer del visor con gradiente para legibilidad */
.viewer-footer-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
    z-index: 5002;
    pointer-events: none;
}
.viewer-footer-info * { pointer-events: auto; }

.viewer-header-row { display: flex; align-items: center; gap: 10px; line-height: 1.2; margin-bottom: 8px; }
.viewer-logo-empresa { width: 40px; height: 40px; border-radius: 50%; object-fit: cover !important; border: 2px solid #FFFFFF;}
.viewer-empresa-name { font-weight: 700; font-size: 0.85rem; line-height: 1.4; }
.btn-follow-viewer { background: transparent; border: none; color: #FFFFFF; font-weight: 600; cursor: pointer; padding: 0; }
.viewer-ubicacion-row { font-size: 0.7rem; line-height: 1.4; opacity: 0.8; display: block; }

/* Contenedor de la descripción */
.viewer-desc-container {
    position: relative;
    max-width: 100%;
    margin-top: 4px;
    overflow: hidden;
    color: #FFFFFF;
}

.story-date-text {
    font-weight: 600;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9); /* Blanco con un toque de transparencia */
}

/* Aseguramos que el punto separador tenga buen espacio */
#viewer-desc {
    font-size: 0.85rem;
    color: #fff;
    line-height: 1.4;
    padding: 0 15px;
}

.desc-text {
    font-size: 0.8rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.9);
    display: inline;
    word-wrap: break-word;
}

.desc-text b {
    font-size: 0.7rem;
}

/* Cuando el texto está truncado */
.desc-text.truncated {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* Solo 2 líneas inicialmente */
    line-clamp: 2;
    overflow: hidden;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.9);
}

/* Estado cuando el texto está expandido */
.desc-text.expanded {
    display: block; /* Quita el truncado */
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

/* El botón "más" también debe ser pequeño para no desentonar */
.btn-ver-mas {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline;
    opacity: 0.7;
}
/* Habilitar zoom específicamente en la imagen del visor */
.zoomable-img {
    touch-action: pinch-zoom !important;
    max-width: 100%;
    height: auto;
}

.toast-container {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    justify-content: center;
}

.toast-msg.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px); /* Desenfoque de fondo */
    -webkit-backdrop-filter: blur(10px);
    color: #1A1A1A;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 12px 20px;
}

.toast-msg {
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-18px); }
    15% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-18px); }
}

#universal-post-viewer{
    overflow-y: auto;
}

#story-media-content {
    width: 100%;
    height: 100%; /* Ocupa el contenedor */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Alinea al inicio (arriba) */
    align-items: center;
    background: #000; /* Fondo negro para que no se vea vacío */
}

/*Menu de POSTS (3 puntos)*/
.btn-post-options {
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    color: #1A1A1A;
}

.btn-post-options:hover, .btn-post-options:active {
    color: #2E8B57;
}

.modal-opciones-overlay {
    display: none; /* Se cambia a flex con JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000; /* Asegúrate de que sea muy alto */
    justify-content: center;
    align-items: center;
}

.modal-opciones-content{
    background-color: #FFFFFF;
    position: relative;
    padding: 20px 30px;
    border-radius: 20px;
    font-size: 0.8rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

/* Estilos para la X */
.btn-cerrar-modal {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    color: #1A1A1A;
    font-size: 25px;
    padding: 5px;
    z-index: 10;
    transition: color 0.2s;
}

.btn-cerrar-modal:hover {
    color: #2E8B57; /* Cambia a un color más oscuro al pasar el mouse */
}

.opcion-modal{
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Alinea todo a la izquierda */
    margin-bottom: 10px;
    gap: 15px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
    line-height: 1.4;
}

.opcion-modal:active {
    background-color: #f5f5f5;
}

.opcion-modal.cancelar {
    justify-content: center; /* Centra el contenido */
    border-top: 1px solid #eee;
    margin-top: 5px;
    padding-top: 10px;
    font-weight: 700;
    color: #1A1A1A;
    text-transform: uppercase;
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
}

.opcion-modal .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    transition: font-variation-settings 0.2s ease;
    font-size: 28px;
    color: #50C878;
}

.opcion-textos {
    display: flex;
    flex-direction: column; /* Alinea los textos uno debajo del otro */
    gap: 0px;
}

/* Texto principal (Nombre de la opción) */
.titulo-opcion {
    font-size: 0.8rem;
    font-weight: 600;
    color: #323232;
    line-height: 1.4;
}

/* Texto secundario (Descripción) */
.subtitulo-opcion {
    font-size: 0.7rem;
    font-weight: 400;
    color: #757575; /* Gris para que resalte menos que el título */
}

/* 1. Reportar en rojo */
.opcion-reportar, 
.opcion-reportar .material-symbols-outlined {
    color: #e80202 !important; /* Rojo sistema */
}

/* 2. Iconos rellenables (Seguir y Guardar) */
#icon-seguir, #icon-guardar {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    transition: all 0.3s ease;
}