/* =============================================================================
   TSB Booking Widget — booking.css
   Past bij de bestaande TSB theme look & feel.
   Alle site-klasses (knoppen, inputs, alerts) worden hergebruikt.
   Prefix: .tsb-booking-  om conflicten te voorkomen.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Widget container — ziet eruit als een tab_block
   --------------------------------------------------------------------------- */

.tsb-booking-widget {
    margin-top: 25px;
    padding: 20px 25px;
    border: 1px solid var(--border-color, #f2f2f2);
    box-shadow: 0 0 40px 0 rgba(231, 231, 231, 0.46);
}

.tsb-booking-widget h2 {
    font-size: 17px;
    font-weight: 500;
    margin: 0 0 18px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border-color, #f2f2f2);
}

/* ---------------------------------------------------------------------------
   Kalender
   --------------------------------------------------------------------------- */

.tsb-booking-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tsb-booking-cal-nav-label {
    font-size: 15px;
    font-weight: 500;
}

.tsb-booking-cal-nav-btn {
    background: none;
    border: 1px solid var(--border-color, #f2f2f2);
    padding: 5px 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.tsb-booking-cal-nav-btn:hover {
    background: var(--border-color, #f2f2f2);
}

.tsb-booking-calendar {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 10px;
}

.tsb-booking-calendar th {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    padding: 6px 2px;
    color: #66676e;
}

.tsb-booking-calendar td {
    text-align: center;
    padding: 0;
    border: 1px solid var(--border-color, #f2f2f2);
    position: relative;
}

.tsb-booking-cal-day {
    display: block;
    width: 100%;
    padding: 8px 2px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.12s;
    position: relative;
}

/* Beschikbaarheidsstaten */
.tsb-booking-cal-day.avail        { background: #edf7f1; color: #2d7a52; }
.tsb-booking-cal-day.avail:hover  { background: #d3eedf; }
.tsb-booking-cal-day.partial      { background: #fff8ec; color: #9a6000; }
.tsb-booking-cal-day.partial:hover{ background: #feeece; }
.tsb-booking-cal-day.full         { background: #fdf0f0; color: #c04040; cursor: not-allowed; }
.tsb-booking-cal-day.blocked      { background: #f5f5f5; color: #bbb;    cursor: not-allowed; text-decoration: line-through; }
.tsb-booking-cal-day.closed       { background: #fafafa; color: #ccc;    cursor: not-allowed; }
.tsb-booking-cal-day.past         { color: #ccc; cursor: not-allowed; background: #fff; }
.tsb-booking-cal-day.empty        { cursor: default; background: #fff; }

/* Geselecteerde dag / bereik */
.tsb-booking-cal-day.selected     { background: #51a27e !important; color: #fff !important; font-weight: 700; }
.tsb-booking-cal-day.in-range     { background: #a8d9bc !important; color: #1a5c38 !important; }

/* Tooltip */
.tsb-booking-cal-day[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    padding: 4px 8px;
    z-index: 10;
    pointer-events: none;
}

/* Kalender legenda */
.tsb-booking-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 8px;
    font-size: 12px;
    color: #66676e;
}

.tsb-booking-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.tsb-booking-legend-dot.avail   { background: #51a27e; }
.tsb-booking-legend-dot.partial { background: #f6a623; }
.tsb-booking-legend-dot.full    { background: #cf0f0f; }
.tsb-booking-legend-dot.blocked { background: #ccc; }

/* ---------------------------------------------------------------------------
   Tijdslot selector
   --------------------------------------------------------------------------- */

.tsb-booking-slots-wrap {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #f2f2f2);
}

.tsb-booking-slots-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.tsb-booking-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 600px) {
    .tsb-booking-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 380px) {
    .tsb-booking-slots-grid {
        grid-template-columns: 1fr;
    }
}

.tsb-booking-slot-card {
    border: 1px solid var(--border-color, #f2f2f2);
    padding: 10px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    font-size: 13px;
    background: #fff;
}

.tsb-booking-slot-card:hover:not(.full):not(.blocked) {
    border-color: #51a27e;
    background: #edf7f1;
}

.tsb-booking-slot-card.selected {
    border-color: #51a27e;
    background: #edf7f1;
    font-weight: 500;
}

.tsb-booking-slot-card.full,
.tsb-booking-slot-card.blocked {
    opacity: 0.45;
    cursor: not-allowed;
}

.tsb-booking-slot-time {
    font-size: 14px;
    font-weight: 500;
}

.tsb-booking-slot-meta {
    color: #66676e;
    font-size: 12px;
    margin-top: 3px;
}

.tsb-booking-slot-price {
    margin-top: 5px;
    font-weight: 500;
    color: #2d7a52;
}

/* ---------------------------------------------------------------------------
   Reserveringsoverzicht
   --------------------------------------------------------------------------- */

.tsb-booking-summary {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #f2f2f2);
}

.tsb-booking-summary-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.tsb-booking-summary-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.tsb-booking-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color, #f2f2f2);
    font-size: 13px;
}

.tsb-booking-summary-item-info {
    flex: 1;
    min-width: 0;
}

.tsb-booking-summary-item-date {
    font-weight: 500;
}

.tsb-booking-summary-item-time {
    color: #66676e;
    font-size: 12px;
}

/* +/- quantity control passend bij de site-stijl */
.tsb-booking-qty-ctrl {
    display: inline-flex;
    align-items: center;
    border: 1px solid #000;
    overflow: hidden;
    background: #fff;
}

.tsb-booking-qty-ctrl button {
    background: #fff;
    border: none;
    padding: 4px 10px;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.tsb-booking-qty-ctrl input {
    width: 35px;
    text-align: center;
    border: none;
    font-size: 13px;
    padding: 4px;
    outline: none;
    height: auto;
}

.tsb-booking-summary-item-price {
    font-weight: 500;
    white-space: nowrap;
}

.tsb-booking-summary-remove {
    background: none;
    border: none;
    color: var(--error-color, #cf0f0f);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    line-height: 1;
}

.tsb-booking-summary-total {
    text-align: right;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 0;
}

.tsb-booking-summary-total span {
    font-size: 20px;
}

/* CTA-knop: ziet er hetzelfde uit als de .s_button_1 op de pagina */
.tsb-booking-cta {
    margin-top: 10px;
}

/* Lege state */
.tsb-booking-empty {
    color: #66676e;
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}

/* ---------------------------------------------------------------------------
   Berichten (hergebruikt s_msg_green / s_msg_red klasse-stijl)
   --------------------------------------------------------------------------- */

.tsb-booking-msg {
    padding: 10px;
    margin: 10px 0;
    font-size: 13px;
    border: 1px solid;
    display: none;
}

.tsb-booking-msg.success {
    color: var(--success-color, #51a27e);
    background: #f4fffa;
    border-color: var(--success-color, #51a27e);
}

.tsb-booking-msg.error {
    color: var(--error-color, #cf0f0f);
    background: #fff5f5;
    border-color: var(--error-color, #cf0f0f);
}

/* ---------------------------------------------------------------------------
   Laad-indicator
   --------------------------------------------------------------------------- */

.tsb-booking-loading {
    display: none;
    text-align: center;
    padding: 20px 0;
    color: #66676e;
    font-size: 13px;
}

.tsb-booking-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color, #f2f2f2);
    border-top-color: #51a27e;
    border-radius: 50%;
    animation: tsb-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ---------------------------------------------------------------------------
   Modus-toggle (enkele dag / meerdere dagen)
   --------------------------------------------------------------------------- */

.tsb-booking-mode-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.tsb-booking-mode-btn {
    background: #fff;
    border: 1px solid var(--border-color, #f2f2f2);
    padding: 5px 14px;
    font-size: 12px;
    cursor: pointer;
    color: #66676e;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.tsb-booking-mode-btn:hover,
.tsb-booking-mode-btn.active {
    border-color: #51a27e;
    color: #2d7a52;
    background: #edf7f1;
}

/* Prijs onder elke datum in kalender */
.tsb-booking-cal-price {
    display: block;
    font-size: 10px;
    line-height: 1.1;
    margin-top: 2px;
    opacity: 0.85;
    letter-spacing: -0.2px;
}

/* Reset / wis-selectie knop in kalendernavigatie */
.tsb-booking-reset-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    font-size: 12px;
    padding: 3px 10px;
    margin-left: 10px;
    transition: color 0.15s, border-color 0.15s;
}
.tsb-booking-reset-btn:hover {
    border-color: #b94a48;
    color: #b94a48;
}

/* Bereik-selectie highlights */
.tsb-booking-cal-day.range-start { border-radius: 3px 0 0 3px; }
.tsb-booking-cal-day.range-end   { border-radius: 0 3px 3px 0; }
.tsb-booking-cal-day.has-selection::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: #51a27e;
    border-radius: 50%;
}

/* ---------------------------------------------------------------------------
   Multi-dag bevestigingsUI
   --------------------------------------------------------------------------- */

.tsb-booking-multiday-confirm {
    font-size: 13px;
}

.tsb-booking-multiday-days {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}

.tsb-booking-multiday-days td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--border-color, #f2f2f2);
}

.tsb-booking-multiday-days td:last-child {
    text-align: right;
    font-weight: 500;
    color: #2d7a52;
}

.tsb-booking-multiday-total {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.tsb-booking-multiday-price-line {
    color: #66676e;
    font-size: 12px;
    margin-top: 4px;
    width: 100%;
}

.tsb-booking-multiday-price-total {
    font-size: 15px;
    font-weight: 500;
    width: 100%;
}

/* ---------------------------------------------------------------------------
   Overschrijf algemene #content table-stijlen die mondagen blauw kleuren
   screen.css.php heeft: #content table td:first-child { background:#f8fafc; ... }
   Dit treft de eerste kolom (maandag) van de boekingskalender — reset die hier.
   --------------------------------------------------------------------------- */

#content .tsb-booking-calendar td:first-child {
    position: static;
    left: auto;
    background: inherit;
    z-index: auto;
    font-weight: inherit;
    box-shadow: none;
}

#content .tsb-booking-calendar {
    border-collapse: collapse;
    border-spacing: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

/* ---------------------------------------------------------------------------
   Responsive aanpassingen
   --------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .tsb-booking-widget {
        padding: 15px;
    }
}
