/* ==============================================================
   AFEME - HOJA DE ESTILOS PRINCIPAL
   ============================================================== */

:root {
    --primary: #084d37;      /* Verde institucional AFEME */
    --secondary: #c59b3c;    /* Dorado institucional AFEME */
    --bg: #f0f2f5;           
    --text-main: #111b21;    
    --white: #ffffff;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: var(--bg); color: var(--text-main); margin: 0; padding: 0; }

/* --------------------------------------------------------------
   BARRA SUPERIOR Y CAMPANA DE NOTIFICACIONES 🔔
   -------------------------------------------------------------- */
.top-bar { background-color: var(--white); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.menu-btn { background: none; border: none; font-size: 24px; color: var(--primary); cursor: pointer; padding: 0; }
.logo-title { margin: 0; font-size: 1.5rem; color: #000; font-weight: 900; letter-spacing: -0.5px; cursor: pointer; }
.logo-title span { color: #000; }

.cart-btn { background: none; border: none; font-size: 24px; position: relative; cursor: pointer; padding: 0; }
.cart-badge { position: absolute; top: -5px; right: -8px; background-color: var(--secondary); color: var(--white); font-size: 11px; font-weight: bold; padding: 2px 6px; border-radius: 10px; border: 2px solid var(--white); }

/* NOTIFICACIONES ESTILO FACEBOOK */
.bell-container { position: relative; display: none; margin-right: 15px; } /* Oculto por defecto hasta loguearse */
.bell-btn { background: none; border: none; font-size: 24px; cursor: pointer; padding: 0; position: relative; transition: transform 0.2s; }
.bell-btn:hover { transform: scale(1.1); }
.bell-badge { position: absolute; top: -4px; right: -4px; background: #ea0037; color: white; font-size: 10px; font-weight: bold; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid white; }

.notif-panel { 
    position: fixed; /* Se desliga del botón y flota en la pantalla */
    top: 75px; 
    left: 50%; 
    transform: translateX(-50%); /* Lo centra perfectamente */
    width: 92%; 
    max-width: 380px; 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 8px 30px rgba(0,0,0,0.3); 
    border: 1px solid #ddd; 
    display: none; 
    flex-direction: column; 
    z-index: 2000; 
    overflow: hidden; 
    animation: slideDownCentered 0.2s ease forwards; 
}
.notif-panel.active { display: flex; }
@keyframes slideDownCentered { 
    from { opacity: 0; transform: translate(-50%, -10px); } 
    to { opacity: 1; transform: translate(-50%, 0); } 
}

.notif-header { background: var(--primary); color: white; padding: 12px 15px; font-size: 14px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.notif-body { max-height: 350px; overflow-y: auto; background: #f9f9f9; }
.notif-item { padding: 12px 15px; border-bottom: 1px solid #eee; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; transition: background 0.2s; background: white; }
.notif-item:hover { background: #f0f2f5; }
.notif-icon { width: 35px; height: 35px; border-radius: 50%; background: #e6f7f5; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.notif-text { flex: 1; font-size: 12px; color: #444; line-height: 1.4; }
.notif-title { font-weight: bold; color: #111b21; display: block; font-size: 13px; margin-bottom: 2px; }
.notif-time { font-size: 10px; color: #999; display: block; margin-top: 4px; }
.notif-empty { padding: 30px; text-align: center; color: #999; font-size: 13px; }

/* --------------------------------------------------------------
   MENÚ LATERAL (SIDEBAR)
   -------------------------------------------------------------- */
.overlay {
    display: none; /* Por defecto está oculto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Color negro con 60% de transparencia */
    z-index: 900; /* Se asegura de estar por encima de la página, pero por debajo del menú */
    opacity: 0; /* Inicia totalmente invisible */
    transition: opacity 0.3s ease; /* Efecto suave de 0.3 segundos */
}
.sidebar { position: fixed; top: 0; left: -280px; width: 280px; height: 100%; background: var(--white); z-index: 1000; transition: left 0.3s ease; box-shadow: 2px 0 15px rgba(0,0,0,0.1); }
.sidebar.open { left: 0; }
.sidebar-header { background: var(--primary); color: var(--white); padding: 20px; }
.sidebar-header h2 { margin: 0; font-size: 1.2rem; }
.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li a { display: flex; align-items: center; padding: 15px 20px; color: var(--text-main); text-decoration: none; border-bottom: 1px solid #eee; font-weight: 600; transition: background 0.2s; }
.sidebar-menu li a:hover { background: #f9f9f9; }
.sidebar-menu li a i { margin-right: 15px; font-size: 20px; font-style: normal; }

/* Estado normal (Escondido a la izquierda) */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Escondido por fuera del borde izquierdo */
    width: 280px;
    height: 100vh;
    background-color: var(--white);
    z-index: 999; /* Por encima del overlay oscuro */
    transition: left 0.3s ease; /* Movimiento de deslizamiento suave */
}

/* Estado abierto (Cuando JavaScript le pone la clase "open") */
.sidebar.open {
    left: 0; /* Se posiciona exactamente en el borde izquierdo, haciéndose visible */
}

/* --------------------------------------------------------------
   CONTENEDOR PRINCIPAL Y BUSCADOR
   -------------------------------------------------------------- */
.container { padding: 15px; max-width: 1200px; margin: 0 auto; }
.search-container { margin-bottom: 15px; }
.search-bar { width: 100%; padding: 15px 20px; border-radius: 25px; border: 1px solid #ddd; font-size: 16px; outline: none; box-shadow: 0 4px 10px rgba(0,0,0,0.03); box-sizing: border-box; transition: border-color 0.3s; }
.search-bar:focus { border-color: var(--primary); }

/* --------------------------------------------------------------
   CARRUSELES HORIZONTALES (VISTA DE INICIO)
   -------------------------------------------------------------- */
.carousel-track { display: flex; overflow-x: auto; gap: 15px; padding-bottom: 10px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > * { scroll-snap-align: start; flex-shrink: 0; }

.promo-banner { width: 280px; height: 130px; border-radius: 12px; object-fit: cover; box-shadow: 0 4px 10px rgba(0,0,0,0.1); cursor: pointer; border: 1px solid #eee; }
@media (min-width: 768px) { .promo-banner { width: 400px; height: 180px; } }

/* --------------------------------------------------------------
   NUEVAS CATEGORÍAS TIPO PÍLDORA (INICIO)
   -------------------------------------------------------------- */
.cat-pill-main {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #e9edef;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: #111b21;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.cat-pill-main:hover, 
.cat-pill-main.active {
    background: var(--primary); /* Verde AFEME #084d37 */
    color: #ffffff;
    border-color: var(--primary);
}
/* --------------------------------------------------------------
   TARJETAS DE TIENDA 
   -------------------------------------------------------------- */
.store-card { display: flex; align-items: center; background: white; padding: 12px; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid #f0f2f5; width: 280px; box-sizing: border-box; position: relative; overflow: hidden; }
.store-card-bg { position: absolute; top:0; left:0; width: 100%; height: 40px; background: var(--primary); z-index: 0; opacity: 0.1; }
.store-card-img { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; border: 2px solid white; margin-right: 12px; background: #fafafa; z-index: 1; position: relative; box-shadow: 0 2px 5px rgba(0,0,0,0.1); flex-shrink: 0; }
.store-card-info { flex: 1; display: flex; flex-direction: column; justify-content: center; z-index: 1; position: relative; min-width: 0; padding-right: 5px; }
.store-card-title { font-size: 14px; font-weight: 800; margin: 0 0 2px 0; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-card-subtitle { font-size: 11px; color: #667781; margin: 0 0 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-btn { background: var(--primary); color: white; font-weight: 800; border: none; padding: 8px 12px; border-radius: 8px; font-size: 11px; cursor: pointer; z-index: 1; position: relative; flex-shrink: 0; }

/* --------------------------------------------------------------
   TARJETAS DE PRODUCTO (Carrusel y Grilla)
   -------------------------------------------------------------- */
.product-card { background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.04); border: 1px solid #e9edef; display: flex; flex-direction: column; transition: transform 0.2s; position: relative; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.08); }
.carousel-track .product-card { width: 150px; }
@media (min-width: 768px) { .carousel-track .product-card { width: 200px; } }
.store-grid .product-card { width: 100%; }

.product-img { width: 100%; height: 140px; object-fit: contain; background: #ffffff; padding: 10px; box-sizing: border-box; border-bottom: 1px solid #f0f2f5; cursor: pointer; }
.product-info { padding: 12px; flex: 1; display: flex; flex-direction: column; cursor: pointer; }
.store-name { font-size: 10px; color: var(--primary); text-transform: uppercase; font-weight: 800; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-title { margin: 0 0 5px 0; font-size: 13px; color: var(--text-main); font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 34px; }
.product-price { font-weight: 900; color: var(--text-main); font-size: 15px; margin-top: auto; }
.btn-add { background: #e6f7f5; color: var(--primary); border: none; padding: 10px; font-weight: 900; font-size: 13px; cursor: pointer; border-top: 1px solid #e9edef; transition: background 0.2s; width: 100%; }
.btn-add:hover { background: var(--primary); color: var(--white); }

/* --------------------------------------------------------------
   GRILLA DE TIENDA PROFESIONAL Y CATEGORÍAS 
   -------------------------------------------------------------- */
.store-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
    padding: 5px 0 40px 0; /* 🟢 Margen inferior ajustado para móviles */
    align-content: start;  /* 🟢 LA SOLUCIÓN: Obliga a los productos a agruparse arriba sin dejar huecos */
    height: max-content; 
}
@media (min-width: 768px) { 
    .store-grid { 
        grid-template-columns: repeat(4, 1fr); 
        gap: 20px; 
    } 
}

.internal-category-bar { display: flex; overflow-x: auto; gap: 8px; padding: 10px 0; margin-bottom: 15px; scrollbar-width: none; }
.internal-category-bar::-webkit-scrollbar { display: none; }
.cat-pill { padding: 8px 16px; background: white; border: 1px solid #ddd; border-radius: 20px; font-size: 12px; font-weight: bold; white-space: nowrap; cursor: pointer; transition: 0.2s; }
.cat-pill.active { background: var(--primary); color: white; border-color: var(--primary); }

.portada-tienda-header { height: 160px; background-color: var(--primary); background-size: cover; background-position: center; border-radius: 12px; margin-bottom: 40px; position: relative; }
.logo-tienda-header { width: 80px; height: 80px; border-radius: 50%; border: 4px solid white; position: absolute; bottom: -30px; left: 20px; background: #eee; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
@media (min-width: 768px) { .portada-tienda-header { height: 320px; border-radius: 16px; } .logo-tienda-header { width: 120px; height: 120px; bottom: -40px; left: 30px; border-width: 5px; } }

/* --------------------------------------------------------------
   PIE DE PÁGINA Y TÍTULOS
   -------------------------------------------------------------- */
.site-footer { background: var(--text-main); color: white; text-align: center; padding: 30px 20px; margin-top: 40px; font-size: 12px; border-top-left-radius: 20px; border-top-right-radius: 20px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin: 25px 0 15px; }
.section-title { font-size: 15px; color: #111b21; font-weight: 900; margin: 0; }
.section-link { font-size: 12px; color: var(--primary); font-weight: bold; cursor: pointer; text-decoration: none; }

/* --------------------------------------------------------------
   MODALES Y FORMULARIOS
   -------------------------------------------------------------- */
.modal-base { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1000; justify-content: center; align-items: flex-end; }
.modal-content-base { background: white; width: 100%; border-radius: 20px 20px 0 0; padding: 20px; position: relative; max-width: 600px; animation: slideUp 0.3s; max-height: 90vh; overflow-y: auto; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.close-modal-btn { position: absolute; top: 10px; right: 15px; font-size: 28px; font-weight: bold; color: #666; cursor: pointer; background: white; border: none; border-radius: 50%; width: 35px; height: 35px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 10; display: flex; align-items: center; justify-content: center; line-height: 1; }

.form-checkout { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 12px; font-size: 14px; outline: none; background: #f9f9f9; box-sizing: border-box; }
.form-checkout:focus { border-color: var(--primary); background: white; }

.cart-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1001; opacity: 0; transition: opacity 0.3s; }
.cart-sidebar-panel { position: fixed; top: 0; right: -350px; width: 100%; max-width: 350px; height: 100%; background: white; z-index: 1002; transition: right 0.3s ease; box-shadow: -5px 0 15px rgba(0,0,0,0.1); display: flex; flex-direction: column; }
.cart-sidebar-panel.open { right: 0; }
.cart-header { background: var(--primary); color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; }
.cart-body { flex: 1; overflow-y: auto; padding: 20px; }
.cart-footer { padding: 20px; border-top: 1px solid #eee; background: #f9f9f9; }
.btn-checkout { width: 100%; background: var(--secondary); color: white; border: none; padding: 15px; border-radius: 25px; font-weight: bold; font-size: 16px; cursor: pointer; }
.qty-btn { background: #eee; border: none; width: 25px; height: 25px; border-radius: 5px; font-weight: bold; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty-display { font-weight: bold; width: 25px; text-align: center; font-size: 14px; }

/* ==============================================================
   EFECTO DE TIENDA CERRADA O PAUSADA 🚫
   ============================================================== */
.producto-bloqueado {
    filter: grayscale(100%);
    opacity: 0.5;
    pointer-events: none; /* Esto desactiva todos los clics y botones */
    position: relative;
}

.etiqueta-cerrado {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(234, 0, 55, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 14px;
    z-index: 10;
    letter-spacing: 1px;
}

/* ==================================================== */
/* 📇 TARJETAS DEL DIRECTORIO HÍBRIDO (TIENDA + CITAS)  */
/* ==================================================== */

.grid-directorio {
    display: grid;
    /* Adaptable: 1 columna en celulares pequeños, 2 en más grandes */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    gap: 12px;
    padding: 15px;
}

.tarjeta-directorio {
    background: #1f2c34; /* Gris oscuro exacto de las tarjetas de tu app */
    border-radius: 12px;
    border: 1px solid #2a3942; /* Borde sutil del modo oscuro */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* Portada superior de la tarjeta */
.dir-portada {
    width: 100%;
    height: 75px;
    background-color: #111b21;
    background-size: cover;
    background-position: center;
}

/* Contenedor de información (Logo + Textos) */
.dir-info-body {
    padding: 0 10px 12px;
    text-align: center;
    flex: 1; 
    display: flex;
    flex-direction: column;
}

.dir-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1f2c34; /* Mismo fondo de la tarjeta para fusionarse */
    margin: -30px auto 8px; 
    background: #ffffff;
}

.dir-nombre {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e9edef; /* Blanco suave del modo oscuro */
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.dir-verificado {
    color: #2b73f6; /* El azul exacto del logo "Caquetá Vende" de tu header */
    font-size: 0.9rem;
}

.dir-categoria {
    font-size: 0.75rem;
    color: #8696a0; /* Gris texto secundario */
    margin-bottom: 12px;
    text-transform: capitalize;
}

/* Contenedor dinámico de botones */
.dir-botones-wrapper {
    display: flex;
    gap: 8px;
    padding: 0 10px 12px;
}

.btn-dir {
    flex: 1; 
    padding: 10px 5px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    color: #ffffff;
}

/* Colores integrados con la paleta de Caquetá Vende */
.btn-dir-tienda { 
    background: #00a884; /* Verde acento principal de tu plataforma */
} 

.btn-dir-citas { 
    background: #2b73f6; /* Azul corporativo de tu marca */
} 

.btn-dir-basico { 
    background: #111b21; /* Fondo principal de la app */
    color: #00a884; 
    border: 1px solid #00a884; 
}

/* =========================================
   SISTEMA DE PESTAÑAS (INICIO)
========================================= */
.tabs-container {
    display: flex;
    background: white;
    border-bottom: 2px solid #e9edef;
    position: sticky;
    top: 0;
    z-index: 50;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    font-weight: bold;
    color: #54656f;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 15px;
}

.tab-item.active {
    color: #ea0037; 
    border-bottom: 3px solid #ea0037;
    background: #fffafa; 
}

/* =========================================
   DISEÑO DEL MURO DE PROMOCIONES
========================================= */
.promo-card {
    background: white;
    border-radius: 12px;
    margin: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e9edef;
}

.promo-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 10px;
}

.promo-logo {
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    object-fit: cover;
    border: 1px solid #eee;
}

.promo-negocio-nombre {
    font-weight: 800; 
    font-size: 14px; 
    color: #111b21; 
    margin: 0;
}

.promo-tiempo {
    font-size: 12px; 
    color: #8696a0; 
    margin: 0;
}

.promo-img {
    width: 100%; 
    height: auto; 
    max-height: 400px; 
    object-fit: cover;
}

.promo-body {
    padding: 15px;
}

.promo-titulo {
    font-size: 16px; 
    font-weight: bold; 
    margin: 0 0 15px 0; 
    color: #111b21;
}

.promo-actions {
    display: flex; 
    gap: 10px;
}

.btn-like {
    flex: 1; 
    padding: 12px; 
    background: #f0f2f5; 
    border: none; 
    border-radius: 8px; 
    font-weight: bold; 
    color: #54656f; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 5px; 
    cursor: pointer; 
    transition: 0.2s;
    font-size: 15px;
}

.btn-like.liked {
    color: #ea0037; 
    background: #ffe3e3;
}

.btn-comprar {
    flex: 2; 
    padding: 12px; 
    background: #ea0037; 
    color: white; 
    border: none; 
    border-radius: 8px; 
    font-weight: bold; 
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(234, 0, 55, 0.2);
}

/* 🏠 ESTILOS LANDING PAGE DIRECTORIO */
.portada-pauta {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #ccc;
}

.contenedor-perfil-dir {
    position: relative;
    padding: 0 20px;
    margin-top: -50px; /* Sube el logo sobre la portada */
}

.logo-perfil-dir {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    border: 5px solid #f0f2f5;
    background: white;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.grid-botones-contacto {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.btn-contacto-dir {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    gap: 5px;
}

/* =========================================
   BOTONES DE CARRUSEL (VISTA PC)
========================================= */

/* Envoltorio relativo para poder posicionar los botones encima */
.carrusel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Diseño base del botón (Oculto en móviles por defecto) */
.btn-carrusel {
    display: none; 
    position: absolute;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    color: #008069;
    border: 1px solid #ddd;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

.btn-carrusel:hover {
    background: #008069;
    color: white;
    transform: scale(1.1);
}

/* Posiciones a los lados */
.btn-carrusel.left { left: 0px; }
.btn-carrusel.right { right: 0px; }

/* 🔥 SOLO MOSTRAR EN COMPUTADORES (Pantallas mayores a 768px) 🔥 */
@media (min-width: 768px) {
    .btn-carrusel {
        display: flex;
    }
    
    /* Opcional: Oculta la barra de scroll de abajo en PC para que se vea más limpio */
    .carrusel-wrapper > div::-webkit-scrollbar {
        display: none;
    }
    .carrusel-wrapper > div {
        -ms-overflow-style: none;
        scrollbar-width: none;
        scroll-behavior: smooth;
    }
}

/* =========================================
   ADAPTACIÓN PARA ESCRITORIO (MENÚ FIJO)
========================================= */
/* =========================================
   DISEÑO PARA NOVEDADES Y PROMOCIONES
========================================= */
/* 📱 1. VISTA MÓVIL (Por defecto: 1 sola columna) */
#feed-publicaciones,
#vista-promociones {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
}


@media (min-width: 992px) {
    .sidebar { 
        left: 0; 
        box-shadow: none; 
        border-right: 1px solid #e9edef; 
    }

    /* Transformar los contenedores a 2 columnas */
    #feed-publicaciones,
    #vista-promociones {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        align-items: start;
        align-content: start;
    }

    /* Evitar que las tarjetas de promociones se estiren demasiado verticalmente */
    .promo-card, .post-card {
        margin-bottom: 0 !important; 
    }

    /* Asegurar que los mensajes de "Cargando..." o "Vacío" no se queden en 1 sola columna */
    #feed-publicaciones > p,
    #vista-promociones > p,
    #vista-promociones > div[style*="text-align: center"] {
        grid-column: 1 / -1;
        width: 100%;
    }
}
    
    .top-bar { 
        margin-left: 280px; 
        /* 🟢 CORRECCIÓN: Usamos calc para que el ancho sea 100% menos el menú */
        width: calc(100% - 280px); 
        box-sizing: border-box; /* Asegura que el padding no sume al ancho */
    }
    
    .container { 
        margin-left: 280px; 
        max-width: calc(100% - 280px); 
    }
    
    .site-footer {
        margin-left: 280px; 
        width: calc(100% - 280px);
        border-radius: 0;
    }
    
    .menu-btn { 
        display: none; 
    }
    
    .overlay { 
        display: none !important; 
    }
}

/* =========================================
   DISEÑO DEL FEED DE PUBLICACIONES
========================================= */
.post-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9edef;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.post-media-container {
    position: relative;
    width: 100%;
    background: #000;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Oculta scrollbar */
}
.post-media-container::-webkit-scrollbar { display: none; }

.post-media-item {
    width: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
    aspect-ratio: 4 / 3; /* Proporción agradable para feed */
    object-fit: contain;
    background: #111b21;
}

.post-body {
    padding: 15px;
}

.post-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.post-short-desc {
    margin: 0 0 15px;
    font-size: 13px;
    color: #54656f;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-ver-mas {
    width: 100%;
    background: var(--primary); /* 🟢 Color principal visible desde el inicio */
    color: white; /* 🟢 Texto blanco contrastante */
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease; /* Transición suave para el color y el movimiento */
    box-shadow: 0 4px 10px rgba(8, 77, 55, 0.2); /* Sutil sombra para que resalte como botón */
}

.btn-ver-mas:hover { 
    background: #053626; /* 🟢 Un verde un poco más oscuro al pasar el mouse */
    box-shadow: 0 6px 14px rgba(8, 77, 55, 0.3); /* La sombra se intensifica */
    transform: translateY(-2px); /* Ligero efecto de elevación al hacer hover */
}

.post-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}
.post-nav-btn.left { left: 10px; }
.post-nav-btn.right { right: 10px; }

/* =========================================
   ESTILOS PARA PUBLICACIONES Y ADMIN MEDIA
========================================= */
/* Ajuste para que el video y su carátula mantengan el formato */
video.post-media-item {
    background: #000;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
}

/* Estilos para el constructor de media en Admin */
.media-field-item {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.media-field-item .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffe3e3;
    color: #ea0037;
    border: none;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}
.media-field-item label {
    font-size: 11px;
    font-weight: bold;
    color: #084d37;
}
.btn-outline-add {
    background: white;
    border: 1px dashed #084d37;
    color: #084d37;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    width: 48%;
}

/* =========================================
   CORRECCIÓN ESTRICTA PARA MÓVILES
========================================= */
@media (max-width: 991px) {
    /* Eliminamos el margen fantasma del menú lateral en celulares */
    .top-bar, 
    .container, 
    .site-footer, 
    #landing-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Forzamos a que las novedades y promos usen el ancho completo (1 columna) */
    #feed-publicaciones,
    #vista-promociones {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 20px !important;
    }

    /* Aseguramos que la imagen del carrusel ocupe bien el espacio en celular */
    .post-media-container {
        width: 100% !important;
    }
}

/* =========================================
   RESCATE DEL MENÚ HAMBURGUESA (MÓVIL)
========================================= */
@media (max-width: 991px) {
    /* Forzamos a que el botón aparezca sí o sí en celulares */
    .menu-btn, 
    #btn-abrir-menu {
        display: block !important;
    }
    
    /* Aseguramos que la barra superior se distribuya bien */
    .top-bar {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
}

/* =========================================
   ESTILOS PARA LANDING AFEME Y AFILIACIÓN
========================================= */
.form-label-afeme {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
    display: block;
}

/* =========================================
   DISEÑO PROFESIONAL - FORMULARIO AFILIACIÓN
========================================= */

/* 📱 1. VISTA MÓVIL (Por defecto: 1 Columna y márgenes optimizados) */
#afiliate-content {
    padding: 15px 10px 50px !important; /* Reducimos el espacio vacío a los lados */
}

#form-afiliacion-wrapper {
    padding: 25px 15px !important; 
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.06);
    background: white;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Garantiza que nada desborde hacia la derecha */
}

/* Sistema de Grilla Base */
.formulario-profesional {
    display: grid;
    grid-template-columns: 1fr; /* Una sola columna en celulares */
    gap: 15px;
    width: 100%;
}

.campo-full, .campo-mitad {
    width: 100%;
    box-sizing: border-box;
}

/* Diseño moderno para campos de texto */
.formulario-profesional .form-control {
    width: 100% !important;
    box-sizing: border-box;
    padding: 14px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background-color: #f9fafb;
    transition: all 0.3s ease;
    color: #333;
}

/* Efecto de foco profesional al tocar un input */
.formulario-profesional .form-control:focus {
    border-color: #084d37;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(8, 77, 55, 0.1);
    outline: none;
}

/* Cajas estéticas para agrupar opciones */
.caja-gris {
    background: #f8fafc;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

/* Lista de Casos Especiales en móvil */
.grilla-checkbox {
    display: grid;
    grid-template-columns: 1fr; /* 1 columna de opciones en celular */
    gap: 12px;
    font-size: 13px;
    color: #475569;
}


/* 💻 2. VISTA ESCRITORIO (Dos Columnas Simétricas) */
@media (min-width: 768px) {
    #afiliate-content {
        padding: 40px 20px 60px !important;
    }

    #form-afiliacion-wrapper {
        padding: 40px !important; 
        max-width: 850px;
        margin: 0 auto;
    }

    /* Activamos las 2 columnas */
    .formulario-profesional {
        grid-template-columns: repeat(2, 1fr); 
        gap: 20px;
    }

    /* Los campos marcados como 'full' ocuparán ambas columnas (como el Nombre o la Firma) */
    .campo-full {
        grid-column: 1 / -1;
    }

    /* La lista de Casos Especiales se vuelve de 3 columnas para ahorrar espacio */
    .grilla-checkbox {
        grid-template-columns: repeat(3, 1fr); 
    }
}

/* =========================================
   BADGE DE NOTIFICACIÓN PARA MENÚ
========================================= */
.badge-notificacion {
    background-color: #ea0037; /* Rojo llamativo estilo notificación */
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    min-width: 14px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(234, 0, 55, 0.4);
    animation: pulso-notificacion 2s infinite; /* Efecto sutil de latido */
}

@keyframes pulso-notificacion {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* =========================================
   SOLUCIÓN DEFINITIVA: ESPACIOS EN BLANCO Y FOOTER
========================================= */

/* 1. Arquitectura "Sticky Footer" (Ancla el pie de página al fondo) */
body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important; /* Garantiza que el cuerpo mida al menos el 100% de la pantalla */
}

main.container {
    flex: 1 0 auto !important; /* Obliga al contenedor a estirarse y llenar el hueco vacío */
    display: flex;
    flex-direction: column;
}

.site-footer {
    flex-shrink: 0 !important;
    margin-top: auto !important; /* Empuja el footer siempre al límite inferior de la pantalla */
}

/* 2. Blindar la grilla para eliminar alturas fantasmas */
#grid-todos-productos,
#pantalla-inicio-normal,
#home-content {
    height: auto !important;
    min-height: auto !important;
}

.store-grid {
    align-content: start !important;
    height: auto !important; 
    min-height: auto !important;
    padding-bottom: 30px !important;
}

/* =========================================
   BOTONES DE INTERACCIÓN (ME GUSTA / COMENTAR)
========================================= */
.post-actions {
    display: flex; 
    gap: 10px; 
    margin-top: 15px; 
    border-top: 1px solid #f0f2f5; 
    padding-top: 12px;
}

.btn-interaccion {
    flex: 1; 
    background: transparent; 
    border: none; 
    font-weight: 800; 
    color: #54656f; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    font-size: 13px; 
    padding: 10px; 
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-interaccion:hover {
    background: #f0f2f5;
}

/* Cuando el usuario le da "Me Gusta", se pinta de tu color principal */
.btn-interaccion.liked {
    color: var(--primary);
    background: #e6f7f5;
}

/* Diseño de las burbujas de comentarios */
.burbuja-comentario {
    background: #f0f2f5;
    padding: 12px 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    position: relative;
}
.comentario-autor { font-weight: 800; font-size: 13px; color: #111b21; margin: 0 0 4px 0; }
.comentario-texto { font-size: 13px; color: #444; margin: 0; line-height: 1.4; }
.comentario-fecha { font-size: 10px; color: #8696a0; display: block; margin-top: 6px; }

/* =========================================
   DISEÑO DE REACCIONES Y MODERACIÓN 
========================================= */
.burbuja-comentario {
    background: #f0f2f5;
    padding: 12px 15px 25px 15px; /* Espacio extra abajo para las reacciones */
    border-radius: 15px;
    margin-bottom: 18px;
    position: relative;
    border: 1px solid #e9edef;
}

/* El botón de eliminar (Solo visible para ti) */
.btn-eliminar-comentario {
    position: absolute;
    top: -8px;
    right: -5px;
    background: #ea0037;
    color: white;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(234, 0, 55, 0.3);
    transition: transform 0.2s;
}
.btn-eliminar-comentario:hover { transform: scale(1.1); }

/* =========================================
   REACCIONES INTELIGENTES Y ANIMADAS 
========================================= */
.barra-reacciones {
    position: absolute;
    bottom: -15px;
    right: 15px;
    background: white;
    border-radius: 20px;
    padding: 3px 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 4px;
    border: 1px solid #e9edef;
    transition: all 0.3s ease;
}

/* Cuando está colapsada, oculta a todos los que NO tienen la clase "elegida" */
.barra-reacciones.colapsada .btn-reaccion:not(.elegida) {
    display: none;
}

.btn-reaccion {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 15px;
    transition: background 0.2s, transform 0.2s;
}

.btn-reaccion:hover { background: #f0f2f5; transform: scale(1.1); }

/* Estilo para la reacción que el usuario seleccionó */
.btn-reaccion.elegida {
    background: #e6f7f5; /* Fondo verde clarito de Afeme */
    border: 1px solid rgba(8, 77, 55, 0.2);
}

.btn-reaccion span { font-size: 11px; font-weight: 900; color: #54656f; }

/* Animación Profesional tipo Apple (Rebote y Giro) */
@keyframes reboteMagico {
    0% { transform: scale(1); }
    40% { transform: scale(1.4) translateY(-5px) rotate(-10deg); }
    70% { transform: scale(0.9) translateY(2px) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.animacion-bounce {
    animation: reboteMagico 0.5s cubic-bezier(0.28, 0.84, 0.42, 1) forwards;
}

/* =========================================
   AJUSTE DE LAYOUT PARA PC CON MENÚ IZQUIERDO
========================================= */
@media (min-width: 992px) {
    /* Agregamos 20px extra al margen izquierdo para separarlo del panel */
    #main-app,
    .container,
    .main-content {
        margin-left: 280px !important; /* 260px del menú + 20px de espacio visual */
        width: calc(100% - 280px) !important; /* Le restamos ese mismo espacio al ancho total */
        max-width: none !important;
        padding-left: 10px !important;
        padding-right: 30px !important;
        box-sizing: border-box;
    }

    /* Le damos un poco de espacio interno extra a los títulos y barra de búsqueda superior */
    .header, 
    .store-header,
    .search-container {
        padding-left: 20px !important;
    }

    /* Aseguramos que los grids de productos se repartan bien y no se aprieten */
    .store-grid, 
    #grid-todos-productos {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 20px !important;
    }
}

/* =========================================
   LIGHTBOX PARA FOTOS DE PRODUCTOS
========================================= */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}
.lightbox-img {
    max-width: 95%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
    cursor: zoom-out;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
    z-index: 10000;
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.4);
}
@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}