/* ── TunisiaBeds Sync – Public / Front-end Styles ─────────────── */

/* Search widget */
.tbs-search-widget { background:#fff; border-radius:12px; padding:24px; box-shadow:0 4px 20px rgba(0,0,0,.1); margin:24px 0; }
.tbs-search-form {}
.tbs-search-row { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; }
.tbs-field { display:flex; flex-direction:column; gap:4px; flex:1 1 160px; }
.tbs-field-small { flex:0 0 100px; }
.tbs-field label { font-size:13px; font-weight:600; color:#444; }
.tbs-field input,
.tbs-field select { padding:8px 12px; border:1px solid #ddd; border-radius:6px; font-size:14px; background:#fafafa; }
.tbs-field input:focus,
.tbs-field select:focus { outline:none; border-color:#0073aa; background:#fff; }
.tbs-search-btn { background:#0073aa; color:#fff; border:none; padding:10px 22px; border-radius:6px; cursor:pointer; font-size:15px; font-weight:600; transition:background .2s; white-space:nowrap; }
.tbs-search-btn:hover { background:#005a87; }
.tbs-children-ages { margin-top:12px; padding:12px; background:#f7f9fc; border-radius:8px; }
.tbs-ages-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.tbs-ages-row select { padding:6px 10px; border:1px solid #ddd; border-radius:4px; }

/* Search results */
.tbs-search-results { margin-top:24px; }
.tbs-loading { text-align:center; padding:32px; color:#888; font-style:italic; }
.tbs-spinner-pub { display:inline-block; width:24px; height:24px; border:3px solid #e0e0e0; border-top-color:#0073aa; border-radius:50%; animation:tbsSpin .7s linear infinite; }
.tbs-error-msg { background:#fdecea; color:#c0392b; padding:12px 16px; border-radius:8px; }
.tbs-info-msg { background:#e8f4fd; color:#1565c0; padding:12px 16px; border-radius:8px; margin-bottom:16px; }

/* Hotel grid */
.tbs-hotels { display:grid; gap:24px; }
.tbs-cols-1 { grid-template-columns:1fr; }
.tbs-cols-2 { grid-template-columns:repeat(2,1fr); }
.tbs-cols-3 { grid-template-columns:repeat(3,1fr); }
.tbs-cols-4 { grid-template-columns:repeat(4,1fr); }

@media(max-width:900px) {
    .tbs-cols-3, .tbs-cols-4 { grid-template-columns:repeat(2,1fr); }
}
@media(max-width:560px) {
    .tbs-cols-2, .tbs-cols-3, .tbs-cols-4 { grid-template-columns:1fr; }
    .tbs-search-row { flex-direction:column; }
    .tbs-field, .tbs-field-small { flex:1 1 100%; }
}

/* Hotel card */
.tbs-hotel-card { background:#fff; border:1px solid #e8e8e8; border-radius:10px; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,.06); transition:box-shadow .2s, transform .2s; }
.tbs-hotel-card:hover { box-shadow:0 6px 24px rgba(0,0,0,.12); transform:translateY(-2px); }
.tbs-hotel-img img { width:100%; height:200px; object-fit:cover; display:block; }
.tbs-hotel-body { padding:16px; }
.tbs-hotel-name { margin:0 0 6px; font-size:16px; font-weight:700; color:#1a1a2e; line-height:1.3; }
.tbs-hotel-stars { color:#f39c12; font-size:14px; margin-bottom:6px; letter-spacing:1px; }
.tbs-hotel-location { font-size:13px; color:#666; margin:0 0 8px; }
.tbs-hotel-themes { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:10px; }
.tbs-tag { background:#eef4fb; color:#0073aa; font-size:11px; padding:2px 8px; border-radius:12px; white-space:nowrap; }
.tbs-hotel-facilities { font-size:18px; display:flex; gap:6px; margin-bottom:8px; }
.tbs-hotel-note { font-size:11px; color:#999; margin-top:8px; border-top:1px solid #f0f0f0; padding-top:8px; }
.tbs-hotel-price { font-size:20px; font-weight:700; color:#0073aa; margin-top:10px; }
.tbs-hotel-price small { font-size:12px; color:#888; font-weight:400; }
.tbs-hotel-price-static { font-size:13px !important; font-weight:400 !important; color:#555 !important; background:#f8f9fa; border-radius:6px; padding:8px 10px; margin-top:10px; border-left:3px solid #0073aa; }
.tbs-hotel-price-static .tbs-price-label { font-weight:600; color:#0073aa; display:block; font-size:12px; text-transform:uppercase; letter-spacing:.5px; }
.tbs-hotel-price-static .tbs-price-value { color:#333; font-size:13px; }
.tbs-hotel-boarding { font-size:12px; color:#555; }

/* Booking list (shortcode) */
.tbs-bookings-list { font-size:14px; }
.tbs-booking-item { padding:10px 14px; border-left:4px solid #0073aa; background:#f9f9f9; margin-bottom:8px; border-radius:0 6px 6px 0; }
.tbs-booking-id { font-weight:700; color:#888; }
.tbs-state-validated { border-color:#27ae60; }
.tbs-state-cancelled { border-color:#e74c3c; }
.tbs-state-pending   { border-color:#f39c12; }

/* Badge */
.tbs-badge { display:inline-block; padding:2px 8px; border-radius:12px; font-size:11px; font-weight:600; }
.tbs-badge-validated, .tbs-badge-success { background:#d4edda; color:#155724; }
.tbs-badge-cancelled, .tbs-badge-error   { background:#f8d7da; color:#721c24; }
.tbs-badge-pending,   .tbs-badge-warning { background:#fff3cd; color:#856404; }
.tbs-badge-option,    .tbs-badge-info    { background:#d1ecf1; color:#0c5460; }

.tbs-empty { color:#888; font-style:italic; }

@keyframes tbsSpin { to { transform:rotate(360deg); } }

/* ── Book button on hotel cards ────────────────────────────────── */
.tbs-book-btn {
    display: block; width: 100%; margin-top: 14px;
    background: #0073aa; color: #fff; border: none;
    padding: 11px 18px; border-radius: 7px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background .2s, transform .15s;
    text-align: center; letter-spacing: .3px;
}
.tbs-book-btn:hover { background: #005a87; transform: translateY(-1px); }
.tbs-book-btn:active { transform: translateY(0); }

/* ── Modal overlay ─────────────────────────────────────────────── */
.tbs-modal-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
body.tbs-modal-open { overflow: hidden; }

.tbs-modal {
    background: #fff; border-radius: 14px;
    width: 100%; max-width: 680px;
    max-height: 90vh; overflow-y: auto;
    position: relative; padding: 28px 32px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: tbs-modal-in .22s ease;
}
@keyframes tbs-modal-in {
    from { opacity:0; transform:translateY(24px) scale(.97); }
    to   { opacity:1; transform:none; }
}

.tbs-modal-close {
    position: absolute; top: 14px; right: 16px;
    background: #f0f0f0; border: none; border-radius: 50%;
    width: 34px; height: 34px; font-size: 16px;
    cursor: pointer; color: #555; transition: background .2s;
    display: flex; align-items: center; justify-content: center;
}
.tbs-modal-close:hover { background: #e0e0e0; color: #222; }

/* ── Step indicator ────────────────────────────────────────────── */
.tbs-steps {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 24px; flex-wrap: wrap;
}
.tbs-step {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: #bbb;
    padding: 6px 12px; border-radius: 20px;
    transition: all .2s;
}
.tbs-step span {
    width: 22px; height: 22px; border-radius: 50%;
    background: #e0e0e0; color: #888; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tbs-step.active { color: #0073aa; }
.tbs-step.active span { background: #0073aa; color: #fff; }
.tbs-step.done { color: #27ae60; }
.tbs-step.done span { background: #27ae60; color: #fff; }
.tbs-step-sep { color: #ccc; font-size: 18px; }

/* ── Modal hotel header ────────────────────────────────────────── */
.tbs-modal-hotel-header {
    display: flex; align-items: center; gap: 16px;
    background: #f7f9fc; border-radius: 10px;
    padding: 14px 16px; margin-bottom: 20px;
    border: 1px solid #e8edf2;
}
.tbs-modal-hotel-img {
    width: 80px; height: 60px; object-fit: cover;
    border-radius: 6px; flex-shrink: 0;
}
.tbs-modal-hotel-info h2 { margin: 0 0 4px; font-size: 17px; color: #1a1a2e; }
.tbs-modal-hotel-info .tbs-hotel-stars { font-size: 13px; margin-bottom: 3px; }
.tbs-modal-hotel-info .tbs-hotel-location { margin: 0; font-size: 12px; color: #666; }

/* ── Modal step content ────────────────────────────────────────── */
.tbs-modal-step h3 { margin: 0 0 18px; font-size: 16px; color: #1a1a2e; }
.tbs-modal-row { display: flex; gap: 14px; margin-bottom: 14px; }
.tbs-modal-row .tbs-field { flex: 1; }
.tbs-modal-loading { text-align: center; padding: 40px; color: #888; }
.tbs-modal-loading p { margin-top: 12px; font-style: italic; }

/* ── Dates step ────────────────────────────────────────────────── */
.tbs-modal-dates-form { display: flex; flex-direction: column; gap: 4px; }

/* ── Room options ──────────────────────────────────────────────── */
.tbs-stay-summary {
    background: #eef6fb; border-radius: 8px;
    padding: 10px 14px; font-size: 13px;
    color: #1565c0; margin-bottom: 16px;
}
.tbs-rooms-list { display: flex; flex-direction: column; gap: 12px; }
.tbs-room-option {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; background: #fafafa; border: 2px solid #e8e8e8;
    border-radius: 10px; padding: 14px 18px;
    transition: border-color .2s, background .2s;
}
.tbs-room-option:hover { border-color: #0073aa; background: #f0f7ff; }
.tbs-room-info { flex: 1; }
.tbs-room-name { font-size: 15px; margin-bottom: 5px; }
.tbs-room-boarding { margin-bottom: 4px; }
.tbs-room-desc { font-size: 12px; color: #777; margin-top: 4px; }
.tbs-room-price { text-align: right; flex-shrink: 0; }
.tbs-price-total { font-size: 19px; font-weight: 700; color: #0073aa; }
.tbs-price-per-night { font-size: 11px; color: #888; margin-bottom: 8px; }
.tbs-select-room-btn {
    background: #0073aa; color: #fff; border: none;
    padding: 8px 16px; border-radius: 6px; font-size: 13px;
    font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background .2s;
}
.tbs-select-room-btn:hover { background: #005a87; }

/* ── Guest form ────────────────────────────────────────────────── */
.tbs-guest-form .tbs-field input {
    padding: 10px 12px; border: 1px solid #ddd;
    border-radius: 7px; font-size: 14px; width: 100%;
    background: #fafafa; box-sizing: border-box;
    transition: border-color .2s;
}
.tbs-guest-form .tbs-field input:focus {
    outline: none; border-color: #0073aa; background: #fff;
}
.tbs-selected-room-summary { margin-bottom: 18px; }
.tbs-summary-pill {
    background: #eef6fb; border-radius: 8px;
    padding: 10px 14px; font-size: 13px; color: #1565c0;
    line-height: 1.6;
}
.tbs-form-note { font-size: 12px; color: #999; margin: 0 0 16px; }

/* ── Booking summary table ─────────────────────────────────────── */
.tbs-summary-table {
    width: 100%; border-collapse: collapse;
    font-size: 14px; margin-bottom: 18px;
}
.tbs-summary-table td {
    padding: 9px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top;
}
.tbs-summary-table td:first-child { color: #888; width: 38%; font-weight: 500; }
.tbs-summary-table tr:last-child td { border-bottom: none; }
.tbs-total-row td { background: #f0f7ff; font-size: 15px; border-radius: 6px; }
.tbs-total-row td:first-child { color: #0073aa; }

/* ── Cancellation policy ───────────────────────────────────────── */
.tbs-policy-box {
    background: #fff8e1; border: 1px solid #ffe082;
    border-radius: 8px; padding: 14px 16px; margin-bottom: 18px;
}
.tbs-policy-box h4 { margin: 0 0 10px; font-size: 14px; color: #5d4037; }
.tbs-policy-rule { font-size: 13px; color: #4a4a4a; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid #fff3cd; }
.tbs-policy-rule:last-child { border-bottom: none; margin-bottom: 0; }
.tbs-policy-date { font-weight: 600; color: #e65100; }
.tbs-policy-unknown { background: #f3f4f6; border-color: #d1d5db; }
.tbs-policy-unknown, .tbs-policy-unknown h4 { color: #374151; }
.tbs-loading-policy { display: flex; align-items: center; gap: 8px; color: #888; font-size: 13px; }

/* ── Action buttons ────────────────────────────────────────────── */
.tbs-modal-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.tbs-btn-primary, .tbs-btn-secondary, .tbs-btn-book {
    padding: 10px 22px; border: none; border-radius: 7px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all .2s;
}
.tbs-btn-primary  { background: #0073aa; color: #fff; }
.tbs-btn-primary:hover  { background: #005a87; }
.tbs-btn-secondary { background: #f0f0f0; color: #555; }
.tbs-btn-secondary:hover { background: #e0e0e0; }
.tbs-btn-book {
    background: #27ae60; color: #fff;
    font-size: 15px; padding: 12px 28px;
}
.tbs-btn-book:hover { background: #1e8449; }
.tbs-btn-book:disabled { background: #95a5a6; cursor: not-allowed; }

/* ── Success screen ────────────────────────────────────────────── */
.tbs-booking-success { text-align: center; padding: 16px 0 8px; }
.tbs-success-icon { font-size: 56px; margin-bottom: 12px; }
.tbs-booking-success h3 { font-size: 22px; color: #1a1a2e; margin: 0 0 20px; }
.tbs-confirm-card { text-align: left; margin: 0 auto 20px; }
.tbs-confirm-ref {
    background: #d4edda; color: #155724; border-radius: 8px;
    padding: 10px 14px; font-size: 14px; margin-bottom: 14px;
    text-align: center;
}
.tbs-confirm-note { font-size: 13px; color: #666; text-align: center; margin-top: 12px; }

/* ── Result count ──────────────────────────────────────────────── */
.tbs-result-count { color: #666; font-size: 13px; margin-bottom: 16px; }

/* ── Responsive ────────────────────────────────────────────────── */
@media(max-width:560px){
    .tbs-modal { padding: 20px 18px 24px; border-radius: 12px; }
    .tbs-modal-row { flex-direction: column; gap: 10px; }
    .tbs-room-option { flex-direction: column; align-items: flex-start; }
    .tbs-room-price { text-align: left; width: 100%; display: flex; align-items: center; gap: 12px; }
    .tbs-modal-actions { flex-direction: column-reverse; }
    .tbs-btn-primary, .tbs-btn-secondary, .tbs-btn-book { width: 100%; text-align: center; }
}

/* ── Price on request ─────────────────────────────────────── */
.tbs-price-on-request {
    font-size: 13px; color: #5d4037; font-weight: 600;
    background: #fff8e1; border-radius: 4px;
    padding: 4px 8px; margin-bottom: 8px;
    display: inline-block; white-space: nowrap;
}
