/**
 * Horarios en la ficha del producto (WPilot Bookings › Integraciones › YITH Booking › Horarios).
 *
 * Estructura:
 *   .wpbf-schedule             contenedor de la sección (y de las variables)
 *   .wpbf-schedule__title      título «Horarios» (estilo de los títulos de YITH y del tema)
 *   .wpbf-schedule__fields     fila con las tarjetas
 *   .wpbf-schedule__field      tarjeta de cada hora (la flecha es su ::after)
 *   .wpbf-schedule__label      etiqueta pequeña dentro de la tarjeta
 *   .wpbf-schedule__required   asterisco
 *   .wpbf-schedule__select     selector (ocupa toda la tarjeta)
 *   .wpbf-schedule__overtime   aviso de horas extra bajo las tarjetas (.is-blocked si no se puede reservar)
 *
 * Lo más rápido para adaptarlo al tema: cambiar las variables de aquí debajo.
 * Los colores por defecto son neutros: sirven en temas claros y oscuros.
 */

.wpbf-schedule {
    --wpbf-time-bg: transparent;                                 /* Fondo de cada tarjeta */
    --wpbf-time-border: rgba(127, 127, 127, 0.35);               /* Borde */
    --wpbf-time-accent: currentColor;                            /* Asterisco y borde al elegir */
    --wpbf-time-focus-ring: 0 0 0 3px rgba(127, 127, 127, 0.2);  /* Halo al elegir */
    --wpbf-time-label: inherit;                                  /* Color de la etiqueta */
    --wpbf-time-label-opacity: 0.7;                              /* Opacidad de la etiqueta */
    --wpbf-time-value: inherit;                                  /* Color de la hora */
    --wpbf-time-font: inherit;                                   /* Tipografía */
    --wpbf-time-radius: 8px;                                     /* Redondeo */
    --wpbf-time-option-bg: #fff;                                 /* Fondo de la lista desplegable */
    --wpbf-time-option-text: #1d1d1f;                            /* Texto de la lista desplegable */
    --wpbf-time-option-disabled: #a1a1a6;                        /* Horas sin unidades (la regla la añade el plugin siempre) */
    --wpbf-overtime-bg: rgba(127, 127, 127, 0.1);                /* Fondo del aviso de horas extra */
    --wpbf-overtime-text: inherit;                               /* Texto del aviso */
    --wpbf-overtime-error: #b32d2e;                              /* Aviso si no se puede reservar */
}

/* El título (.wpbf-schedule__title) toma el estilo de los títulos de sección de YITH y del tema. */

.wpbf-schedule__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.wpbf-schedule__field {
    position: relative;
    flex: 1 1 200px;
    min-width: 0;
    border: 1px solid var(--wpbf-time-border);
    border-radius: var(--wpbf-time-radius);
    background-color: var(--wpbf-time-bg);
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.wpbf-schedule__field:focus-within {
    border-color: var(--wpbf-time-accent);
    box-shadow: var(--wpbf-time-focus-ring);
}

/* Flecha: bordes con currentColor, así toma el color del texto sin imágenes. */
.wpbf-schedule__field::after {
    position: absolute;
    top: 50%;
    right: 20px;
    width: 7px;
    height: 7px;
    margin-top: -5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    color: var(--wpbf-time-value);
    content: "";
    pointer-events: none;
    transform: rotate(45deg);
}

.wpbf-schedule .wpbf-schedule__label {
    position: absolute;
    top: 16px;
    right: 44px;
    left: 16px;
    z-index: 1;
    margin: 0;
    overflow: hidden;
    color: var(--wpbf-time-label);
    font-family: var(--wpbf-time-font);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: var(--wpbf-time-label-opacity);
    pointer-events: none;
}

.wpbf-schedule__required {
    color: var(--wpbf-time-accent);
}

/* Dos clases para ganar a los estilos de select del tema y de YITH. */
.wpbf-schedule .wpbf-schedule__select {
    display: block;
    width: 100%;
    min-width: 0;
    height: auto;
    margin: 0;
    padding: 34px 44px 16px 16px;
    border: 0;
    border-radius: var(--wpbf-time-radius);
    background: transparent;
    box-shadow: none;
    color: var(--wpbf-time-value);
    font-family: var(--wpbf-time-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* Sin esto, en temas oscuros la lista desplegable hereda el texto claro sobre fondo blanco. */
.wpbf-schedule .wpbf-schedule__select option {
    background: var(--wpbf-time-option-bg);
    color: var(--wpbf-time-option-text);
}

.wpbf-schedule .wpbf-schedule__select:disabled {
    cursor: not-allowed;
}

.wpbf-schedule__field:has(.wpbf-schedule__select:disabled) {
    opacity: 0.6;
}

/* Aviso de horas extra («Devolver a las 16:00 supone 6 h extra: 27,00 €»). Vacío no ocupa sitio. */
.wpbf-schedule .wpbf-schedule__overtime {
    margin: 12px 0 0;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: var(--wpbf-time-radius);
    background-color: var(--wpbf-overtime-bg);
    color: var(--wpbf-overtime-text);
    font-family: var(--wpbf-time-font);
    font-size: 13px;
    line-height: 1.5;
}

.wpbf-schedule .wpbf-schedule__overtime:empty {
    display: none;
}

.wpbf-schedule .wpbf-schedule__overtime.is-blocked {
    border-color: currentColor;
    color: var(--wpbf-overtime-error);
}
