/* ==========================================================================
   Boat Booking — frontend
   Palette : bleu marine / rouge / verts dispo
   ========================================================================== */

.bb-widget {
    --bb-navy: #0a3a5c;
    --bb-navy-dark: #072a42;
    --bb-red: #d41c1c;
    --bb-red-dark: #b21515;
    --bb-green-light: #a8d89a;
    --bb-green-light-bg: #c9e6bf;
    --bb-green-dark: #2d6a33;
    --bb-gray: #9ca3af;
    --bb-gray-light: #e5e7eb;
    --bb-bg-light: #e8f2f7;
    --bb-text: #1a1a1a;
    --bb-radius: 8px;
    --bb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    font-family: var(--bb-font);
    color: var(--bb-text);
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.bb-widget *,
.bb-widget *::before,
.bb-widget *::after {
    box-sizing: border-box;
}

/* Étapes */
.bb-step {
    display: none;
    animation: bbFadeIn .25s ease-out;
}
.bb-step.bb-active { display: block; }

@keyframes bbFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* Grille 2 colonnes */
.bb-grid {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 768px) {
    .bb-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ==========================================================================
   CALENDRIER
   ========================================================================== */

.bb-calendar {
    border: 1px solid var(--bb-gray-light);
    border-radius: var(--bb-radius);
    padding: 20px;
    background: #fff;
}

.bb-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.bb-cal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--bb-text);
    text-transform: capitalize;
}

.bb-cal-nav {
    background: #fff;
    border: 1px solid var(--bb-red);
    color: var(--bb-red);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    transition: background .15s, color .15s;
}
.bb-cal-nav:hover { background: var(--bb-red); color: #fff; }

.bb-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}
.bb-calendar-weekdays > div {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--bb-gray);
    padding: 6px 0;
}

.bb-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.bb-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    border: 1px solid #f1f1f1;
    color: var(--bb-text);
    cursor: default;
    transition: transform .1s, box-shadow .15s;
    user-select: none;
}

.bb-day.bb-past,
.bb-day.bb-empty {
    color: #d0d5dd;
    background: #fafafa;
}

.bb-day.bb-full {
    color: var(--bb-gray);
    background: #f3f4f6;
}

.bb-day.bb-available {
    background: var(--bb-green-light-bg);
    color: var(--bb-green-dark);
    cursor: pointer;
    border-color: transparent;
}
.bb-day.bb-available:hover {
    background: var(--bb-green-light);
    transform: translateY(-1px);
}

.bb-day.bb-selected {
    background: var(--bb-green-dark) !important;
    color: #fff !important;
    font-weight: 700;
}

/* ==========================================================================
   COLONNE BATEAUX
   ========================================================================== */

.bb-selected-date {
    font-size: 16px;
    font-weight: 700;
    color: var(--bb-navy);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bb-gray-light);
    margin-bottom: 8px;
    min-height: 40px;
}
.bb-selected-date .bb-hint {
    font-weight: 400;
    color: var(--bb-gray);
    font-size: 14px;
}

.bb-boats-list { display: flex; flex-direction: column; }

.bb-boat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--bb-gray-light);
    gap: 16px;
    flex-wrap: wrap;
}

.bb-boat-row:last-child { border-bottom: none; }

.bb-boat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bb-boat-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--bb-navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.bb-boat-seats {
    font-size: 12px;
    color: var(--bb-gray);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.bb-choice-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a7bc9;
    color: #fff;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
    width: fit-content;
}
.bb-choice-tag::before { content: "♥"; }

.bb-boat-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bb-available-count {
    color: var(--bb-navy);
    font-size: 14px;
    font-weight: 500;
}
.bb-available-count.bb-unavailable { color: var(--bb-gray); }

.bb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .15s, transform .1s;
    font-family: inherit;
    text-decoration: none;
}
.bb-btn:active { transform: translateY(1px); }
.bb-btn:disabled { opacity: .5; cursor: not-allowed; }

.bb-btn-primary {
    background: var(--bb-red);
    color: #fff;
    padding: 12px 32px;
}
.bb-btn-primary:hover:not(:disabled) { background: var(--bb-red-dark); }

.bb-btn-ghost {
    background: transparent;
    color: var(--bb-navy);
    border: 1px solid var(--bb-gray-light);
}
.bb-btn-ghost:hover { background: #f3f4f6; }

.bb-boats-list .bb-btn-primary {
    padding: 10px 28px;
    text-transform: none;
}

.bb-no-boats {
    padding: 32px 16px;
    text-align: center;
    color: var(--bb-gray);
    font-size: 14px;
}

/* ==========================================================================
   FORMULAIRE ÉTAPE 2
   ========================================================================== */

.bb-step-2, .bb-step-3, .bb-step-4 {
    background: var(--bb-bg-light);
    border-radius: var(--bb-radius);
    padding: 32px;
    margin-top: 20px;
}

.bb-step-header {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    color: var(--bb-navy);
    font-weight: 700;
}
.bb-boat-badge::before { content: "⚓ "; }
.bb-date-badge::before { content: "📅 "; }

.bb-notice {
    text-align: center;
    color: var(--bb-navy);
    font-size: 15px;
    margin: 0 0 28px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(10, 58, 92, 0.1);
}

.bb-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}
@media (max-width: 640px) { .bb-row { grid-template-columns: 1fr; } }

.bb-field { display: flex; flex-direction: column; }
.bb-field label {
    color: var(--bb-navy);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
}
.bb-field input,
.bb-field select {
    background: #fff;
    border: 1px solid #fff;
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    color: var(--bb-text);
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
.bb-field input:focus,
.bb-field select:focus {
    outline: none;
    border-color: var(--bb-navy);
    box-shadow: 0 0 0 3px rgba(10, 58, 92, 0.15);
}

.bb-required-note {
    color: var(--bb-navy);
    font-size: 14px;
    text-align: center;
    margin: 16px 0 24px 0;
}

.bb-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.bb-actions .bb-btn-primary { margin-left: auto; }

/* ==========================================================================
   RÉCAPITULATIF
   ========================================================================== */

.bb-step-title {
    color: var(--bb-navy);
    text-align: center;
    margin: 0 0 24px 0;
    font-size: 22px;
}

.bb-summary {
    background: #fff;
    border-radius: var(--bb-radius);
    padding: 24px;
    margin-bottom: 8px;
}
.bb-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--bb-gray-light);
    gap: 16px;
}
.bb-summary-row:last-child { border-bottom: none; }
.bb-summary-label {
    color: var(--bb-gray);
    font-size: 14px;
}
.bb-summary-value {
    color: var(--bb-navy);
    font-weight: 600;
    text-align: right;
}

/* ==========================================================================
   CONFIRMATION / LOADER
   ========================================================================== */

.bb-success { text-align: center; padding: 32px 16px; }
.bb-success-icon {
    width: 64px;
    height: 64px;
    background: var(--bb-green-dark);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    margin: 0 auto 16px;
}
.bb-success h3 { color: var(--bb-navy); margin: 0 0 8px; }
.bb-success p { color: #4b5563; margin: 0 0 24px; }

.bb-loader {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.75);
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--bb-radius);
}
.bb-loader.bb-visible { display: flex; }
.bb-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bb-gray-light);
    border-top-color: var(--bb-red);
    border-radius: 50%;
    animation: bbSpin .7s linear infinite;
}
@keyframes bbSpin { to { transform: rotate(360deg); } }

.bb-error-msg {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
