/**
 * ============================================================
 * COMPONENTE - DRAWER (Panel Lateral)
 * ============================================================
 * Panel lateral deslizable para mostrar información detallada
 * de módulos. Solo activo en desktop (768px+).
 * ============================================================
 */

/* --------------------------------------------------------
   BACKDROP (Fondo translúcido)
   -------------------------------------------------------- */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 32, 44, 0.4);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* --------------------------------------------------------
   DRAWER (Panel lateral)
   -------------------------------------------------------- */
.custom-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: #ffffff;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.custom-drawer.is-open {
    transform: translateX(0);
}

/* Ancho adaptable en pantallas más angostas */
@media (max-width: 520px) {
    .custom-drawer {
        width: 100%;
    }
}

@media (min-width: 521px) and (max-width: 768px) {
    .custom-drawer {
        width: 380px;
    }
}

/* --------------------------------------------------------
   HEADER DEL DRAWER
   -------------------------------------------------------- */
.drawer-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
    border-bottom: 1px solid #e9d5ff;
    flex-shrink: 0;
}

.drawer-header__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, #6b46c1 0%, #7c3aed 100%);
    border-radius: 0.75rem;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.drawer-header__icon i {
    font-size: 1.5rem;
}

.drawer-header__content {
    flex: 1;
    min-width: 0;
}

.drawer-header__title {
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.375rem 0;
    line-height: 1.3;
}

.drawer-header__description {
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Botón de cierre */
.drawer-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: transparent;
    border: none;
    border-radius: 50%;
    color: #94a3b8;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 0;
    padding: 0;
    padding-bottom: 2px;
}

.drawer-close-btn:hover {
    background-color: rgba(100, 116, 139, 0.1);
}

.drawer-close-btn:focus {
    outline: none;
}

/* --------------------------------------------------------
   BODY DEL DRAWER (Contenido con scroll)
   -------------------------------------------------------- */
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------
   SECCIONES DEL CONTENIDO
   -------------------------------------------------------- */
.drawer-section {
    margin-bottom: 1.75rem;
}

.drawer-section:last-child {
    margin-bottom: 0;
}

.drawer-section__title {
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b46c1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.drawer-section__title i {
    font-size: 0.875rem;
}

/* Texto de explicación */
.drawer-section__text {
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.9375rem;
    color: #475569;
    line-height: 1.7;
    margin: 0;
}

/* --------------------------------------------------------
   LISTA DE FUNCIONES
   -------------------------------------------------------- */
.drawer-functions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.drawer-functions-list__item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.5rem 0;
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
}

.drawer-functions-list__item::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background-color: #a78bfa;
    border-radius: 50%;
    margin-top: 0.5rem;
    flex-shrink: 0;
}

/* --------------------------------------------------------
   LISTA DE BENEFICIOS
   -------------------------------------------------------- */
.drawer-benefits-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.drawer-benefits-list__item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0;
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
}

.drawer-benefits-list__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.drawer-benefits-list__icon i {
    font-size: 1rem;
}

/* --------------------------------------------------------
   BADGES DE PLANES DISPONIBLES
   -------------------------------------------------------- */
.drawer-plans-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.drawer-plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 2rem;
    white-space: nowrap;
}

/* Colores por plan */
.drawer-plan-badge--gratis {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.drawer-plan-badge--personal {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.drawer-plan-badge--basico {
    background-color: #faf5ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

.drawer-plan-badge--premium {
    background-color: #fefce8;
    color: #a16207;
    border: 1px solid #fde047;
}

/* --------------------------------------------------------
   IMAGEN ILUSTRATIVA
   -------------------------------------------------------- */
.drawer-image-container {
    margin-top: 0.5rem;
    position: relative;
}

.drawer-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: block;
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.drawer-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.drawer-image-hint {
    display: block;
    text-align: center;
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

.drawer-image-hint i {
    margin-right: 0.25rem;
}

/* --------------------------------------------------------
   FOOTER DEL DRAWER
   -------------------------------------------------------- */
.drawer-footer {
    padding: 1rem 1.5rem;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.drawer-footer__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #6b46c1 0%, #7c3aed 100%);
    color: #ffffff;
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

.drawer-footer__cta:hover {
    background: linear-gradient(135deg, #5b3ba1 0%, #6d2ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.4);
    color: #FFFFFF;
}

.drawer-footer__cta i {
    font-size: 1rem;
}

/* --------------------------------------------------------
   BLOQUEO DE SCROLL DEL BODY
   -------------------------------------------------------- */
body.drawer-open {
    overflow: hidden;
}

/* --------------------------------------------------------
   RESPONSIVE - Ocultar en móvil (usar otra solución)
   -------------------------------------------------------- */
@media (max-width: 767px) {
    .custom-drawer,
    .drawer-backdrop {
        display: none !important;
    }
}

/* ============================================================
   LIGHTBOX - Visualizador de imágenes a pantalla completa
   ============================================================ */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-lightbox.is-visible {
    opacity: 1;
    visibility: visible;
}

.image-lightbox__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.image-lightbox__content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox__image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.image-lightbox.is-visible .image-lightbox__image {
    transform: scale(1);
}

.image-lightbox__close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    color: #1e293b;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.image-lightbox__close:hover {
    background-color: #ffffff;
    transform: scale(1.1);
}

/* Ajustes para móvil */
@media (max-width: 767px) {
    .image-lightbox__close {
        top: 1rem;
        right: 1rem;
        width: 2.75rem;
        height: 2.75rem;
    }

    .image-lightbox__content {
        max-width: 95vw;
        max-height: 85vh;
    }

    .image-lightbox__image {
        max-height: 85vh;
    }
}
