/**
 * ============================================================
 * COMPONENTE - BOTTOM SHEET (Panel Inferior Móvil)
 * ============================================================
 * Panel deslizable desde abajo para mostrar información
 * detallada de módulos en dispositivos móviles (<768px).
 * ============================================================
 */

/* --------------------------------------------------------
   BACKDROP MÓVIL (Reutilizado del drawer)
   -------------------------------------------------------- */
.bottom-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 32, 44, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

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

/* --------------------------------------------------------
   BOTTOM SHEET (Panel inferior)
   -------------------------------------------------------- */
.custom-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 85vh;
    background-color: #ffffff;
    z-index: 1050;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.custom-bottom-sheet.is-open {
    transform: translateY(0);
}

/* --------------------------------------------------------
   INDICADOR DE ARRASTRE (Drag Handle)
   -------------------------------------------------------- */
.bottom-sheet__drag-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px 0;
    flex-shrink: 0;
    cursor: grab;
}

.bottom-sheet__drag-indicator {
    width: 40px;
    height: 4px;
    background-color: #d1d5db;
    border-radius: 2px;
}

/* --------------------------------------------------------
   HEADER DEL BOTTOM SHEET
   -------------------------------------------------------- */
.bottom-sheet__header {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0 1.25rem 1rem 1.25rem;
    background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
    border-bottom: 1px solid #e9d5ff;
    flex-shrink: 0;
    position: relative;
}

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

.bottom-sheet__icon i {
    font-size: 1.25rem;
}

.bottom-sheet__content {
    flex: 1;
    min-width: 0;
    padding-right: 2rem;
}

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

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

/* Botón de cierre X */
.bottom-sheet__close-btn {
    position: absolute;
    top: 0;
    right: 1rem;
    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;
}

.bottom-sheet__close-btn:hover,
.bottom-sheet__close-btn:active {
    background-color: rgba(100, 116, 139, 0.1);
}

.bottom-sheet__close-btn:focus {
    outline: none;
}

/* --------------------------------------------------------
   BODY DEL BOTTOM SHEET (Contenido con scroll)
   -------------------------------------------------------- */
.bottom-sheet__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* --------------------------------------------------------
   SECCIONES DEL CONTENIDO
   -------------------------------------------------------- */
.bottom-sheet__section {
    margin-bottom: 1.5rem;
}

.bottom-sheet__section:last-child {
    margin-bottom: 0;
}

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

.bottom-sheet__section-title i {
    font-size: 0.8125rem;
}

/* Texto de explicación */
.bottom-sheet__section-text {
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
}

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

.bottom-sheet__functions-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.8125rem;
    color: #334155;
    line-height: 1.5;
}

.bottom-sheet__functions-item::before {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    background-color: #a78bfa;
    border-radius: 50%;
    margin-top: 0.45rem;
    flex-shrink: 0;
}

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

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

.bottom-sheet__benefits-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    flex-shrink: 0;
    margin-top: 0.0625rem;
}

.bottom-sheet__benefits-icon i {
    font-size: 0.9375rem;
}

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

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

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

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

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

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

/* --------------------------------------------------------
   IMAGEN ILUSTRATIVA
   -------------------------------------------------------- */
.bottom-sheet__image-container {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.bottom-sheet__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;
    -webkit-tap-highlight-color: transparent;
}

.bottom-sheet__image:active {
    transform: scale(0.98);
}

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

.bottom-sheet__image-hint i {
    margin-right: 0.25rem;
}

/* --------------------------------------------------------
   FOOTER DEL BOTTOM SHEET
   -------------------------------------------------------- */
.bottom-sheet__footer {
    padding: 1rem 1.25rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.bottom-sheet__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.25rem;
    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;
    -webkit-tap-highlight-color: transparent;
}

.bottom-sheet__cta:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, #5b3ba1 0%, #6d2ed8 100%);
}

.bottom-sheet__cta i {
    font-size: 1rem;
}

/* Botón "Entendido" secundario */
.bottom-sheet__understood-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1.25rem;
    margin-top: 0.625rem;
    background-color: transparent;
    color: #6b46c1;
    font-family: var(--font-family-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e9d5ff;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.bottom-sheet__understood-btn:active {
    background-color: #faf5ff;
}

/* --------------------------------------------------------
   BLOQUEO DE SCROLL DEL BODY
   -------------------------------------------------------- */
body.bottom-sheet-open {
    overflow: hidden !important;
}

html.bottom-sheet-open {
    overflow: hidden !important;
}

/* --------------------------------------------------------
   OCULTAR EN DESKTOP
   -------------------------------------------------------- */
@media (min-width: 768px) {
    .custom-bottom-sheet,
    .bottom-sheet-backdrop {
        display: none !important;
    }
}

/* --------------------------------------------------------
   AJUSTES PARA PANTALLAS MUY PEQUEÑAS
   -------------------------------------------------------- */
@media (max-height: 600px) {
    .custom-bottom-sheet {
        max-height: 90vh;
    }

    .bottom-sheet__header {
        padding: 0 1rem 0.75rem 1rem;
    }

    .bottom-sheet__body {
        padding: 1rem;
    }

    .bottom-sheet__footer {
        padding: 0.75rem 1rem;
    }
}

/* --------------------------------------------------------
   REDUCIR MOVIMIENTO
   -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .custom-bottom-sheet,
    .bottom-sheet-backdrop {
        transition: none;
    }
}
