/**
 * BookingSummary Component Styles
 * 
 * Theme-independent styling for the booking summary component.
 * Displays cart contents, pricing breakdown, and item management options.
 * 
 * @package HotelMaster
 * @subpackage BookingCheckout
 * @since 1.0.0
 */

/* CSS Variables - Consistent with BookingCheckout */
:root {
    /* Summary-specific colors */
    --summary-bg-primary: var(--event-surface-primary-color, #141416);
    --summary-bg-secondary: var(--event-surface-secondary-color, #1a1a1c);
    --summary-bg-tertiary: var(--event-surface-tertiary-color, #242428);

    /* Text colors */
    --summary-text-primary: var(--event-text-primary-color, #ffffff);
    --summary-text-secondary: var(--event-text-secondary-color, #a3a3a3);
    --summary-text-muted: var(--event-mid-foreground-color, #8B92A8);  /* Improved from #777E90 for better WCAG AA contrast */
    --summary-text-accent: var(--event-accent-color, var(--event-secondary-color, #4FF6B1));
    /* Surfaces derived from Visual Settings accent (replaces hardcoded mint rgba) */
    --summary-accent-surface: var(--event-accent-color, var(--event-secondary-color, #4FF6B1));
    --summary-accent-tint-04: color-mix(in srgb, var(--summary-accent-surface) 4%, transparent);
    --summary-accent-tint-05: color-mix(in srgb, var(--summary-accent-surface) 5%, transparent);
    --summary-accent-tint-08: color-mix(in srgb, var(--summary-accent-surface) 8%, transparent);
    --summary-accent-border-20: color-mix(in srgb, var(--summary-accent-surface) 20%, transparent);
    --summary-accent-border-30: color-mix(in srgb, var(--summary-accent-surface) 30%, transparent);
    --summary-accent-faint: color-mix(in srgb, var(--summary-accent-surface) 30%, transparent);
    
    /* Border and spacing */
    --summary-border: var(--event-surface-border-color, #777E90);
    --summary-border-light: var(--event-hairline-color, #CBCDD3);
    --summary-border-radius: 12px;
    --summary-spacing-xs: 8px;
    --summary-spacing-sm: 12px;
    --summary-spacing-md: 16px;
    --summary-spacing-lg: 24px;
    /* Shared title/row/totals left edge (16px — matches compact, mobile, and item rows). */
    --summary-inset: var(--summary-spacing-md);
    
    /* Typography */
    --summary-font-family: var(--event-font-family, "DM Sans"), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --summary-font-size-xxs: 10px;          /* Tiny labels, badges */
    --summary-font-size-xs: 11px;           /* Small details, descriptions */
    --summary-font-size-sm: 12px;           /* Secondary info, dates */
    --summary-font-size-md: 13px;           /* Content text */
    --summary-font-size-base: 14px;         /* Default text */
    --summary-font-size-15: 15px;           /* Item names, amounts */
    --summary-font-size-lg: 16px;           /* Section headers */
    --summary-font-size-17: 17px;           /* Prices */
    --summary-font-size-xl: 18px;           /* Large headers */
    --summary-font-size-20: 20px;           /* Grand total */
    
    /* Layout dimensions */
    --summary-amount-width: 70px;           /* Width of amount column in pricing */
    --summary-price-width: 85px;            /* Width of price in summary items */
    --summary-expand-btn-size: 20px;        /* Size of expand/collapse button */
    --summary-expand-btn-offset: 26px;      /* Button position offset (20px + 6px gap) */
    --summary-expand-btn-padding: 46px;     /* Right padding to accommodate button (26px + 20px) */
}

/* Component Container */
.booking-summary-wrapper {
    font-family: var(--summary-font-family);
    color: var(--summary-text-primary);
    background: var(--event-surface-secondary-color, var(--summary-bg-secondary));
    border: 1px solid var(--event-hairline-color, #CBCDD3); /* BS-5865 round 6 (row 30): every checkout card shares the hairline outline */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
    box-sizing: border-box;
}

/* BS-5639/LA28: the legacy `.gdlr-booking-contact-form .booking-summary span` rule in
   crewfare-hotel-addon-gdlr/gdlr-hotel_renamed.css is (0,2,1) — a class selector ending in
   the `span` type beats our old `.booking-summary-wrapper .booking-summary *` guard, which
   was only (0,2,0) because the universal selector contributes no specificity. Match its own
   shape (including the `.gdlr-booking-contact-form` ancestor) with one more class to win. */
.gdlr-booking-contact-form .booking-summary-wrapper .booking-summary span,
.booking-summary-wrapper .booking-summary span {
    font-style: normal;
    display: revert;
    margin-bottom: 0;
}

/* BS-5865: that span revert is (0,3,1) / (0,2,1), so it also beat `.total-line__label { display: flex }`
   below and the row went back to inline flow — the Taxes and Fees chevron dropped under its label and
   the room-count chevron sat below its text (Jordan, 21 Sep, On Location dark event). The label keeps
   its flex layout with one more class than the revert. */
.gdlr-booking-contact-form .booking-summary-wrapper .booking-summary .total-line__label,
.booking-summary-wrapper .booking-summary .total-line__label {
    display: flex;
}

/* The universal branch only clears the italic — a `display: revert` here is (0,2,0) and beat every
   single-class `display: flex` in the templates (label/value rows, the Room Details toggle) and the
   desktop `display: none` on the header chevron, flattening the card into inline text. */
.booking-summary-wrapper .booking-summary * {
    font-style: normal;
}

.booking-summary-wrapper *,
.booking-summary-wrapper *::before,
.booking-summary-wrapper *::after {
    box-sizing: border-box;
}

.booking-summary {
    display: flex;
    flex-direction: column;
}

/* Header */
.booking-summary__header {
    padding: var(--summary-inset);
    border-bottom: 1px solid var(--summary-border-light);
    background: transparent;
}

/* BS-5866: mobile-only collapse indicator on the header. Hidden by default;
   shown (and made tappable) at the ≤991px breakpoint below. Uses the text-primary
   token, not the accent color — this is a neutral disclosure affordance, not a CTA. */
.booking-summary__header-chevron {
    display: none;
    color: var(--summary-text-primary);
}

.booking-summary__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--summary-text-primary);
    margin: 0 0 8px 0;
}

.booking-summary__subtitle {
    font-size: var(--summary-font-size-sm);
    color: var(--summary-text-secondary);
    margin: 0 0 10px 0;
}

.cart-hold-timer {
    width: 100%;
    margin-top: 18px;
    margin-bottom: 10px;
    padding: 0 var(--summary-inset);
    box-sizing: border-box;
}

.cart-hold-timer__active {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--summary-spacing-md);
    padding: 12px var(--summary-spacing-md);
    border: 2px solid var(--summary-text-accent);
    border-radius: 8px;
    background: var(--summary-bg-secondary);
}

.cart-hold-timer__left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.cart-hold-timer__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--summary-text-primary);
}

.cart-hold-timer__text {
    font-size: var(--summary-font-size-sm);
    color: var(--summary-text-primary);
}

.cart-hold-timer__time {
    font-size: var(--summary-font-size-xl);
    font-weight: 600;
    color: var(--summary-text-primary);
    min-width: 50px;
    text-align: right;
}

.cart-hold-timer__expired {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--summary-spacing-sm);
    padding: var(--summary-spacing-md);
    border: 2px solid var(--summary-border);
    border-radius: 8px;
    background: var(--summary-bg-tertiary);
}

.cart-hold-timer__expired.hidden,
.cart-hold-timer__expired[hidden] {
    display: none;
}

.cart-hold-timer__active.cart-hold-timer__active--hidden {
    display: none;
}

.cart-hold-timer__expired-message {
    margin: 0;
    font-size: var(--summary-font-size-sm);
    color: var(--summary-text-primary);
    line-height: 1.4;
}

.cart-hold-timer__reselect-btn {
    display: inline-block;
    padding: 10px 16px;
    font-size: var(--summary-font-size-base);
    font-weight: 600;
    color: var(--summary-bg-primary);
    background: var(--summary-text-accent);
    border: none;
    border-radius: var(--event-button-radius, 8px);
    text-decoration: none;
    cursor: pointer;
}

.cart-hold-timer__reselect-btn:hover {
    opacity: 0.9;
}

/* Items List */
.booking-summary__items {
    display: flex;
    flex-direction: column;
}

/* REMOVED: Legacy .summary-item styles (HTML uses .summary-item-compact instead) */

/* Vertical padding only — rows (including grand total) own --summary-inset so
   title, Hotel/Subtotal, and Total Due text share one left edge. */
.booking-summary__totals {
    padding: var(--summary-spacing-lg) 0;
    background: transparent;
    border-top: none;
}

.totals-list {
    display: flex;
    flex-direction: column;
    gap: var(--summary-spacing-sm);
}

/* REMOVED: Duplicate .total-line styles - see comprehensive version in LAYOUT FIXES section below */

/* Compact Mode */
.booking-summary-wrapper.compact-mode {
    font-size: var(--summary-font-size-sm);
}

.compact-mode .booking-summary__totals {
    padding: var(--summary-spacing-md) 0;
}

/* REMOVED: Legacy .summary-item loading states (not used) */

/* Error States */
.booking-summary-error {
    display: flex;
    align-items: center;
    gap: var(--summary-spacing-md);
    padding: var(--summary-spacing-lg);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--summary-remove-color);
    border-radius: var(--summary-border-radius);
    color: var(--summary-remove-color);
}

.booking-summary-error .error-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.booking-summary-error .error-message h4 {
    margin: 0 0 var(--summary-spacing-xs) 0;
    font-size: var(--summary-font-size-lg);
}

.booking-summary-error .error-message p {
    margin: 0;
    font-size: var(--summary-font-size-sm);
    opacity: 0.8;
}

/* Success States */
.summary-item--updated {
    background: rgba(16, 185, 129, 0.1);
        border-color: var(--summary-success-color);
}

/* REMOVED: Legacy responsive styles for .summary-item - see consolidated section at end of file */

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --summary-border: #ffffff;
        --summary-text-secondary: #cccccc;
        --summary-bg-secondary: #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   TOOLTIPS & INTERACTIONS
   ============================================ */

/* Tooltips for Pricing Items */
.total-line__label {
    position: relative;
    cursor: pointer;
}

.total-line__label[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: rgba(20, 20, 22, 0.95);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: var(--summary-font-size-sm);
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid var(--summary-accent-border-30);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
}

.total-line__label[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-top-color: rgba(20, 20, 22, 0.95);
    margin-bottom: 2px;
}

/* Progress Indicator - REMOVED: Unnecessary visual flourish */

/* Loading Overlay - REMOVED: Class never applied in JS, dead code */

/* Empty State Styling */
.booking-summary-empty {
    padding: 40px 20px;
    text-align: center;
}

.booking-summary-empty i {
    font-size: 48px;
    color: var(--summary-accent-faint);
    margin-bottom: 16px;
    display: block;
}

.booking-summary-empty h4 {
    font-size: var(--summary-font-size-xl);
    color: var(--summary-text-primary);
    margin: 0 0 8px 0;
}

.booking-summary-empty p {
    font-size: var(--summary-font-size-base);
    color: var(--summary-text-secondary);
    margin: 0;
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus within container */
.booking-summary-wrapper:focus-within {
    outline: 2px solid var(--summary-text-accent);
    outline-offset: 2px;
}

/* Screen reader only text */
.booking-summary__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to content link */
.booking-summary__skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 8px 16px;
    background: var(--summary-text-accent);
    color: #000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
}

.booking-summary__skip-link:focus {
    left: 10px;
    top: 10px;
}

/* Keyboard navigation hint */
.booking-summary-wrapper[data-keyboard-nav="true"] *:focus {
    outline: 2px solid var(--summary-text-accent);
    outline-offset: 2px;
}

/* Custom Fields Display Rows (BEM: summary-section__*) */
.summary-section__row {
    position: relative;
}

.summary-section__value {
    position: relative;
    padding-left: 8px;
}

.summary-section__row:focus-within {
    background: var(--summary-accent-tint-05);
    border-radius: 4px;
    margin: 0 -8px;
    padding: 10px 8px;
}

/* Placeholder States (BEM: summary-section--*) */
.summary-section--placeholder {
    position: relative;
}

/* Dark Mode Enhancements */
/* BS-5830: OS dark scheme only reinforces an event that is already in dark colour mode; it must never override a light-mode event. */
@media (prefers-color-scheme: dark) {
    body.event-color-mode-dark .booking-summary-wrapper {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    
    body.event-color-mode-dark .summary-item-compact {
        background: rgba(15, 15, 17, 0.95);
    }
}

/* ============================================
   COMPONENT LAYOUT & STYLING
   ============================================ */

/* Summary Item Cards */
.summary-item-compact {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: var(--summary-inset);
    border-bottom: 1px solid var(--summary-border-light);
    min-height: 80px;
    flex-wrap: nowrap;
    background: var(--summary-bg-primary);
}

.summary-item-compact:last-child {
    border-bottom: none;
}

.summary-item-compact__content {
    flex: 1 1 auto;
    min-width: 0; /* Critical for text overflow */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-item-compact__name {
    font-size: var(--summary-font-size-15);
    font-weight: 600;
    color: var(--summary-text-primary);
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
    max-width: 100%;
}

.summary-item-compact__details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-item-compact__description {
    font-size: var(--summary-font-size-md);
    color: var(--summary-text-secondary);
    line-height: 1.2;
}

.summary-item-compact__dates,
.summary-item-compact__guests,
.summary-item-compact__policy {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: var(--summary-font-size-sm);
    color: var(--summary-text-secondary);
}

.summary-item-compact__policy--muted {
    opacity: 0.7;
}

.summary-item-compact__dates i,
.summary-item-compact__guests i,
.summary-item-compact__policy i {
    flex-shrink: 0;
    margin-top: 2px;
}

.summary-item-compact__price {
    flex: 0 0 auto;
    font-size: var(--summary-font-size-17);
    font-weight: 700;
    color: var(--summary-text-primary);
    text-align: right;
    white-space: nowrap;
    align-self: flex-start;
    padding-top: 2px;
    min-width: var(--summary-price-width);
    flex-shrink: 0;
}

/* Extra custom field responses: same spacing as room details (inside __details, gap 6px) */
.summary-item-compact__extra-responses {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--summary-font-size-sm);
    color: var(--summary-text-secondary);
    line-height: 1.35;
}

.summary-item-compact__extra-response {
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.summary-item-compact__extra-response strong.summary-item-compact__extra-response-label {
    font-weight: 600;
    color: var(--summary-text-primary);
}

.summary-item-compact__extra-response-value {
    white-space: normal;
}

/* Pricing Total Lines */
.total-line {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px var(--summary-inset);
    border-bottom: 1px solid var(--event-hairline-color, #CBCDD3);
    font-size: var(--summary-font-size-sm);
    flex-wrap: nowrap;
    min-height: 42px;
    position: relative;
}

.total-line__label {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - var(--summary-amount-width) - 30px);
    color: var(--summary-text-primary, #ffffff);
    font-weight: 400;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    overflow: visible;
    line-height: 1.5;
}

.total-line__expand-btn-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

/* The room count and its chevron share one baseline; BookingCheckout.css's block + 2px top
   margin on .summary-detail is for the stacked description under a label, not this row. */
.total-line__expand-btn-wrapper .summary-detail {
    display: inline;
    margin-top: 0;
}

.total-line--collapsible .total-line__label {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    max-width: calc(100% - var(--summary-amount-width) - 30px);
    overflow: visible;
}

.total-line__amount {
    flex: 0 0 auto;
    font-weight: 600;
    color: var(--summary-text-primary, #ffffff);
    font-size: var(--summary-font-size-15);
    text-align: right;
    white-space: nowrap;
    min-width: var(--summary-amount-width);
    flex-shrink: 0;
}

/* Fix amount wrapper alignment */
.total-line__amount-wrapper {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    width: var(--summary-amount-width);
    overflow: visible;
}

.total-line__amount-wrapper .total-line__amount {
    width: var(--summary-amount-width);
    flex-shrink: 0;
    text-align: right;
    position: relative;
    z-index: 1;
}

/* Expand/Collapse Button (BEM: total-line__expand-btn) 
   Note: HTML should include:
   - aria-label="Expand/Collapse tax details" for screen readers
   - aria-expanded="false/true" for state
*/
.total-line__expand-btn {
    position: absolute;
    right: calc(-1 * var(--summary-expand-btn-offset));
    top: 0;
    bottom: 0;
    margin: auto 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--summary-expand-btn-size);
    height: var(--summary-expand-btn-size);
    background: none;
    border: none;
    color: color-mix(in srgb, var(--summary-text-primary, #ffffff) 60%, transparent);
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
    z-index: 2;
}

.total-line__expand-btn:hover {
    color: color-mix(in srgb, var(--summary-text-primary, #ffffff) 90%, transparent);
    background: rgba(255, 255, 255, 0.1);
}

.total-line__expand-btn:focus {
    outline: 2px solid var(--summary-text-accent);
    outline-offset: 2px;
    color: color-mix(in srgb, var(--summary-text-primary, #ffffff) 90%, transparent);
}

.total-line__expand-btn:focus:not(:focus-visible) {
    outline: none;
}

.total-line__expand-btn svg {
    display: block;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

/* Collapsible total lines (e.g., taxes breakdown) 
   Note: HTML should include:
   - tabindex="0" for keyboard navigation
   - role="button" for screen readers
   - aria-expanded="false/true" for state
   - aria-controls="id-of-content" for relationship
*/
.total-line--collapsible {
    cursor: pointer;
    position: relative;
    padding-left: var(--summary-inset);
    padding-right: var(--summary-expand-btn-padding);
}

.total-line--collapsible:hover {
    background-color: color-mix(in srgb, var(--summary-text-primary, #ffffff) 3%, transparent);
}

.total-line--collapsible:focus {
    outline: 2px solid var(--summary-text-accent);
    outline-offset: -2px;
    background-color: var(--summary-accent-tint-05);
}

.total-line--collapsible:focus:not(:focus-visible) {
    outline: none;
    background-color: transparent;
}

/* CSS owns the chevron rotation; JS only flips aria-expanded on the button. */
.expand-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Taxes & Fees Section (BEM: booking-summary__taxes-fees) */
.booking-summary__taxes-fees {
    position: relative;
}

/* Total Line Detail Text (BEM: total-line__*) */
.total-line__detail,
.total-line__description {
    display: block;
    font-size: var(--summary-font-size-xs);
    color: color-mix(in srgb, var(--summary-text-primary, #ffffff) 50%, transparent);
    font-weight: normal;
    margin-top: 4px;
    line-height: 1.4;
}

.total-line__tax-count {
    display: inline-block;
    font-size: var(--summary-font-size-xxs);
    color: color-mix(in srgb, var(--summary-text-primary, #ffffff) 60%, transparent);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

.booking-summary__totals .total-line {
    padding-left: var(--summary-inset);
    padding-right: var(--summary-inset);
}

.booking-summary__totals .total-line--collapsible {
    padding-right: var(--summary-expand-btn-padding);
}

.booking-summary__totals .total-line--collapsible:hover {
    padding-left: var(--summary-inset);
    padding-right: var(--summary-expand-btn-padding);
    margin: 0;
}

/* Grand Total Styling */
.total-line--grand {
    margin: 0 var(--summary-inset);
    padding: 8px !important;
    min-height: 38px;
    border-bottom: none !important;
    font-weight: 700;
    font-size: var(--summary-font-size-sm);
    overflow: visible !important;
    background: var(--event-total-highlight-color, #AEE5EE);
    border-radius: 8px;
}

.total-line--grand .total-line__label {
    color: var(--summary-text-primary, #ffffff);
    font-weight: 500;
    font-size: var(--summary-font-size-sm);
}

.total-line--grand .total-line__amount {
    color: var(--summary-text-primary, #ffffff);
    font-size: var(--summary-font-size-base);
    font-weight: 500;
    min-width: var(--summary-amount-width);
    flex-shrink: 0;
}

/* Nights Count Badge (BEM: summary-item__nights) */
.summary-item__nights {
    color: var(--summary-text-accent);
    font-weight: 500;
    white-space: nowrap;
}

/* Detailed Breakdown Section (BEM: booking-summary__totals--detailed) */
.booking-summary__totals--detailed {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.booking-summary__totals--detailed h4 {
    margin: 0 0 15px 0;
    font-size: var(--summary-font-size-lg);
    color: var(--summary-text-primary, #ffffff);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

/* Section Headers with Visual Enhancement */
.summary-section-header {
    padding: var(--summary-inset) var(--summary-inset) 12px var(--summary-inset);
    background: var(--summary-accent-tint-04);
    border-bottom: 2px solid var(--summary-accent-border-20);
}

.summary-section-title {
    position: relative;
}

/* Decorative accent line - REMOVED: Unnecessary visual decoration */

.summary-section-content {
    padding: 0 var(--summary-inset) var(--summary-inset) var(--summary-inset);
}

/* Team Manager Reassurance Text */
.booking-summary .team-manager-reassurance {
    padding: 12px var(--summary-inset);
    margin-top: 8px;
    background: var(--summary-accent-tint-08);
    border: 1px solid var(--summary-accent-border-30);
    border-radius: 6px;
    text-align: center;
}

.booking-summary .team-manager-reassurance small {
    font-size: 12px;
    line-height: 1.4;
    color: var(--summary-text-accent);
    font-weight: 500;
}

/* BS-5866: "Room Details" / "Extra details" caret rows had no layout rules at all,
   so the tappable area was just the browser-default inline button box around the
   text — well under the 44px touch target, which is why taps on mobile appeared to
   do nothing. Give the whole row a real hit area and align label/count/chevron. */
.booking-summary__section-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px var(--summary-inset);
    gap: 8px;
    background: none;
    border: none;
    text-align: left;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
}

.booking-summary__section-toggle-label {
    font-size: var(--summary-font-size-md);
    font-weight: 600;
}

.booking-summary__section-toggle-count {
    font-size: var(--summary-font-size-xs);
    color: var(--summary-text-secondary);
}

.booking-summary__section-toggle .booking-summary__section-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
/* Note: Sidebar styles moved to BookingCheckout.css where they belong */

/* Breakpoint: Tablet & Below (≤991px) */
@media (max-width: 991px) {
    .booking-summary-wrapper {
        position: sticky;
        bottom: 0;
        z-index: 100;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }
    
    /* Collapsible Summary on Tablet/Mobile */
    .booking-summary-wrapper.mobile-collapsed .booking-summary__items,
    .booking-summary-wrapper.mobile-collapsed .booking-summary__custom-fields {
        display: none;
    }
    
    .booking-summary__header {
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
        position: relative;
        min-height: 44px;
    }

    /* BS-5866: was a CSS-generated '▼' colored with the accent token (rendered pink
       on this event's palette and read as a stray list-marker triangle, not a
       control). A real chevron icon on the text-primary token instead. */
    .booking-summary__header-chevron {
        display: block;
        position: absolute;
        right: var(--summary-inset);
        top: 0;
        bottom: 0;
        margin: auto 0;
        height: fit-content;
        color: var(--summary-text-primary);
        font-size: var(--summary-font-size-sm);
        transition: transform 0.3s ease;
        /* BS-5866: down when collapsed (tap to expand), up when expanded */
        transform: rotate(180deg);
    }

    .booking-summary-wrapper.mobile-collapsed .booking-summary__header-chevron {
        transform: none;
    }
    
    .booking-summary__totals {
        max-height: none !important;
    }
}

/* Breakpoint: Mobile (≤768px) */
@media (max-width: 768px) {
    /* BS-5639/LA28: the sidebar keeps its 380px checkout width even after it reflows above
       the form (BookingCheckout.css __sidebar order:-1), which clips this card past a 390px
       viewport. Let it shrink and keep long labels from forcing the clip back open. */
    .booking-summary-wrapper {
        max-width: 100%;
        box-sizing: border-box;
    }

    .total-line,
    .summary-item-compact {
        min-width: 0;
    }

    .total-line__label,
    .summary-item-compact__description {
        overflow-wrap: break-word;
    }

    /* Summary Items */
    .summary-item-compact {
        flex-direction: column;
        gap: 12px;
    }
    
    .summary-item-compact__price {
        align-self: flex-end;
        font-size: var(--summary-font-size-20);
    }
    
    .summary-item-compact__name {
        font-size: var(--summary-font-size-15);
    }
    
    /* Pricing Lines */
    .total-line {
        flex-wrap: nowrap;
        gap: 12px;
        font-size: var(--summary-font-size-md);
    }
    
    .total-line__label {
        font-size: var(--summary-font-size-md);
    }
    
    .total-line__amount {
        font-size: var(--summary-font-size-base);
    }
    
    .total-line--grand {
        margin: 12px var(--summary-inset) 0 var(--summary-inset);
        padding: 8px !important;
        font-size: var(--summary-font-size-sm);
    }

    .total-line--grand .total-line__amount {
        font-size: var(--summary-font-size-base);
    }
    
    /* Custom Fields Section */
    .summary-section-content {
        font-size: var(--summary-font-size-md);
    }
    
    .summary-section__label {
        font-size: var(--summary-font-size-sm);
        min-width: 100px;
    }
    
    .summary-section__value {
        font-size: var(--summary-font-size-md);
    }
}

/* Breakpoint: Small Mobile (≤480px) */
@media (max-width: 480px) {
    .booking-summary__header {
        padding: var(--summary-inset);
    }
    
    .booking-summary__totals {
        padding: var(--summary-spacing-md) 0;
    }
}

.csb-popup {
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.43) !important;
    top: 0 !important;
    left: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    z-index: 999999 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.csb-popup .cbs-popup-container.cbs-confirm-popup {
    background: var(--summary-bg-secondary, #1a1a1c);
    max-width: 420px;
    min-height: auto;
    padding: var(--summary-spacing-lg, 24px);
    border-radius: var(--summary-border-radius, 12px);
    color: var(--summary-text-primary, #fff);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.csb-popup .cbs-confirm-popup-message {
    font-size: var(--summary-font-size-base, 14px);
    line-height: 1.5;
    margin-bottom: var(--summary-spacing-md, 16px);
    text-align: center;
    width: 100%;
}

.csb-popup .cbs-confirm-popup-message .cbs-confirm-popup-title {
    text-align: center;
    font-family: var(--event-font-family, "DM Sans"), sans-serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--summary-text-primary, #fff);
    margin: 0 0 16px 0;
}

.csb-popup .cbs-confirm-popup-message .cbs-confirm-popup-body {
    margin: 0;
    line-height: 1.5;
}

.csb-popup .cbs-confirm-popup-actions {
    margin-top: var(--summary-spacing-md, 16px);
    display: flex;
    justify-content: center;
}

.csb-popup .cbs-button.cbs-confirm-popup-proceed {
    display: inline-block;
    color: var(--event-on-secondary-color, #ffffff);
    border: 2px solid var(--summary-text-accent, var(--event-secondary-color, #4FF6B1));
    background: var(--summary-text-accent, var(--event-secondary-color, #4FF6B1));
    color: #141416;
    padding: 10px 24px;
    border-radius: var(--event-button-radius, 8px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.csb-popup .cbs-button.cbs-confirm-popup-proceed:hover {
    opacity: 0.9;
    color: #fff;
}

/* =====================================================================================
   Figma parity — Reservation Summary card (LA28 handoff, node 712:90221), 16 Sep 2026.
   Both summary templates carry duplicated inline <style> blocks at (0,1,0) and the legacy
   `.gdlr-booking-contact-form .booking-summary span` rule is (0,2,1), so these live here
   once at (0,2,x)/(0,3,1) instead of being patched into each template.
   ===================================================================================== */
.booking-summary-wrapper .booking-summary__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.booking-summary-wrapper .booking-summary__subtitle {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--summary-text-primary);
    margin: 0;
}

.booking-summary-wrapper .booking-summary .booking-summary__label-value {
    padding: 0 var(--summary-inset);
    border-bottom: 0;
}

.booking-summary-wrapper .booking-summary .booking-summary__label-value:first-child {
    padding-top: var(--summary-inset);
}

.booking-summary-wrapper .booking-summary .booking-summary__label-value:has(+ .booking-summary__section-toggle) {
    padding-bottom: var(--summary-inset);
}

.booking-summary-wrapper .booking-summary .booking-summary__label-value-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    line-height: 1.5;
}

.booking-summary-wrapper .booking-summary span.booking-summary__label-value-label {
    display: inline;
    font-size: 12px;
    font-weight: 500;
    color: var(--summary-text-secondary);
}

.booking-summary-wrapper .booking-summary span.booking-summary__label-value-value {
    display: inline;
    flex: 1;
    font-size: 12px;
    font-weight: 400;
    color: var(--summary-text-primary);
    text-align: right;
}

.booking-summary-wrapper .booking-summary .booking-summary__items-section {
    border-bottom: 0;
}

.booking-summary-wrapper .booking-summary .booking-summary__section-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px var(--summary-inset);
    border-top: 1px solid var(--event-hairline-color, #CBCDD3);
    border-bottom: 1px solid var(--event-hairline-color, #CBCDD3);
}

.booking-summary-wrapper .booking-summary span.booking-summary__section-toggle-label {
    display: inline;
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: var(--summary-text-primary);
}

.booking-summary-wrapper .booking-summary span.booking-summary__section-toggle-count {
    display: inline;
    font-size: 11px;
    font-weight: 400;
    color: var(--summary-text-secondary);
}

.booking-summary-wrapper .booking-summary__totals {
    padding: var(--summary-inset) var(--summary-inset) 24px;
    border-top: 2px solid var(--event-hairline-color, #CBCDD3);
}

.booking-summary-wrapper .booking-summary .total-line {
    padding: 8px 0;
    min-height: 0;
    border-bottom: 1px solid var(--event-hairline-color, #CBCDD3);
    font-size: 12px;
}

.booking-summary-wrapper .booking-summary .total-line__label,
.booking-summary-wrapper .booking-summary span.total-line__label {
    font-size: 12px;
    font-weight: 400;
    color: var(--summary-text-primary);
}

.booking-summary-wrapper .booking-summary .total-line__amount,
.booking-summary-wrapper .booking-summary span.total-line__amount {
    font-size: 12px;
    font-weight: 500;
    color: var(--summary-text-primary);
}

.booking-summary-wrapper .booking-summary .summary-detail {
    font-size: 11px;
    line-height: 1.4;
    color: var(--summary-text-secondary);
}

.booking-summary-wrapper .booking-summary .total-line--grand {
    margin: 8px 0 0 0;
    padding: 8px !important;
    border-radius: 8px !important;
    border-bottom: none !important;
    background: var(--event-total-highlight-color, #AEE5EE);
}

.booking-summary-wrapper .booking-summary .total-line--grand .total-line__label,
.booking-summary-wrapper .booking-summary .total-line--grand span.total-line__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--summary-text-primary);
}

.booking-summary-wrapper .booking-summary .total-line--grand .total-line__amount,
.booking-summary-wrapper .booking-summary .total-line--grand span.total-line__amount {
    font-size: 14px;
    font-weight: 500;
    color: var(--summary-text-primary);
}

.booking-summary-wrapper .booking-summary .disclaimer-text {
    display: block;
    margin: 8px 0 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--summary-text-secondary);
    text-align: center;
}

/* ============================================
   BS-5865 round 9b (Lola, 28 Sep - Figma 39316:70022): "Condensed" checkout layout, opt-in via
   Appearance -> Checkout Layout (body.checkout-layout-condensed, hotelmaster functions.php).
   The Reservation Summary shows each room once: the Room Type and Rate rows and the per-room
   Room Charges breakdown go, and the Room Details toggle carries the room-type summary instead.
   The standard layout is untouched - nothing below applies without the body class.
   ============================================ */
.booking-summary .checkout-condensed-only {
    display: none;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__label-value-row--room-type,
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__label-value-row--rate,
body.checkout-layout-condensed .booking-summary .total-line__expand-btn-wrapper .expand-btn,
body.checkout-layout-condensed .booking-summary .total-line__wrapper--rooms {
    display: none;
}
body.checkout-layout-condensed .booking-summary .booking-summary__section-toggle-types {
    display: inline;
    font-size: var(--summary-font-size-xs);
    color: var(--summary-text-secondary);
}

/* ============================================
   BS-5865 round 9d (Figma LA28-Ecomm 39316:70022 read through the Crewfare copy, 28 Sep): pixel
   pass on the condensed Reservation Summary. Card inset 24 with no hairline under the title, the
   item count as a chip, 12px label / value rows on an 8px rhythm, the Room Details row in the
   same voice with the expanded rooms on a primary-surface panel, one hairline above the totals,
   the Total Due band at 16px, the taxes note at 11px.
   Still scoped to body.checkout-layout-condensed - the standard layout is untouched.
   ============================================ */
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary {
    --summary-inset: 24px;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__header {
    padding: 24px 24px 0;
    border-bottom: none;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__title {
    margin: 0;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__subtitle {
    display: inline-block;
    margin: 4px 0 0;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--event-surface-tertiary-color, #EAEAEC);
    font-size: 12px;
    line-height: 1.5;
    color: var(--summary-text-secondary);
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__label-value,
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__label-value:first-child,
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__label-value:has(+ .booking-summary__section-toggle) {
    padding: 16px 24px 0;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary span.booking-summary__label-value-label {
    font-weight: 400;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary span.booking-summary__label-value-value {
    font-weight: 500;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__section-toggle {
    min-height: 0;
    margin: 0;
    padding: 4px 24px;
    border: none;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary span.booking-summary__section-toggle-label {
    font-weight: 400;
    color: var(--summary-text-secondary);
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary span.booking-summary__section-toggle-count,
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__section-toggle-types {
    font-size: 12px;
    font-weight: 500;
    color: var(--summary-text-primary);
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__section-toggle .booking-summary__section-chevron {
    color: var(--summary-text-primary);
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__section-content {
    margin: 8px 24px 0;
    padding: 0 12px;
    border-radius: 4px;
    background: var(--checkout-section-bg, #0D0D0F);
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .summary-item-compact {
    min-height: 0;
    padding: 12px 0;
    gap: 8px;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .summary-item-compact:last-child {
    border-bottom: none;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .summary-item-compact__content,
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .summary-item-compact__details {
    gap: 4px;
    font-size: 12px;
    line-height: 1.5;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .summary-item-compact__price,
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .summary-item-compact__price-amount {
    padding-top: 0;
    font-size: 12px;
    font-weight: 500;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary__totals {
    margin: 16px 24px 0;
    padding: 16px 0 24px;
    border-top: 1px solid var(--event-hairline-color, #CBCDD3);
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .total-line {
    padding: 4px 0;
    border-bottom: none;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .total-line__label,
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary span.total-line__label {
    color: var(--summary-text-secondary);
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .total-line__detail {
    display: none;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .total-line--grand {
    margin: 16px 0 0;
    padding: 12px 16px !important;
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .total-line--grand .total-line__label,
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .total-line--grand span.total-line__label,
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .total-line--grand .total-line__amount,
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .total-line--grand span.total-line__amount {
    font-size: 16px;
    font-weight: 500;
    color: var(--summary-text-primary);
}
body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .disclaimer-text {
    margin: 16px 0 0;
    font-size: 11px;
    line-height: 1.4;
}
@media (max-width: 768px) {
    body.checkout-layout-condensed .booking-summary-wrapper .booking-summary {
        --summary-inset: 16px;
    }
    body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__header {
        padding: 16px 16px 0;
    }
    body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__label-value,
    body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__label-value:first-child,
    body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__label-value:has(+ .booking-summary__section-toggle) {
        padding: 16px 16px 0;
    }
    body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__section-toggle {
        padding: 4px 16px;
    }
    body.checkout-layout-condensed .booking-summary-wrapper .booking-summary .booking-summary__section-content {
        margin: 8px 16px 0;
    }
    body.checkout-layout-condensed .booking-summary-wrapper .booking-summary__totals {
        margin: 16px 16px 0;
        padding: 16px 0;
    }
}
