/* BP Prestamito — Estilos Públicos */
/* Solo estilos funcionales: combobox custom, spinner, mensajes. */
/* Todo lo demás lo hereda de Elementor (ya cargado en el sitio). */

/* ===== WRAPPER ===== */
.bpp-wrapper {
    --bpp-purple: #651480;
    --bpp-orange: #ff6600;
}

/* ===== LAYOUT FORMULARIO ===== */
.bpp-wrapper .elementor-form-fields-wrapper {
    display: flex;
    flex-wrap: wrap;
}

.bpp-wrapper .elementor-field-group {
    padding: 0 10px;
    box-sizing: border-box;
    margin-bottom: 12px;
}

/* ===== COMBOBOX BUSCABLE ===== */
.bpp-wrapper .bpp-combo {
    position: relative;
}

.bpp-wrapper .bpp-combo__input {
    padding-right: 30px;
    cursor: pointer;
}

.bpp-wrapper .bpp-combo .select-caret-down-wrapper {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    cursor: pointer;
    line-height: 1;
}

.bpp-wrapper .bpp-combo__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
}

.bpp-wrapper .bpp-combo__option {
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.1s;
}

.bpp-wrapper .bpp-combo__option:hover,
.bpp-wrapper .bpp-combo__option--active {
    background-color: var(--bpp-purple);
    color: #fff;
}

.bpp-wrapper .bpp-combo__empty {
    padding: 8px 10px;
    font-size: 13px;
    color: #999;
    font-style: italic;
}

.bpp-wrapper .bpp-combo--error .bpp-combo__input {
    border-color: #c62828;
}

.bpp-wrapper .bpp-combo--disabled .bpp-combo__input {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.bpp-wrapper .bpp-combo--disabled .select-caret-down-wrapper {
    pointer-events: none;
    color: #999;
}

/* ===== JQUERY UI DATEPICKER ===== */
.ui-datepicker {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    padding: 8px;
    font-family: inherit;
    font-size: 13px;
    z-index: 10000 !important;
    width: auto;
}

.ui-datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 8px;
    background: none;
    border: none;
    border-bottom: 1px solid #eee;
    margin-bottom: 6px;
}

.ui-datepicker-prev,
.ui-datepicker-next {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 14px;
    color: var(--bpp-purple, #651480);
    position: relative;
    top: auto;
    left: auto;
    right: auto;
}

.ui-datepicker-prev:hover,
.ui-datepicker-next:hover {
    background: #f0f0f0;
}

.ui-datepicker-prev .ui-icon,
.ui-datepicker-next .ui-icon {
    display: none;
}

.ui-datepicker-prev::after {
    content: '\2039';
    font-size: 20px;
    line-height: 1;
}

.ui-datepicker-next::after {
    content: '\203A';
    font-size: 20px;
    line-height: 1;
}

.ui-datepicker-title {
    display: flex;
    gap: 4px;
    align-items: center;
}

.ui-datepicker-title select {
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

.ui-datepicker table {
    width: 100%;
    border-collapse: collapse;
}

.ui-datepicker th {
    padding: 4px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #666;
}

.ui-datepicker td {
    padding: 1px;
    text-align: center;
}

.ui-datepicker td a,
.ui-datepicker td span {
    display: block;
    padding: 4px 6px;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    text-align: center;
}

.ui-datepicker td a:hover {
    background-color: #f0f0f0;
}

.ui-datepicker .ui-datepicker-today a {
    background-color: #f5f0f8;
    font-weight: 600;
}

.ui-datepicker .ui-state-active {
    background-color: var(--bpp-purple, #651480);
    color: #fff;
}

/* ===== SECCIONES (títulos dentro del form) ===== */
.bpp-wrapper .elementor-field-type-html {
    font-weight: 700;
    color: var(--bpp-purple);
    font-size: 16px;
    padding: 12px 10px 4px;
    border-bottom: 2px solid var(--bpp-orange);
    margin-bottom: 4px;
}

/* ===== MENSAJES ===== */
.bpp-wrapper .bpp-message {
    padding: 16px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.bpp-wrapper .bpp-message--error {
    background-color: #fce4e4;
    border: 1px solid #c62828;
    color: #c62828;
}

.bpp-wrapper .bpp-message--success {
    background-color: #e8f5e9;
    border: 1px solid #2e7d32;
    color: #2e7d32;
}

.bpp-wrapper .bpp-message__title {
    font-size: 20px;
    margin: 0 0 8px 0;
}

.bpp-wrapper .bpp-message__text {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.bpp-wrapper .bpp-message__text:last-child {
    margin-bottom: 0;
}

.bpp-wrapper .bpp-message__lista {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.bpp-wrapper .bpp-message__lista li {
    margin-bottom: 4px;
    font-size: 14px;
}

.bpp-wrapper .bpp-message__lista li:last-child {
    margin-bottom: 0;
}

/* ===== ANIMACIÓN PUNTOS (cargando...) ===== */
.bpp-puntos::after {
    content: '';
    animation: bpp-puntos 1.2s steps(4, end) infinite;
}

@keyframes bpp-puntos {
    0%  { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ===== SPINNER OVERLAY ===== */
.bpp-wrapper .bpp-spinner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.bpp-wrapper .bpp-spinner-overlay--active {
    display: flex;
}

.bpp-wrapper .bpp-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #fff;
    border-top-color: var(--bpp-orange);
    border-radius: 50%;
    animation: bpp-spin 0.8s linear infinite;
}

@keyframes bpp-spin {
    to {
        transform: rotate(360deg);
    }
}
