/* ── CSS Variables ─── (scoped to wrapper elements so body-level theme vars are inherited) ── */
/* Fallback chain: theme Customizer vars → WP preset vars → hardcoded defaults              */
.tbs-tour-listings, .tbs-tour-calendar-container, .tbs-tour-content-wrapper,
.tbs-booking-confirmation, .tbs-my-bookings, .tbs-guide-profile,
.tbs-guide-directory, .tbs-tour-archive, .tbs-guide-profile-section,
.tbs-guide-dashboard, .tbs-guide-login {
    --tbs-primary-color:  var(--color-primary,
                          var(--wp--preset--color--primary,
                          var(--wp--preset--color--accent, #2563eb)));
    --tbs-primary-hover:  var(--color-primary-dark,
                          color-mix(in srgb, var(--tbs-primary-color) 85%, black));
    --tbs-primary-tint:   color-mix(in srgb, var(--tbs-primary-color) 8%, transparent);
    --tbs-focus-ring:     0 0 0 3px color-mix(in srgb, var(--tbs-primary-color) 25%, transparent);

    --tbs-highlight:      color-mix(in srgb, var(--tbs-primary-color) 8%, transparent);
    --tbs-light:          var(--color-surface,
                          var(--wp--preset--color--surface,
                          var(--wp--preset--color--base,
                          var(--wp--preset--color--background, #f8fafc))));
    /* Cards and form containers use Widget Card Background (--color-widget-bg).
       Section/panel backgrounds (tour guide, location, etc.) use Sidebar Area Background (--color-widget-area-bg). */
    --tbs-card-bg:        var(--color-widget-bg,
                          var(--color-nav-dropdown-bg,
                          var(--wp--preset--color--base-2,
                          var(--wp--preset--color--base, #ffffff))));
    --tbs-gray-light:     var(--color-widget-area-bg,
                          var(--color-surface-alt,
                          var(--wp--preset--color--surface-alt,
                          var(--wp--preset--color--contrast-3,
                          var(--wp--preset--color--tertiary,
                          var(--wp--preset--color--base-2, #f1f5f9))))));
    --tbs-gray-medium:    var(--wp--preset--color--contrast-2, #e2e8f0);
    --tbs-dark:           var(--color-body-text,
                          var(--color-heading,
                          var(--wp--preset--color--contrast,
                          var(--wp--preset--color--foreground, #1e293b))));
    --tbs-text-secondary: var(--color-body-text,
                          var(--color-heading,
                          var(--wp--preset--color--contrast,
                          var(--wp--preset--color--foreground, #1e293b))));
    --tbs-text-success:   #16a34a;
    --tbs-error:          #dc2626;

    --tbs-border-color:   var(--wp--preset--color--contrast-3,
                          var(--wp--preset--color--tertiary, #cbd5e1));
    --tbs-shadow:         0 1px 4px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.05);
    --tbs-radius:         8px;
    --tbs-radius-sm:      4px;

    /* Tour page structural colors */
    --tbs-meta-bar-bg:       var(--color-header-bg,
                              var(--wp--preset--color--base-2,
                              color-mix(in srgb, var(--tbs-primary-color) 6%, white)));
    --tbs-section-card-bg:   var(--color-widget-area-bg,
                              var(--color-surface-alt,
                              var(--wp--preset--color--surface-alt,
                              var(--wp--preset--color--contrast-3,
                              var(--wp--preset--color--tertiary, #f1f5f9)))));
    --tbs-booking-header-bg: var(--color-primary-dark,
                              color-mix(in srgb, var(--tbs-primary-color) 80%, black));

    /* Site/page content background — matches the theme's content-area surface.
       --color-surface is the standard theme var for content-area background (e.g. #f9f9ef).
       Falls back through WP block theme preset slugs, then white. */
    --tbs-site-bg:           var(--color-surface,
                              var(--wp--preset--color--surface,
                              var(--wp--style--color--background,
                              var(--wp--preset--color--base,
                              var(--wp--preset--color--background,
                              var(--color-background, #ffffff))))));
}

/* ── Plugin page: body background matches site background ────────────────── */
/* Inherits theme's body background so gray never shows around plugin pages.
   The PHP layer injects the exact hex via get_theme_mod when available. */
body.tbs-plugin-page {
    background-color: var(--color-surface,
                      var(--wp--preset--color--surface,
                      var(--wp--style--color--background,
                      var(--wp--preset--color--base,
                      var(--color-background,
                      var(--wp--preset--color--background))))));
}

/* ── Scoped box-sizing reset + site background ───────────────────────────── */
.tbs-tour-listings, .tbs-tour-calendar-container, .tbs-tour-content-wrapper,
.tbs-booking-confirmation, .tbs-my-bookings, .tbs-guide-profile,
.tbs-guide-directory, .tbs-tour-archive, .tbs-guide-profile-section,
.tbs-guide-dashboard, .tbs-guide-login {
    box-sizing: border-box;
    background-color: var(--tbs-site-bg);
}
.tbs-tour-listings *, .tbs-tour-calendar-container *, .tbs-tour-content-wrapper *,
.tbs-booking-confirmation *, .tbs-my-bookings *, .tbs-guide-profile *,
.tbs-guide-directory *, .tbs-tour-archive *, .tbs-guide-profile-section *,
.tbs-guide-dashboard *, .tbs-guide-login * {
    box-sizing: inherit;
}

/* ── Theme content-width override ────────────────────────────────────────── */
/* body.tbs-plugin-page is added via PHP body_class filter on all plugin pages.
   The plugin page templates call get_header()/get_footer() which wrap content in the
   theme's #content / .site-content container. Strip its max-width/margin constraints
   so the plugin wrappers (width:100%) fill the full viewport naturally. */
body.tbs-plugin-page #content,
body.tbs-plugin-page .site-content,
body.tbs-plugin-page #primary,
body.tbs-plugin-page .content-area,
body.tbs-plugin-page main,
body.tbs-plugin-page .wp-block-post-content,
body.tbs-plugin-page .entry-content {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}


/* ── Background reaches page bottom ─────────────────────────────────────── */
/* body.tbs-plugin-page handles the overall background. These wrappers get enough
   min-height so the background color fills the viewport on short-content pages.
   Grid-based wrappers (guide-directory) are excluded to prevent row stretching. */
.tbs-tour-listings, .tbs-tour-calendar-container, .tbs-tour-content-wrapper,
.tbs-booking-confirmation, .tbs-my-bookings, .tbs-guide-profile,
.tbs-tour-archive, .tbs-guide-dashboard, .tbs-guide-login {
    min-height: calc(100vh - 80px);
    padding-bottom: 40px;
}
.tbs-guide-directory {
    padding-bottom: 40px;
}

/* ── Hidden-by-default utilities ─────────────────────────────────────────── */
.tbs-date-description, .tbs-cancel-message { display: none; }

/* ── Base tour details styling ───────────────────────────────────────────── */
.tbs-tour-details {
    margin-bottom: 40px;
    font-size: inherit;
    line-height: inherit;
    color: var(--tbs-dark);
}

.tbs-tour-content-wrapper {
    width: 100%;
    margin: 0;
    padding: 30px 15px 0;
    box-sizing: border-box;
    background-color: var(--tbs-wrapper-bg, var(--tbs-site-bg));
}

/* ── Section headers ─────────────────────────────────────────────────────── */
.tbs-tour-details h3 {
    font-size: 1.3em;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tbs-border-color);
    color: var(--tbs-dark);
}

/* Optional: hide h3 border-bottom on all section cards */
.tbs-tour-details.tbs-no-section-borders h3 {
    border-bottom: none;
    padding-bottom: 0;
}

/* ── Tour layout columns ─────────────────────────────────────────────────── */
.tbs-tour-main-content { min-width: 0; }
.tbs-tour-sidebar      { min-width: 0; }

/* Mobile booking form slot: hidden by default, shown on single-column layout */
.tbs-booking-form-mobile-slot { display: none; margin-bottom: 20px; }

/* ── Tour meta information ───────────────────────────────────────────────── */
.tbs-tour-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--tbs-meta-bar-bg);
    border: 1px solid var(--tbs-border-color);
    border-radius: var(--tbs-radius);
}

/* Meta badge pills */
.tbs-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--tbs-card-bg, #fff);
    border: 1px solid var(--tbs-border-color);
    border-radius: 999px;
    font-size: 0.9em;
    white-space: nowrap;
}

.tbs-meta-badge.tbs-meta-price {
    border-color: var(--tbs-primary-color);
    color: var(--tbs-primary-color);
    font-weight: 700;
}

.tbs-meta-badge.tbs-meta-free {
    border-color: var(--tbs-text-success);
    color: var(--tbs-text-success);
    font-weight: 700;
}

.tbs-meta-icon {
    font-size: 0.85em;
    flex-shrink: 0;
}

/* Legacy selectors kept for theme compatibility */
.tbs-tour-price {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--tbs-primary-color);
}

.tbs-tour-free {
    color: var(--tbs-text-success);
    font-weight: bold;
}

/* ── Tour description ───────────────────────────────────────────────────── */
.tbs-tour-description {
    margin-bottom: 25px;
}

/* ── Tour guide section ──────────────────────────────────────────────────── */
.tbs-tour-guide {
    background: var(--tbs-section-card-bg);
    padding: 20px 24px;
    margin: 0 0 20px;
    border-radius: var(--tbs-radius);
    border: 1px solid var(--tbs-border-color);
    box-shadow: var(--tbs-shadow);
}

.tbs-guide-info {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.tbs-guide-avatar {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    aspect-ratio: 1 / 1;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    object-fit: cover;
    display: block;
}

.tbs-guide-details {
    min-width: 0;
    flex: 1;
}

.tbs-guide-details h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--tbs-dark);
}

/* ── Map section ─────────────────────────────────────────────────────────── */
.tbs-tour-map {
    background: var(--tbs-section-card-bg);
    padding: 20px 24px;
    margin: 0 0 20px;
    border-radius: var(--tbs-radius);
    border: 1px solid var(--tbs-border-color);
    box-shadow: var(--tbs-shadow);
    position: relative;
    z-index: 0;
    isolation: isolate;
}

#tbs-map {
    width: 100%;
    height: 220px;
    border-radius: calc(var(--tbs-radius) - 2px);
    margin-bottom: 15px;
    border: 1px solid var(--tbs-border-color);
}

/* ── Route description ───────────────────────────────────────────────────── */
.tbs-route-description {
    background: var(--tbs-section-card-bg);
    padding: 20px 24px;
    margin: 0 0 20px;
    border-radius: var(--tbs-radius);
    border: 1px solid var(--tbs-border-color);
    box-shadow: var(--tbs-shadow);
}

/* ── What to bring & refund policy ──────────────────────────────────────── */
.tbs-what-to-bring,
.tbs-refund-policy {
    background: var(--tbs-section-card-bg);
    padding: 20px 24px;
    margin: 0 0 20px;
    border-radius: var(--tbs-radius);
    border: 1px solid var(--tbs-border-color);
    box-shadow: var(--tbs-shadow);
}

/* ── Booking form ────────────────────────────────────────────────────────── */
.tbs-booking-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
}

.tbs-booking-form-container {
    background: var(--tbs-card-bg, #fff);
    padding: 0;
    border-radius: var(--tbs-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--tbs-border-color);
    overflow: hidden;
    min-width: 0;
}

.tbs-booking-form-container h3 {
    margin: 0;
    padding: 16px 20px;
    background: var(--tbs-booking-header-bg);
    color: white;
    font-size: 1.1em;
    text-align: center;
    border-bottom: none;
}

/* Inner padding for form content */
.tbs-booking-form-container .tbs-booking-form,
.tbs-booking-form-container .tbs-no-dates-available {
    padding: 20px;
}

/* ── Form rows ───────────────────────────────────────────────────────────── */
.tbs-form-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 16px;
}

.tbs-form-row label {
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--tbs-dark);
    display: block;
}

.tbs-form-row .required {
    color: var(--tbs-error, #dc2626);
}

.tbs-form-row input,
.tbs-form-row select,
.tbs-form-row textarea {
    padding: 11px 12px;
    border: 1px solid var(--tbs-border-color);
    border-radius: calc(var(--tbs-radius) - 4px);
    font-size: 16px; /* keeps iOS from zooming on focus */
    background-color: white;
    width: 100%;
    /* Prevent overflow on any screen size */
    box-sizing: border-box;
    max-width: 100%;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.tbs-form-row select {
    /* Native select needs explicit overflow handling */
    -webkit-appearance: none;
    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='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbs-form-row input:focus,
.tbs-form-row select:focus,
.tbs-form-row textarea:focus {
    border-color: var(--tbs-primary-color);
    box-shadow: var(--tbs-focus-ring);
    outline: none;
}

.tbs-form-row .description {
    font-size: 0.8em;
    color: var(--tbs-text-secondary);
    margin: 4px 0 0;
}

.tbs-form-submit {
    margin-top: 4px;
    margin-bottom: 0;
}

.tbs-submit-booking {
    background: var(--tbs-primary-color);
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 1em;
    border-radius: calc(var(--tbs-radius) - 4px);
    cursor: pointer;
    width: 100%;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s;
}

.tbs-submit-booking:hover {
    background: var(--tbs-primary-hover);
}

.tbs-booking-total {
    font-size: 1em;
    font-weight: 700;
    margin: 4px 0 16px;
    padding: 12px;
    background: var(--tbs-primary-tint);
    border-radius: calc(var(--tbs-radius) - 4px);
    text-align: center;
    color: var(--tbs-dark);
    width: 100%;
    box-sizing: border-box;
}

.tbs-form-message {
    margin-top: 12px;
    font-size: 0.95em;
}

/* ── Calendar styles ─────────────────────────────────────────────────────── */
.tbs-tour-calendar-container {
    width: 100%;
    margin: 0;
    padding: 24px 15px;
    background-color: var(--tbs-site-bg);
    overflow-x: clip;
}

/* Calendar inner content constraint */
.tbs-tour-calendar-container > * {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.fc {
    font-family: inherit;
}

/* Toolbar */
.fc .fc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.fc .fc-toolbar-title {
    font-size: 1.05em;
    font-weight: 700;
    margin: 0;
    color: var(--tbs-dark);
}
.fc .fc-button-primary {
    background-color: var(--tbs-primary-color) !important;
    border-color: var(--tbs-primary-color) !important;
    font-size: 0.8em;
    font-weight: 600;
    padding: 5px 10px;
    box-shadow: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.fc .fc-button-primary:hover {
    background-color: var(--tbs-primary-hover) !important;
    border-color: var(--tbs-primary-hover) !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background-color: var(--tbs-dark) !important;
    border-color: var(--tbs-dark) !important;
}

/* Day header row */
.fc .fc-col-header-cell {
    background-color: var(--tbs-primary-color);
    padding: 3px 0;
}
.fc .fc-col-header-cell-cushion {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75em;
    padding: 2px 4px;
}

/* Day cells — plain white by default, filled when tour exists */
.fc .fc-daygrid-day {
    background-color: white;
    cursor: default;
}
.fc .fc-daygrid-day.tbs-has-event {
    background-color: color-mix(in srgb, var(--tbs-primary-color) 15%, transparent);
    cursor: pointer;
}
.fc .fc-daygrid-day.tbs-has-event:hover,
.fc .fc-daygrid-day.tbs-has-event.tbs-day-active {
    background-color: color-mix(in srgb, var(--tbs-primary-color) 28%, transparent);
}
.fc .fc-daygrid-day.fc-day-today {
    background-color: var(--tbs-highlight);
}
.fc .fc-daygrid-day.fc-day-today.tbs-has-event {
    background-color: color-mix(in srgb, var(--tbs-primary-color) 22%, transparent);
}
.fc .fc-daygrid-day-number {
    color: var(--tbs-text-secondary);
    text-decoration: none;
    font-size: 1em;
    padding: 4px 6px;
}
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    font-weight: bold;
    color: var(--tbs-dark);
}
.fc .fc-daygrid-day.tbs-has-event .fc-daygrid-day-number {
    color: var(--tbs-dark);
    font-weight: 600;
}
.fc .fc-daygrid-day-frame {
    min-height: 18px;
}
.fc .fc-daygrid-day-events {
    min-height: 0 !important;
    margin-bottom: 0 !important;
}

/* Hide FullCalendar event label elements — background fill replaces them */
.fc .fc-daygrid-event-harness,
.fc .fc-daygrid-more-link,
.fc .fc-popover {
    display: none !important;
}

#tbs-calendar {
    margin-bottom: 0;
    overflow: visible;
}


/* ── Detail panel ────────────────────────────────────────────────────────── */
.tbs-calendar-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 2px;
}
.tbs-calendar-detail.is-open {
    max-height: 600px;
    padding: 14px 2px 4px;
    border-top: 1px solid var(--tbs-border-color);
    margin-top: 12px;
}
.tbs-detail-date {
    font-size: 0.85em;
    font-weight: 700;
    color: var(--tbs-dark);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--tbs-border-color);
}
.tbs-detail-tours {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tbs-detail-tour-item {
    margin: 0;
}
.tbs-detail-tour-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--tbs-card-bg, #fff);
    border: 1px solid var(--tbs-border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--tbs-dark);
    font-size: 0.9em;
    transition: background 0.15s, border-color 0.15s;
}
.tbs-detail-tour-link:hover {
    background: color-mix(in srgb, var(--tbs-primary-color) 6%, transparent);
    border-color: var(--tbs-primary-color);
    color: var(--tbs-dark);
    text-decoration: none;
}
.tbs-detail-tour-name {
    flex: 1;
    font-weight: 600;
}
.tbs-detail-spots {
    font-size: 0.8em;
    color: var(--tbs-text-secondary);
    white-space: nowrap;
}
.tbs-spots-unlimited {
    color: var(--tbs-text-success);
}
.tbs-detail-arrow {
    color: var(--tbs-primary-color);
    font-size: 1.1em;
    line-height: 1;
}

/* ── Tour archive/grid ───────────────────────────────────────────────────── */
.tbs-tour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.tbs-tour-card {
    border: 1px solid var(--tbs-border-color);
    border-radius: 10px;
    overflow: hidden;
    transition:
        transform 0.3s,
        box-shadow 0.3s;
    background: var(--tbs-card-bg, #fff);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--tbs-shadow);
}

.tbs-tour-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.tbs-tour-image {
    position: relative;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.tbs-tour-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.tbs-tour-image:hover img {
    transform: scale(1.05);
}

.tbs-tour-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tbs-tour-card h2 {
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 15px;
}

.tbs-tour-card h2 a {
    color: var(--tbs-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.tbs-tour-card h2 a:hover {
    color: var(--tbs-primary-color);
}

.tbs-tour-card .tbs-tour-price {
    font-size: 1.1em;
    margin-bottom: 10px;
    font-weight: 600;
}

.tbs-tour-card .tbs-tour-free {
    color: var(--tbs-text-success);
    font-weight: bold;
}

.tbs-tour-card .tbs-tour-duration {
    font-size: 0.9em;
    margin-bottom: 8px;
    color: var(--tbs-text-secondary);
}

.tbs-tour-card .tbs-tour-guide-info {
    font-size: 0.9em;
    margin-bottom: 10px;
    color: var(--tbs-text-secondary);
    font-style: italic;
}

.tbs-tour-excerpt {
    font-size: 0.9em;
    margin: 10px 0 15px 0;
    line-height: 1.5;
    flex-grow: 1;
    color: var(--tbs-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tbs-tour-location {
    font-size: 0.9em;
    margin-bottom: 10px;
    color: var(--tbs-text-secondary);
}

.tbs-tour-card-map {
    position: relative;
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
    line-height: 0;
}

.tbs-tour-card-map iframe {
    width: 100%;
    height: 150px;
    border: 0;
    display: block;
}

.tbs-tour-button {
    display: inline-block;
    background: var(--tbs-primary-color);
    color: white;
    padding: 10px 18px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.95em;
    margin-top: 15px;
    transition: background 0.3s;
    align-self: flex-start;
    font-weight: 600;
}

.tbs-tour-button:hover {
    background: var(--tbs-primary-hover);
    color: white;
}

/* ── Tour listings shortcode wrapper ─────────────────────────────────────── */
.tbs-tour-listings {
    width: 100%;
    margin: 0;
    padding: 24px 15px;
}

/* ── Tour archive page ───────────────────────────────────────────────────── */
.tbs-tour-archive {
    width: 100%;
    margin: 0;
    padding: 24px 15px 0;
}

.tbs-tour-archive h1 {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.8em;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--tbs-border-color);
    color: var(--tbs-dark);
}

.tbs-tour-calendar-container + .tbs-tour-archive {
    margin-top: 30px;
}

.tbs-tour-archive .navigation.pagination {
    margin-top: 30px;
    text-align: center;
}

.tbs-tour-archive .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    background: var(--tbs-gray-light);
    border: 1px solid var(--tbs-border-color);
    border-radius: var(--tbs-radius);
    text-decoration: none;
    color: var(--tbs-dark);
}

.tbs-tour-archive .page-numbers.current {
    background: var(--tbs-primary-color);
    color: white;
    border-color: var(--tbs-primary-color);
}

.tbs-tour-archive .page-numbers:hover:not(.current) {
    background: var(--tbs-gray-medium);
}

/* ── Calendar + tour list within container ───────────────────────────────── */
.tbs-tour-calendar-container .tbs-tour-list {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px solid var(--tbs-border-color);
}

.tbs-tour-calendar-container .tbs-tour-list h3 {
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 25px;
    padding: 15px;
    background-color: var(--tbs-light);
    border-radius: var(--tbs-radius);
    border: 1px solid var(--tbs-border-color);
    box-shadow: var(--tbs-shadow);
    text-align: center;
    color: var(--tbs-dark);
}

.tbs-tour-calendar-container .tbs-tours {
    margin-top: 30px;
}

.tbs-tour-calendar-container .tbs-tour-item {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--tbs-card-bg, #fff);
    border-radius: var(--tbs-radius);
    border: 1px solid var(--tbs-border-color);
    box-shadow: var(--tbs-shadow);
}

/* ── Single tour page overrides ──────────────────────────────────────────── */
.single-tbs_tour .wp-block-post-date,
.single-tbs_tour .wp-block-post-author,
.single-tbs_tour .wp-block-post-terms,
.single-tbs_tour .wp-site-blocks .wp-block-post-date,
.single-tbs_tour .wp-site-blocks .wp-block-post-author,
.single-tbs_tour .entry-meta,
.single-tbs_tour .entry-footer,
.single-tbs_tour .post-meta,
.single-tbs_tour .author-bio {
    display: none !important;
}

.single-tbs_tour .entry-content,
.single-tbs_tour article.tbs_tour {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

.single-tbs_tour .wp-post-image,
.single-tbs_tour .post-thumbnail img,
.single-tbs_tour .entry-content img:first-child:not(.tbs-guide-avatar) {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--tbs-radius);
    margin-bottom: 20px;
    box-shadow: var(--tbs-shadow);
}

.single-tbs_tour .entry-content .wp-block-post-featured-image,
.single-tbs_tour .post-thumbnail {
    margin-bottom: 30px;
}

.single-tbs_tour .entry-content .wp-block-post-featured-image img,
.single-tbs_tour .post-thumbnail img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--tbs-radius);
    box-shadow: var(--tbs-shadow);
}

/* ── Guide profile link ──────────────────────────────────────────────────── */
.tbs-guide-profile-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--tbs-primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.tbs-guide-profile-link:hover {
    color: var(--tbs-primary-hover);
    text-decoration: underline;
}

/* ── Guide Profile page ──────────────────────────────────────────────────── */
.tbs-guide-profile {
    width: 100%;
    margin: 0;
    padding: 24px 15px 0;
}

.tbs-guide-header {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--tbs-light);
    border-radius: var(--tbs-radius);
    border: 1px solid var(--tbs-border-color);
    box-shadow: var(--tbs-shadow);
}

.tbs-guide-avatar-large {
    margin-bottom: 15px;
    flex-shrink: 0;
}

.tbs-guide-avatar-large img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--tbs-primary-color);
    object-fit: cover;
    display: block;
}

.tbs-guide-info-main {
    flex: 1;
}

.tbs-guide-name {
    margin: 0 0 10px 0;
    color: var(--tbs-dark);
    font-size: 2.2em;
    font-weight: bold;
}

.tbs-guide-experience,
.tbs-guide-languages,
.tbs-guide-specialties {
    margin-bottom: 8px;
    color: var(--tbs-text-secondary);
}

.tbs-guide-experience strong,
.tbs-guide-languages strong,
.tbs-guide-specialties strong {
    color: var(--tbs-primary-color);
}

.tbs-guide-description {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--tbs-card-bg, #fff);
    border-radius: var(--tbs-radius);
    border: 1px solid var(--tbs-border-color);
    box-shadow: var(--tbs-shadow);
}

.tbs-guide-description h2 {
    margin-top: 0;
    color: var(--tbs-dark);
    border-bottom: 2px solid var(--tbs-primary-color);
    padding-bottom: 10px;
}

.tbs-guide-tours {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
}

.tbs-guide-tours h2 {
    margin-bottom: 20px;
    color: var(--tbs-dark);
    border-bottom: 2px solid var(--tbs-primary-color);
    padding-bottom: 10px;
}

.tbs-guide-tours-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.tbs-guide-tour-card {
    background: var(--tbs-card-bg, #fff);
    border-radius: var(--tbs-radius);
    border: 1px solid var(--tbs-border-color);
    box-shadow: var(--tbs-shadow);
    overflow: hidden;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.tbs-guide-tour-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.tbs-guide-tour-image {
    overflow: hidden;
}

.tbs-guide-tour-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tbs-guide-tour-image:hover img {
    transform: scale(1.05);
}

.tbs-guide-tour-content {
    padding: 20px;
}

.tbs-guide-tour-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.tbs-guide-tour-content h3 a {
    color: var(--tbs-dark);
    text-decoration: none;
}

.tbs-guide-tour-content h3 a:hover {
    color: var(--tbs-primary-color);
}

.tbs-guide-tour-excerpt {
    margin-bottom: 15px;
    color: var(--tbs-text-secondary);
    line-height: 1.6;
}

/* ── Booking Confirmation Guide Section ──────────────────────────────────── */
.tbs-booking-guide-info {
    margin-top: 30px;
    padding: 20px;
    background: var(--tbs-light);
    border-radius: var(--tbs-radius);
    border: 1px solid var(--tbs-border-color);
    box-shadow: var(--tbs-shadow);
}

.tbs-booking-guide-info h3 {
    margin-top: 0;
    color: var(--tbs-dark);
    border-bottom: 2px solid var(--tbs-primary-color);
    padding-bottom: 10px;
}

.tbs-booking-guide-info .tbs-guide-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

.tbs-booking-guide-info .tbs-guide-avatar {
    border-radius: 50%;
    border: 2px solid var(--tbs-primary-color);
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.tbs-booking-guide-info .tbs-guide-details h4 {
    margin: 0 0 5px 0;
    color: var(--tbs-dark);
}

.tbs-booking-guide-info .tbs-guide-description {
    color: var(--tbs-text-secondary);
    margin: 10px 0;
}

.tbs-booking-guide-info .tbs-guide-profile-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--tbs-primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.tbs-booking-guide-info .tbs-guide-profile-link:hover {
    color: var(--tbs-primary-hover);
    text-decoration: underline;
}

/* ── Booking Confirmation page ───────────────────────────────────────────── */
.tbs-booking-confirmation {
    width: 100%;
    margin: 0;
    padding: 24px 15px 0;
    box-sizing: border-box;
}

.tbs-booking-confirmation .tbs-booking-details {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.tbs-booking-details {
    background: var(--tbs-card-bg, #fff);
    border: 1px solid var(--tbs-border-color);
    border-radius: var(--tbs-radius);
    box-shadow: var(--tbs-shadow);
    padding: 24px;
    margin-bottom: 24px;
    overflow: hidden;
}

.tbs-booking-info-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tbs-booking-info {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.tbs-booking-info th,
.tbs-booking-info td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--tbs-border-color);
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

.tbs-booking-info th {
    width: 35%;
    font-weight: 600;
    color: var(--tbs-dark);
    white-space: nowrap;
}

.tbs-booking-info tr:last-child th,
.tbs-booking-info tr:last-child td {
    border-bottom: none;
}

/* Status alert boxes */
.tbs-pending-message,
.tbs-approved-message,
.tbs-cancelled-message,
.tbs-rejected-message {
    padding: 14px 18px;
    border-radius: var(--tbs-radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
}

.tbs-pending-message   { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.tbs-approved-message  { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.tbs-cancelled-message,
.tbs-rejected-message  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Status badge system ─────────────────────────────────────────────────── */
.tbs-booking-status,
.tbs-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--tbs-radius-sm);
    font-size: 0.85em;
    font-weight: 600;
}

.tbs-status-pending             { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.tbs-status-approved            { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.tbs-status-cancelled,
.tbs-status-rejected            { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.tbs-status-cancelled_by_guide  { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.tbs-status-completed           { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── My Bookings page ────────────────────────────────────────────────────── */
.tbs-my-bookings {
    width: 100%;
    margin: 0;
    padding: 24px 15px 0;
    box-sizing: border-box;
}

.tbs-my-bookings .tbs-bookings-list {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Page header ─────────────────────────────────────────────────────────── */
.tbs-page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--tbs-border-color);
}

.tbs-page-title {
    margin: 0;
    color: var(--tbs-dark);
    font-size: 2em;
}

.tbs-bookings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tbs-booking-card {
    display: flex;
    background: var(--tbs-card-bg, #fff);
    border: 1px solid var(--tbs-border-color);
    border-radius: var(--tbs-radius);
    box-shadow: var(--tbs-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.tbs-booking-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.tbs-past-booking {
    opacity: 0.65;
}

.tbs-booking-card-accent {
    width: 5px;
    flex-shrink: 0;
    background: var(--tbs-primary-color);
    border-radius: var(--tbs-radius) 0 0 var(--tbs-radius);
}

.tbs-booking-card-body {
    flex: 1;
    padding: 18px 20px;
    min-width: 0;
}

.tbs-booking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tbs-booking-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.tbs-booking-tour-name {
    margin: 0;
    font-size: 1.05em;
    font-weight: 700;
    color: var(--tbs-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbs-booking-tour-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.tbs-booking-tour-name a:hover {
    color: var(--tbs-primary-color);
}

.tbs-booking-past-label {
    font-size: 0.75em;
    color: var(--tbs-text-secondary);
    background: var(--tbs-gray-light);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--tbs-border-color);
    white-space: nowrap;
}

.tbs-booking-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--tbs-gray-light);
    border-radius: calc(var(--tbs-radius) - 2px);
}

.tbs-booking-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tbs-meta-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tbs-text-secondary);
    font-weight: 600;
}

.tbs-meta-value {
    font-size: 0.95em;
    color: var(--tbs-dark);
    font-weight: 500;
}

.tbs-booking-price {
    color: var(--tbs-primary-color);
    font-weight: 700;
}

.tbs-booking-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Shared plugin buttons ───────────────────────────────────────────────── */
.tbs-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: calc(var(--tbs-radius) - 2px);
    font-size: 0.88em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1.4;
}

.tbs-btn-outline {
    background: transparent;
    color: var(--tbs-primary-color);
    border: 1.5px solid var(--tbs-primary-color);
}

.tbs-btn-outline:hover {
    background: var(--tbs-primary-color);
    color: #fff;
}

.tbs-btn-danger {
    background: transparent;
    color: #dc2626;
    border: 1.5px solid #dc2626;
}

.tbs-btn-danger:hover {
    background: #dc2626;
    color: #fff;
}

/* ── Guide Directory ─────────────────────────────────────────────────────── */
.tbs-guide-directory {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    width: 100%;
    margin: 0;
    padding: 24px 15px;
}

.tbs-guide-card {
    display: flex;
    flex-direction: column;
    background: var(--tbs-card-bg, #fff);
    border: 1px solid var(--tbs-border-color);
    border-radius: var(--tbs-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--tbs-shadow);
}

.tbs-guide-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.tbs-guide-card-header {
    background: var(--tbs-primary-color);
    height: 70px;
    position: relative;
    flex-shrink: 0;
}

.tbs-guide-card .tbs-guide-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: absolute;
    bottom: -38px;
    left: 50%;
    transform: translateX(-50%);
}

.tbs-guide-card .tbs-guide-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    border: none;
    box-shadow: none;
    display: block;
}

.tbs-guide-card-info {
    padding: 50px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: center;
    text-align: center;
}

.tbs-guide-card-info .tbs-guide-name {
    font-size: 1.15rem;
    margin: 0 0 12px;
}

.tbs-guide-card-info .tbs-guide-name a {
    color: var(--tbs-dark);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.tbs-guide-card-info .tbs-guide-name a:hover {
    color: var(--tbs-primary-color);
}

.tbs-guide-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}

.tbs-guide-pill {
    display: inline-block;
    background: var(--tbs-gray-light);
    color: var(--tbs-text-secondary);
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--tbs-border-color);
}

.tbs-guide-card-info .tbs-guide-excerpt {
    font-size: 0.88rem;
    color: var(--tbs-text-secondary);
    margin: 0 0 16px;
    flex: 1;
    line-height: 1.5;
}

.tbs-guide-view-btn {
    align-self: center;
    margin-top: auto;
}

/* ── Guide Dashboard ─────────────────────────────────────────────────────── */
.tbs-guide-dashboard {
    width: 100%;
    margin: 0;
    padding: 24px 15px 0;
    overflow-x: clip;
}

.tbs-guide-summary,
.tbs-guide-bookings {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.tbs-guide-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.tbs-guide-summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--tbs-gray-light);
    border-radius: var(--tbs-radius);
    padding: 16px 24px;
    min-width: 100px;
    flex: 1;
}

.tbs-guide-summary-number {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--tbs-primary-color);
    line-height: 1;
}

.tbs-guide-summary-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tbs-text-muted);
    margin-top: 4px;
}

.tbs-guide-tour-section {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    background: var(--tbs-card-bg, #fff);
    border: 1px solid var(--tbs-border-color);
    border-radius: var(--tbs-radius);
    box-shadow: var(--tbs-shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.tbs-guide-tour-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-left: 4px solid var(--tbs-primary-color);
    background: var(--tbs-gray-light);
}

.tbs-guide-tour-thumb-wrap {
    flex-shrink: 0;
}

.tbs-guide-tour-thumb-wrap img,
.tbs-guide-tour-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--tbs-radius-sm);
    display: block;
}

.tbs-guide-tour-title {
    flex: 1;
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--tbs-dark);
}

.tbs-guide-tour-count {
    font-size: 0.8em;
    color: var(--tbs-text-muted);
    white-space: nowrap;
}

.tbs-guide-bookings-table {
    overflow-x: auto;
}

.tbs-guide-bookings-table table {
    width: 100%;
    border-collapse: collapse;
}

.tbs-guide-bookings-table th {
    background: var(--tbs-gray-light);
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tbs-text-muted);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--tbs-border-color);
}

.tbs-guide-bookings-table td {
    padding: 10px 14px;
    font-size: 0.9em;
    border-bottom: 1px solid var(--tbs-border-color);
    vertical-align: middle;
}

.tbs-guide-bookings-table tr:last-child td {
    border-bottom: none;
}

.tbs-guide-customer-name {
    display: block;
    font-weight: 500;
}

.tbs-guide-customer-email {
    display: block;
    font-size: 0.85em;
    color: var(--tbs-text-muted);
}

.tbs-btn-sm {
    padding: 4px 12px;
    font-size: 0.8em;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   (all @media rules consolidated here, after all base component rules)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Mobile-only (max 599px) — tap targets, iOS zoom prevention ──────────── */
@media (max-width: 599px) {
    .tbs-form-row input,
    .tbs-form-row select,
    .tbs-form-row textarea {
        min-height: 48px;
    }

    .tbs-submit-booking,
    .tbs-tour-button {
        min-height: 48px;
        width: 100%;
        text-align: center;
    }

    .fc .fc-toolbar-chunk .fc-button {
        min-height: 38px;
        padding: 4px 7px;
        font-size: 0.75em;
    }

    .tbs-tour-details > div {
        margin-bottom: 25px;
    }

    .tbs-form-row {
        margin-bottom: 15px;
    }

    .tbs-tour-details h3 {
        font-size: 1.4em;
        margin-top: 30px;
    }

    .tbs-tour-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-bottom: 25px;
    }

    .tbs-tour-content-wrapper,
    .tbs-tour-archive,
    .tbs-guide-profile,
    .tbs-guide-dashboard,
    .tbs-guide-directory,
    .tbs-tour-listings,
    .tbs-booking-confirmation,
    .tbs-my-bookings {
        padding-right: 10px;
        padding-left: 10px;
    }

    .tbs-tour-archive h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .tbs-guide-name {
        font-size: 1.8em;
    }

    .tbs-col-email,
    .tbs-col-guests,
    .tbs-col-price {
        display: none;
    }

    .tbs-guide-bookings-table th.tbs-col-guests,
    .tbs-guide-bookings-table th.tbs-col-price {
        display: none;
    }

    .tbs-guide-summary {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tbs-guide-summary-stat {
        padding: 12px 10px;
        min-width: 0;
        text-align: center;
    }

    .tbs-guide-summary-stat:last-child {
        grid-column: 1 / -1;
    }

    /* Booking confirmation: reduce card padding, stack table rows */
    .tbs-booking-confirmation,
    .tbs-my-bookings {
        padding-right: 10px;
        padding-left: 10px;
    }

    .tbs-booking-details {
        padding: 14px;
    }

    .tbs-booking-info th,
    .tbs-booking-info td {
        display: block;
        width: 100%;
        padding: 6px 0;
    }

    .tbs-booking-info th {
        border-bottom: none;
        padding-bottom: 2px;
        white-space: normal;
    }

    .tbs-booking-info td {
        padding-top: 0;
        padding-bottom: 10px;
    }

    .tbs-booking-info tr {
        display: block;
        border-bottom: 1px solid var(--tbs-border-color);
        padding: 8px 0;
    }

    .tbs-booking-info tr:last-child {
        border-bottom: none;
    }

    .tbs-booking-info tr:last-child th,
    .tbs-booking-info tr:last-child td {
        border-bottom: none;
    }
}

/* ── Tablet (min 600px) ──────────────────────────────────────────────────── */
@media (min-width: 600px) {
    /* Tour meta row */
    .tbs-tour-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
        padding: 15px 20px;
    }

    .tbs-guide-avatar {
        width: 96px;
        height: 96px;
    }

    /* Map height */
    #tbs-map { height: 350px; }

    /* Form padding */
    .tbs-booking-form-container {
        padding: 25px;
    }

    .tbs-tour-guide,
    .tbs-tour-map,
    .tbs-what-to-bring,
    .tbs-refund-policy {
        padding: 10px 20px;
    }

    .tbs-route-description {
        padding: 10px 20px;
    }

    /* Submit button not full-width on tablet+ */
    .tbs-submit-booking {
        width: 100%;
    }

    /* Calendar: no overrides needed at tablet — base styles are already good */

    /* Tour grid: gap increase on tablet */
    .tbs-tour-grid { gap: 25px; }

    .tbs-tour-listings .tbs-tour-grid[data-columns="1"] { grid-template-columns: 1fr; }
    .tbs-tour-listings .tbs-tour-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
    .tbs-tour-listings .tbs-tour-grid[data-columns="3"] { grid-template-columns: repeat(2, 1fr); }
    .tbs-tour-listings .tbs-tour-grid[data-columns="4"] { grid-template-columns: repeat(2, 1fr); }

    /* Guide directory: 2 columns */
    .tbs-guide-directory { grid-template-columns: repeat(2, 1fr); }

    /* Guide profile header: horizontal */
    .tbs-guide-header {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }

    .tbs-guide-avatar-large {
        margin-right: 20px;
        margin-bottom: 0;
        align-self: auto;
    }

    /* Booking card header flex */
    .tbs-booking-header {
        flex-wrap: nowrap;
    }

    /* Booking guide info: horizontal */
    .tbs-booking-guide-info .tbs-guide-info {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }
}

/* ── Tablet landscape (min 768px) ───────────────────────────────────────── */
@media (min-width: 768px) {
    /* Tour archive: left-align title, 3 columns */
    .tbs-tour-archive h1 {
        font-size: 2em;
    }

    /* Tour grid: 3 columns on tablet landscape */
    .tbs-tour-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 28px;
    }

    /* Guide directory: 3 columns */
    .tbs-guide-directory { grid-template-columns: repeat(3, 1fr); }

    /* My Bookings / Booking Confirmation: full width, inner content constrained */
    .tbs-my-bookings,
    .tbs-booking-confirmation {
        max-width: 100%;
    }

    /* Booking meta grid: 3 cols */
    .tbs-booking-meta-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tbs-guide-avatar-large {
        margin-right: 24px;
    }
}

/* ── Single-column tour layout: show inline booking slot, hide sidebar ───── */
@media (max-width: 959px) {
    .tbs-tour-sidebar { display: none; }
    .tbs-booking-form-mobile-slot { display: block; }
}

/* ── Desktop (min 960px) ─────────────────────────────────────────────────── */
@media (min-width: 960px) {
    /* Two-column tour detail layout using explicit wrapper divs */
    .tbs-tour-details {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) 340px;
        grid-template-areas: "main sidebar";
        gap: 40px;
        align-items: start;
    }

    .tbs-tour-main-content {
        grid-area: main;
    }

    .tbs-tour-sidebar {
        grid-area: sidebar;
        position: sticky;
        top: 30px;
        align-self: start;
    }

    /* Map height */
    #tbs-map { height: 400px; }

    .tbs-tour-archive,
    .tbs-tour-listings,
    .tbs-guide-profile,
    .tbs-guide-directory,
    .tbs-my-bookings,
    .tbs-booking-confirmation,
    .tbs-tour-content-wrapper {
        padding-left: 32px;
        padding-right: 32px;
    }

    /* Calendar */
    .tbs-tour-calendar-container {
        padding: 24px 32px;
    }
    .fc { margin: 0 auto; }
    .fc .fc-toolbar-title { font-size: 1.1em; }
    .fc .fc-daygrid-day-frame { min-height: 18px; }

    /* Tour grid: 3 columns min on desktop */
    .tbs-tour-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 30px;
    }

    .tbs-tour-listings .tbs-tour-grid[data-columns="1"] { grid-template-columns: 1fr; }
    .tbs-tour-listings .tbs-tour-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
    .tbs-tour-listings .tbs-tour-grid[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
    .tbs-tour-listings .tbs-tour-grid[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }

    /* Guide directory: auto-fill */
    .tbs-guide-directory { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

    /* Guide profile tours: 2-col auto-fill */
    .tbs-guide-tours-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

    /* Guide dashboard: full width, inner content constrained */
    .tbs-guide-dashboard { max-width: 100%; }

    /* Booking card meta: 3 cols on desktop */
    .tbs-booking-meta-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Large desktop (min 1200px) ──────────────────────────────────────────── */
@media (min-width: 1200px) {
    .tbs-tour-details {
        grid-template-columns: minmax(0, 1.4fr) 380px;
        gap: 48px;
    }

    .tbs-tour-calendar-container { padding: 24px; }

    /* 4-col auto-fill for archive grid on large screens */
    .tbs-tour-archive .tbs-tour-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* ── Tablet and below: cover image adjustments ───────────────────────────── */
@media (max-width: 767px) {
    .single-tbs_tour .wp-post-image,
    .single-tbs_tour .post-thumbnail img,
    .single-tbs_tour .entry-content img:first-child:not(.tbs-guide-avatar),
    .single-tbs_tour .entry-content .wp-block-post-featured-image img {
        height: 250px;
        max-height: 250px;
    }

    .tbs-booking-guide-info .tbs-guide-info {
        flex-direction: column;
        text-align: center;
    }

    .tbs-booking-guide-info .tbs-guide-avatar {
        align-self: center;
    }

    /* Calendar: mobile compact */
    .tbs-tour-calendar-container {
        padding: 6px 10px;
        margin: 0 0 16px;
    }
    .fc .fc-toolbar {
        gap: 6px;
        margin-bottom: 8px;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }
    .fc .fc-toolbar-chunk {
        flex-shrink: 1;
        min-width: 0;
    }
    .fc .fc-toolbar-title {
        display: inline-block;
        max-width: 90px;
        font-size: 0.72em;
        white-space: normal;
        word-break: break-word;
        text-align: center;
        line-height: 1.2;
    }
    .fc .fc-toolbar-chunk .fc-button,
    .fc .fc-toolbar-chunk .fc-button-primary {
        padding: 2px 6px !important;
        font-size: 0.65em;
        min-height: 26px;
        line-height: 1.2;
    }
    .fc .fc-toolbar-chunk:first-child .fc-button {
        margin-right: 2px;
    }
    .fc .fc-col-header-cell-cushion { font-size: 0.6em; padding: 2px 1px; }
    .fc .fc-col-header-cell { padding: 2px 0; }
    .fc .fc-daygrid-day-frame { min-height: 14px; }
    .fc .fc-daygrid-day-top {
        flex-direction: row;
        justify-content: flex-end;
    }
    .fc .fc-daygrid-day-number {
        font-size: 0.78em;
        padding: 2px 3px;
        line-height: 1;
        display: block;
    }
    .tbs-detail-tour-link { padding: 10px; font-size: 0.85em; }
}

/* Guide Dashboard — action buttons */
.tbs-btn-approve { background: #16a34a; color: #fff; border-color: #16a34a; }
.tbs-btn-approve:hover { background: #15803d; border-color: #15803d; }
.tbs-btn-reject  { background: #b45309; color: #fff; border-color: #b45309; }
.tbs-btn-reject:hover { background: #92400e; border-color: #92400e; }
.tbs-btn-danger  { background: #991b1b; color: #fff; border-color: #991b1b; }
.tbs-btn-danger:hover { background: #7f1d1d; border-color: #7f1d1d; }

.tbs-guide-action-cell { white-space: nowrap; }
.tbs-guide-action-cell > * { display: inline-flex; vertical-align: middle; }
.tbs-guide-action-cell > * + * { margin-left: 4px; }
.tbs-guide-reject-wrap { display: flex; flex-direction: column; gap: 4px; }
.tbs-guide-reject-reason { display: none; }
.tbs-guide-reject-reason textarea { width: 100%; min-height: 56px; margin-top: 4px; font-size: 0.85em; }
.tbs-guide-bookings-table td:last-child,
.tbs-guide-bookings-table th:last-child { width: 1%; white-space: nowrap; }

/* Guide Dashboard — filter tabs + search */
.tbs-guide-controls {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 16px;
}
.tbs-guide-search input[type="search"] {
    padding: 6px 10px;
    border: 1px solid var(--tbs-border-color);
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 200px;
}
.tbs-guide-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tbs-filter-tab {
    padding: 5px 14px;
    border: 1px solid var(--tbs-border-color);
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    font-size: 0.88em;
    color: var(--tbs-text-secondary);
    transition: background 0.15s, color 0.15s;
}
.tbs-filter-tab:hover { background: var(--tbs-card-bg, #f9fafb); }
.tbs-filter-tab--active {
    background: var(--tbs-primary-color);
    color: #fff;
    border-color: var(--tbs-primary-color);
}
.tbs-tab-badge {
    display: inline-block;
    background: #fff;
    color: var(--tbs-primary-color);
    border-radius: 10px;
    font-size: 0.78em;
    font-weight: 700;
    padding: 0 5px;
    margin-left: 3px;
    line-height: 1.5;
}
.tbs-filter-tab--active .tbs-tab-badge { color: var(--tbs-primary-color); }

/* Pending stat alert */
.tbs-guide-summary-stat--alert {
    background: #fef9c3;
    border-radius: 8px;
    padding: 8px 12px;
}
.tbs-guide-summary-stat--alert .tbs-guide-summary-number { color: #854d0e; }

/* Next Upcoming Tour card */
.tbs-next-tour-card {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 22px;
    background: var(--tbs-primary-color, #2563eb);
    color: #fff;
    border-radius: var(--tbs-radius, 8px);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
a.tbs-next-tour-card {
    text-decoration: none;
    cursor: pointer;
}
a.tbs-next-tour-card:hover {
    opacity: 0.92;
}
.tbs-next-tour-card__label {
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
}
.tbs-next-tour-card__title {
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.2;
}
.tbs-next-tour-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
    font-size: 0.9em;
    opacity: 0.92;
}
.tbs-next-tour-card__pending-badge {
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.8em;
    font-weight: 600;
}

/* Customer phone + notes */
.tbs-guide-customer-phone {
    display: block;
    font-size: 0.82em;
    color: var(--tbs-primary-color);
    text-decoration: none;
}
.tbs-guide-customer-phone:hover { text-decoration: underline; }
.tbs-guide-customer-notes-wrap { font-size: 0.78em; color: var(--tbs-text-secondary); }
.tbs-guide-customer-notes-wrap summary { cursor: pointer; font-style: italic; list-style: none; }
.tbs-guide-customer-notes-wrap summary::-webkit-details-marker { display: none; }
.tbs-guide-customer-notes-full { display: block; margin-top: 4px; font-style: normal; }

/* Cancel modal */
.tbs-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.tbs-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.tbs-modal-box {
    position: relative;
    background: var(--tbs-card-bg, #fff);
    border-radius: 8px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    z-index: 1;
}
.tbs-modal-box h3 { margin: 0 0 12px; }
.tbs-modal-warning { color: var(--tbs-error, #dc2626); font-size: 0.9em; margin-bottom: 12px; }
.tbs-modal-actions { display: flex; gap: 8px; margin-top: 16px; }

/* Edit Schedule modal */
.tbs-modal-box--wide { max-width: 540px; }
.tbs-schedule-form { margin-top: 8px; }
.tbs-schedule-field-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.tbs-schedule-field-row label {
    min-width: 110px;
    font-size: 0.88em;
    font-weight: 500;
    color: var(--tbs-text-secondary);
}
.tbs-schedule-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--tbs-border-color);
    border-radius: 4px;
    font-size: 0.9em;
}
.tbs-schedule-field-group { margin-bottom: 12px; }
.tbs-schedule-field-group > label {
    display: block;
    font-size: 0.88em;
    font-weight: 500;
    color: var(--tbs-text-secondary);
    margin-bottom: 6px;
}
.tbs-schedule-days-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tbs-day-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.88em;
    cursor: pointer;
}
.tbs-schedule-specific-dates textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--tbs-border-color);
    border-radius: 4px;
    font-size: 0.88em;
    font-family: monospace;
}

/* Reports page */
.tbs-reports-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 20px 0;
}
.tbs-reports-stat {
    background: var(--tbs-card-bg, #fff);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px 24px;
    text-align: center;
    min-width: 140px;
}
.tbs-reports-stat-number { display: block; font-size: 2em; font-weight: 700; color: var(--tbs-primary-color, #2563eb); }
.tbs-reports-stat-label  { display: block; font-size: 0.85em; color: #555; margin-top: 4px; }
.tbs-reports-chart-wrap  { background: var(--tbs-card-bg, #fff); border: 1px solid #ddd; border-radius: 8px; padding: 20px; margin-top: 20px; }

/* ── Guide Login Form ──────────────────────────────────────────── */
.tbs-guide-login {
    width: 100%;
    margin: 0;
    padding: 48px 15px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.tbs-guide-login .tbs-login-card {
    width: 100%;
    max-width: 440px;
    background: var(--tbs-card-bg, #fff);
    border: 1px solid var(--tbs-border-color, #cbd5e1);
    border-radius: var(--tbs-radius, 8px);
    padding: 40px 40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
}
.tbs-guide-login h2 {
    margin: 0 0 8px;
    font-size: 1.6em;
    color: var(--tbs-primary-color, #2563eb);
    text-align: center;
}
.tbs-guide-login .tbs-login-subtitle {
    margin: -16px 0 24px;
    font-size: 0.9em;
    color: var(--tbs-text-secondary, #64748b);
    text-align: center;
}
.tbs-guide-login .tbs-form-row {
    margin-bottom: 16px;
}
.tbs-guide-login .tbs-form-row label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--tbs-dark, #1e293b);
}
.tbs-guide-login input[type="text"],
.tbs-guide-login input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--tbs-border-color, #cbd5e1);
    border-radius: calc(var(--tbs-radius, 8px) - 2px);
    background: var(--tbs-light, #f8fafc);
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tbs-guide-login input[type="text"]:focus,
.tbs-guide-login input[type="password"]:focus {
    border-color: var(--tbs-primary-color, #2563eb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tbs-primary-color, #2563eb) 20%, transparent);
    outline: none;
    background: #fff;
}
.tbs-guide-login .tbs-login-btn {
    display: block;
    width: 100%;
    padding: 13px 20px;
    margin-top: 8px;
    background: var(--tbs-primary-color, #2563eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}
.tbs-guide-login .tbs-login-btn:hover {
    background: var(--tbs-primary-hover, #1d4ed8);
}
.tbs-guide-login .tbs-login-btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}
.tbs-guide-login .tbs-login-message {
    margin-top: 14px;
    font-size: 0.95em;
    color: var(--tbs-error, #dc2626);
    min-height: 1.2em;
}
.tbs-guide-login .tbs-login-message.success {
    color: var(--tbs-text-success, #16a34a);
}
.tbs-guide-login .tbs-login-forgot {
    text-align: center;
    margin-top: 16px;
    font-size: 0.875em;
}
.tbs-guide-login .tbs-login-forgot a {
    color: var(--tbs-text-secondary, #64748b);
    text-decoration: none;
}
.tbs-guide-login .tbs-login-forgot a:hover {
    color: var(--tbs-primary-color, #2563eb);
    text-decoration: underline;
}
@media (max-width: 480px) {
    .tbs-guide-login {
        padding: 24px 16px;
    }
    .tbs-guide-login .tbs-login-card {
        padding: 20px 16px;
    }
}
