/* Reseteo local */
#btpr-container * {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

#btpr-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 9999; 
    color: #1a3153; 
}

/* La barra buscador principal */
.btpr-wrapper {
    background: #ffffff;
    border-radius: 50px;
    padding: 6px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 10000;
}

/* Secciones */
.btpr-section {
    flex: 1;
    position: relative; 
}

.btpr-border-right {
    border-right: 1px solid #f1f5f9;
}

/* Botones disparadores */
.btpr-trigger-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 40px;
    transition: background 0.2s;
    outline: none;
}

.btpr-trigger-btn:hover, .btpr-trigger-btn.active {
    background-color: #f8fafc;
}

.btpr-label {
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #1a3153;
    margin-bottom: 4px;
}

.btpr-value {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #1a3153;
}

.btpr-value.placeholder {
    font-weight: 400;
    color: #94a3b8; 
}

/* PANELES FLOTANTES */
.btpr-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 24px;
    width: 90%;
    max-width: 380px;
    
    z-index: 2147483647 !important;
    border: 1px solid #f1f5f9;
    
    max-height: 90vh;
    overflow-y: auto;
    
    /* Evita el rebote de scroll en iOS */
    overscroll-behavior: contain;
    
    box-shadow: 0 0 0 100vmax rgba(0,0,0,0.4), 0 20px 50px rgba(0,0,0,0.2);
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
}

.btpr-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.hidden { display: none !important; }

/* Títulos */
.btpr-panel-title {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #1a3153;
    margin: 0 0 15px 5px;
}

/* Opciones Destino */
.dest-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: none;
    background: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    color: #1a3153;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.1s;
}
.dest-option:hover { background-color: #f1f5f9; }
.dest-option i { color: #cbd5e1; width: 20px; }

/* Calendario Cabecera */
.btpr-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.btpr-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: #1a3153;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btpr-nav-btn:hover { background-color: #f1f5f9; }
.btpr-nav-btn.hidden-arrow { visibility: hidden; pointer-events: none; }

.btpr-month-title {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    color: #1a3153;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
}
.btpr-month-title:hover { background: #f1f5f9; }

/* Grid Días - TAMAÑO FIJO PARA EVITAR SALTOS */
.btpr-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 10px;
    font-weight: 900;
    color: #cbd5e1;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.btpr-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    touch-action: pan-y;
    /* Altura mínima para asegurar que siempre quepan 6 filas visualmente estables */
    min-height: 240px; 
}

.btpr-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    border-radius: 50%;
    cursor: pointer;
    color: #1a3153;
}

/* Días vacíos (padding) para mantener la estructura */
.btpr-day.empty {
    cursor: default;
    pointer-events: none;
}

.btpr-day:hover:not(.disabled):not(.selected):not(.empty) { background-color: #f1f5f9; }

.btpr-day.selected {
    background-color: #1a3153;
    color: white;
}

.btpr-day.disabled {
    color: #cbd5e1;
    pointer-events: none;
    text-decoration: line-through;
    opacity: 0.4;
}

/* Grid Meses */
.btpr-months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.btpr-month-option {
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: none;
    font-size: 12px;
    font-weight: 700;
    color: #1a3153;
    cursor: pointer;
    text-transform: uppercase;
}
.btpr-month-option:hover:not(.disabled) { background: #e2e8f0; }
.btpr-month-option.selected { background: #1a3153; color: white; }
.btpr-month-option.disabled { opacity: 0.3; pointer-events: none; }

/* Footer Botones */
.btpr-cal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
    padding-left: 15px;
    padding-right: 15px;
}

/* BOTÓN SKIP CORREGIDO: MISMO COLOR QUE NÚMEROS */
.btpr-text-btn {
    background: none;
    border: none;
    font-size: 11px;
    font-weight: 900;
    color: #1a3153; /* Azul oscuro oficial */
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 1px;
    opacity: 1; /* Opacidad completa */
}
.btpr-text-btn:hover { opacity: 0.7; }

.btpr-solid-btn {
    background-color: #d57b12; 
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 1px;
    transition: transform 0.1s;
    box-shadow: 0 4px 10px rgba(213, 123, 18, 0.2);
}
.btpr-solid-btn:active { transform: scale(0.95); }

/* Buscador */
.btpr-search-box { padding-left: 5px; }

.btpr-search-btn {
    background-color: #d57b12;
    color: white;
    border: none;
    height: 48px;
    width: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(213, 123, 18, 0.3);
    transition: transform 0.1s;
}
.btpr-search-btn:active { transform: scale(0.95); }
.mobile-only { display: none; }

@media (max-width: 768px) {
    .btpr-wrapper {
        flex-direction: column;
        border-radius: 24px;
        padding: 10px;
        align-items: stretch;
        gap: 5px;
    }
    .btpr-border-right { border-right: none; border-bottom: 1px solid #f1f5f9; }
    
    .btpr-search-btn {
        width: 100%;
        border-radius: 16px;
        gap: 10px;
    }
    .mobile-only { display: inline; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }
}