/*!
 * City Tours Booking Widget - Version 1.5.0
 * Styles professionnels avec palette MRHBAZHNI
 */

:root {
    --mw-blue-gray: #8D99AE;
    --mw-navy: #2B2D42;
    --mw-light-gray: #EDF2F4;
    --mw-red: #EF233C;
    --mw-dark-red: #D90429;
    --mw-white: #FFFFFF;
    --mw-black: #000000;
    --mw-shadow: 0 8px 30px rgba(43, 45, 66, 0.12);
    --mw-radius: 12px;
    --mw-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ctb-booking-widget {
    background: var(--mw-white);
    border-radius: var(--mw-radius);
    padding: 2rem;
    box-shadow: var(--mw-shadow);
    border: 1px solid var(--mw-light-gray);
    max-width: 420px;
    margin: 1.5rem 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    position: relative;
    overflow: hidden;
}

.ctb-booking-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--mw-red), var(--mw-dark-red));
}

.ctb-season-indicator {
    margin-bottom: 1.5rem;
}

.ctb-season-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ctb-season-low {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.ctb-season-medium {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #f57c00;
    border: 1px solid #ffb74d;
}

.ctb-season-high {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.ctb-season-peak {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    color: #7b1fa2;
    border: 1px solid #ba68c8;
}

.ctb-booking-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ctb-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ctb-form-group label {
    font-weight: 600;
    color: var(--mw-navy);
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ctb-price-display {
    font-size: 0.8rem;
    color: var(--mw-red);
    font-weight: 700;
    background: var(--mw-light-gray);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.ctb-date-input,
.ctb-select {
    padding: 1rem 1.25rem;
    border: 2px solid var(--mw-light-gray);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--mw-transition);
    background: var(--mw-white);
    color: var(--mw-navy);
    font-family: inherit;
}

.ctb-date-input:focus,
.ctb-select:focus {
    outline: none;
    border-color: var(--mw-blue-gray);
    box-shadow: 0 0 0 3px rgba(141, 153, 174, 0.1);
    transform: translateY(-1px);
}

.ctb-date-input:hover,
.ctb-select:hover {
    border-color: var(--mw-blue-gray);
}

.ctb-total-section {
    background: linear-gradient(135deg, var(--mw-light-gray), #f8f9fa);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
    border: 1px solid #e9ecef;
}

.ctb-total-section strong {
    font-size: 1.1rem;
    color: var(--mw-navy);
    display: block;
    margin-bottom: 0.5rem;
}

.ctb-total-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mw-red);
    display: block;
}

.ctb-price-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.ctb-breakdown-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--mw-blue-gray);
    margin: 0.5rem 0;
}

.ctb-breakdown-line span:first-child {
    color: var(--mw-navy);
}

.ctb-book-button {
    background: linear-gradient(135deg, var(--mw-red), var(--mw-dark-red));
    color: var(--mw-white);
    border: none;
    padding: 1.25rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--mw-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.ctb-book-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.ctb-book-button:hover::before {
    left: 100%;
}

.ctb-book-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 35, 60, 0.35);
}

.ctb-book-button:active {
    transform: translateY(0);
}

.ctb-book-button:disabled {
    background: var(--mw-blue-gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ctb-book-button:disabled::before {
    display: none;
}

/* États de chargement */
.ctb-loading {
    opacity: 0.7;
    pointer-events: none;
}

.ctb-spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--mw-white);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: ctb-spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes ctb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.ctb-message {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-weight: 500;
    animation: ctb-slideIn 0.3s ease-out;
    border-left: 4px solid;
}

.ctb-message-error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border-left-color: var(--mw-red);
}

.ctb-message-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border-left-color: #2196f3;
}

.ctb-message-success {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border-left-color: #4caf50;
}

