/* =========================================================
   Canyon Niçois Booking — Styles front
   ========================================================= */

/* =========================================================
   BOUTON — reset complet pour hériter du .btn-resa du thème
   sans aucune interférence
   ========================================================= */
button.cnb-btn-open,
button.cnb-btn-open:focus,
button.cnb-btn-open:active {
    outline: none;
    border: none;
    box-shadow: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

/* =========================================================
   LISTE DÉROULANTE (shortcode canyon_booking_select)
   ========================================================= */
.cnb-select-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cnb-canyon-select {
    padding: 1.1rem 2rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: inherit;
    font-size: inherit;
    letter-spacing: 1px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    transition: border-color 0.2s;
}

.cnb-canyon-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.7);
}

.cnb-canyon-select option {
    background: #0d2233;
    color: #fff;
}

/* Bouton désactivé tant qu'aucun canyon n'est sélectionné */
button.cnb-btn-open[disabled],
button.cnb-btn-open:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================================================
   MODAL
   ========================================================= */
.cnb-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cnb-modal.is-open {
    display: flex;
}

.cnb-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.cnb-modal-container {
    position: relative;
    background: #0d2233;
    color: #fff;
    border-radius: 4px;
    padding: 40px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cnb-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: transparent;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 4px 10px;
    transition: color 0.2s;
}

.cnb-modal-close:hover {
    color: #fff;
}

.cnb-modal-header {
    margin-bottom: 28px;
    padding-right: 40px;
}

.cnb-modal-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
}

.cnb-modal-subtitle {
    margin: 0;
    color: #3ecfbf;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================================
   FORMULAIRE
   ========================================================= */
.cnb-form-row {
    margin-bottom: 18px;
}

.cnb-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cnb-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cnb-form-row input,
.cnb-form-row textarea,
.cnb-form-row select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 3px;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.cnb-form-row input:focus,
.cnb-form-row textarea:focus {
    outline: none;
    border-color: #3ecfbf;
}

.cnb-form-row input::placeholder,
.cnb-form-row textarea::placeholder {
    color: rgba(255,255,255,0.3);
}

.cnb-help {
    display: block;
    margin-top: 5px;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
}

/* Créneaux */
#cnb-slots-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cnb-slot-btn {
    padding: 12px 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cnb-slot-btn .cnb-slot-label {
    font-weight: 500;
}

.cnb-slot-btn .cnb-slot-remaining {
    font-size: 11px;
    opacity: 0.7;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.cnb-slot-btn:hover {
    background: rgba(62, 207, 191, 0.15);
    border-color: #3ecfbf;
    color: #3ecfbf;
}

.cnb-slot-btn.is-selected {
    background: #3ecfbf;
    border-color: #3ecfbf;
    color: #0d2233;
    font-weight: 700;
}

.cnb-no-slots {
    color: rgba(255,255,255,0.4);
    font-style: italic;
    padding: 12px;
    font-size: 14px;
}

/* Loader */
.cnb-loader {
    padding: 16px 0;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

.cnb-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.15);
    border-top-color: #3ecfbf;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8px;
    animation: cnb-spin 0.8s linear infinite;
}

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

/* Bouton submit */
.cnb-form-actions {
    margin-top: 28px;
}

.cnb-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 1.1rem 2rem;
    background: #3ecfbf;
    color: #0d2233;
    border: none;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
    width: 100%;
    justify-content: center;
}

.cnb-btn-submit:hover:not(:disabled) {
    background: #fff;
    color: #0d2233;
}

.cnb-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Réponses */
.cnb-response {
    margin-top: 20px;
    padding: 16px;
    font-size: 14px;
    text-align: center;
    border-radius: 3px;
}

.cnb-response.cnb-response--success {
    background: rgba(62, 207, 191, 0.15);
    color: #3ecfbf;
    border: 1px solid rgba(62, 207, 191, 0.3);
}

.cnb-response.cnb-response--error {
    background: rgba(220, 50, 50, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(220, 50, 50, 0.3);
}

/* Responsive modal */
@media (max-width: 600px) {
    .cnb-modal-container {
        padding: 28px 20px;
    }

    .cnb-form-grid {
        grid-template-columns: 1fr;
    }

    .cnb-select-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
}