@keyframes ctb-slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Indicateurs de disponibilité */
.ctb-availability-indicator {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.ctb-available {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.ctb-unavailable {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Responsive */
@media (max-width: 480px) {
    .ctb-booking-widget {
        padding: 1.5rem;
        margin: 1rem 0;
        border-radius: 8px;
    }
    
    .ctb-form-group label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .ctb-book-button {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .ctb-total-section {
        padding: 1.25rem;
    }
    
    .ctb-total-amount {
        font-size: 1.25rem;
    }
}

/* Améliorations accessibilité */
@media (prefers-reduced-motion: reduce) {
    .ctb-booking-widget,
    .ctb-book-button,
    .ctb-date-input,
    .ctb-select {
        transition: none;
    }
    
    .ctb-spinner {
        animation: none;
    }
}

/* Support dark mode */
@media (prefers-color-scheme: dark) {
    .ctb-booking-widget {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .ctb-form-group label {
        color: #e0e0e0;
    }
    
    .ctb-date-input,
    .ctb-select {
        background: #2d2d2d;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .ctb-total-section {
        background: #2d2d2d;
        border-color: #444;
    }
}

/* Booking Widget V2.3 - Focus State Polish
   Keep all widget selectors stable: this is presentation only. */
.ctb-booking-widget {
    max-width: 460px;
    margin: 0;
    padding: 24px;
    border: 1px solid var(--mrhba-border, #dfd3c4);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--mrhba-white, #fffefa) 0%, var(--mrhba-surface-soft, #fdf9f2) 100%);
    box-shadow: 0 18px 44px rgba(37, 35, 52, 0.12), 0 2px 7px rgba(37, 35, 52, 0.035), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    color: var(--mrhba-ink, #252334);
    overflow: visible;
}

.ctb-booking-widget::before {
    display: none;
}

.ctb-booking-panel-header {
    margin: -24px -24px 16px;
    padding: 18px 22px 15px;
    border: 0;
    border-bottom: 1px solid rgba(201, 161, 74, 0.22);
    border-radius: 17px 17px 0 0;
    background: linear-gradient(135deg, rgba(246, 241, 232, 0.82), rgba(255, 252, 246, 0.74));
    box-shadow: inset 2px 0 0 rgba(201, 161, 74, 0.64);
}

.ctb-booking-panel-eyebrow {
    margin: 0 0 4px;
    color: #92754f;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.ctb-booking-panel-title {
    margin: 0;
    color: var(--mrhba-navy, #2b2d42);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.25;
}

.ctb-booking-panel-trust {
    margin: 5px 0 0;
    color: #777984;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.3;
}

.ctb-booking-panel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.ctb-booking-panel-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 7px;
    border: 1px solid rgba(201, 161, 74, 0.26);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.56);
    color: #655d52;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
    white-space: nowrap;
}

.ctb-season-indicator {
    margin: 0 0 10px;
    color: #6f7380;
    font-size: 0.72rem;
    line-height: 1.3;
}

.ctb-season-label {
    color: #8d7250;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.ctb-season-badge {
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid rgba(201, 161, 74, 0.24);
    border-radius: 999px;
    background: rgba(246, 241, 232, 0.78);
    color: #2b2d42;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    text-transform: none;
}

.ctb-booking-form {
    gap: 12px;
    padding-top: 0;
}

.ctb-form-group {
    gap: 5px;
}

.ctb-form-group label {
    gap: 8px;
    color: var(--mrhba-navy, #35374b);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.25;
}

.ctb-price-display {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #6f7380;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

.ctb-date-input,
.ctb-select {
    min-height: 52px;
    padding: 0.72rem 0.95rem;
    border: 1px solid var(--mrhba-border, #ded7cd);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--mrhba-ink, #252334);
    font-size: 0.92rem;
}

.ctb-date-input:focus,
.ctb-select:focus {
    border-color: var(--mrhba-navy, #2b2d42);
    box-shadow: 0 0 0 3px rgba(43, 45, 66, 0.1);
    transform: none;
}

.ctb-date-hint {
    color: #6f7380;
    font-size: 0.75rem;
    line-height: 1.35;
}

.ctb-total-section {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgba(215, 200, 183, 0.7);
    border-left: 2px solid rgba(201, 161, 74, 0.56);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(246, 241, 232, 0.62), rgba(255, 253, 248, 0.86));
    box-shadow: none;
    text-align: left;
}

.ctb-total-section strong {
    margin-bottom: 0;
    color: #6f7380;
    font-size: 0.78rem;
    font-weight: 700;
}

.ctb-total-amount {
    color: var(--mrhba-navy, #2b2d42);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
}

.ctb-price-breakdown {
    margin-top: 8px;
    padding-top: 8px;
    border-top-color: rgba(231, 225, 216, 0.72);
}

.ctb-breakdown-line {
    gap: 8px;
    margin: 3px 0;
    color: #6f7380;
    font-size: 0.72rem;
    line-height: 1.35;
    opacity: 0.78;
}

.ctb-breakdown-total {
    margin-top: 4px;
    color: #2b2d42;
    font-size: 0.76rem;
}

.ctb-book-button {
    min-height: 50px;
    padding: 11px 16px;
    border-radius: 10px;
    background: var(--mrhba-red-deep, #c20f2c);
    box-shadow: 0 4px 10px rgba(194, 15, 44, 0.16);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
}

.ctb-book-button::before {
    display: none;
}

.ctb-book-button:hover {
    background: var(--mrhba-red, #d90429);
    box-shadow: 0 6px 14px rgba(194, 15, 44, 0.2);
    transform: none;
}

.ctb-availability {
    min-height: 28px;
    padding: 8px 2px 0;
    border: 0;
    border-top: 1px solid rgba(31, 159, 98, 0.1);
    border-radius: 0;
    background: transparent;
    color: #42765b;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.ctb-availability-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ctb-availability-status::before {
    content: '';
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.72;
}

.ctb-availability-icon {
    display: none;
}

@media (max-width: 480px) {
    .ctb-booking-widget {
        margin: 0;
        padding: 16px;
        border-radius: 16px;
    }

    .ctb-booking-panel-header {
        margin: -16px -16px 14px;
        padding: 15px 16px 13px;
        border-radius: 15px 15px 0 0;
    }

    .ctb-booking-panel-badges {
        gap: 4px;
        margin-top: 8px;
    }

    .ctb-form-group label {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    .ctb-date-input,
    .ctb-select,
    .ctb-book-button {
        min-height: 50px;
    }

    .ctb-total-section {
        padding: 11px 0;
    }
}

@media (max-width: 390px) {
    .ctb-booking-widget {
        padding: 14px;
    }

    .ctb-booking-panel-header {
        margin: -14px -14px 13px;
        padding: 14px 14px 12px;
        border-radius: 15px 15px 0 0;
    }

    .ctb-booking-panel-badges span {
        min-height: 19px;
        padding: 3px 5px;
        font-size: 0.58rem;
    }

    .ctb-booking-panel-title {
        font-size: 0.92rem;
    }

    .ctb-booking-panel-trust,
    .ctb-season-indicator {
        font-size: 0.68rem;
    }

    .ctb-form-group label {
        font-size: 0.76rem;
    }

    .ctb-price-display {
        padding: 3px 6px;
        font-size: 0.68rem;
    }

    .ctb-book-button {
        font-size: 0.82rem;
    }
}
