/* Stuffworks Booking UX Enhancements (Split Summary, Mode Filter, Positive ZIP Badge, Inline Service Meta) */

.swb-booking-wrap.swb-ux-enhanced {
    max-width: 1120px;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.swb-ux-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
    gap: 24px;
    align-items: start;
}

.swb-ux-main {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    min-width: 0;
}

/* Inline Time & Price Pill Beside Service Name */
.swb-ux-enhanced .swb-service-choice-card .swb-svc-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 10px;
    min-width: 0;
}

.swb-svc-title-text {
    font-weight: 700;
    color: #0f172a;
}

.swb-svc-inline-meta {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.swb-service-choice-card.is-selected .swb-svc-inline-meta {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

/* Support Type Filter Pills (In-Home vs. Remote) */
.swb-mode-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.swb-mode-filter-label {
    font-weight: 700;
    font-size: 0.88rem;
    color: #334155;
    margin-right: 4px;
}

.swb-mode-pill {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.swb-mode-pill:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.swb-mode-pill.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* Positive ZIP Confirmation Badge */
.swb-zip-success-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 14px;
    padding: 9px 12px;
    border-radius: 6px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    font-size: 0.88rem;
    font-weight: 600;
}

.swb-zip-success-badge[hidden] {
    display: none !important;
}

.swb-zip-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Sticky Desktop Summary Sidebar */
.swb-ux-sidebar {
    position: sticky;
    top: 24px;
}

.swb-summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.swb-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 14px;
}

.swb-summary-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.swb-summary-mode-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    white-space: nowrap;
}

.swb-summary-section-lbl {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 8px;
}

.swb-summary-items {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: #1e293b;
}

.swb-summary-items li {
    padding-left: 14px;
    position: relative;
    line-height: 1.4;
}

.swb-summary-items li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: #2563eb;
    font-weight: 700;
}

.swb-summary-items li.is-empty {
    padding-left: 0;
    color: #64748b;
    font-style: italic;
}

.swb-summary-items li.is-empty::before {
    content: none;
}

.swb-summary-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
}

.swb-summary-metric strong {
    display: block;
    font-size: 1rem;
    color: #0f172a;
}

.swb-summary-note {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #64748b;
    margin: 0 0 14px;
}

.swb-summary-help {
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #475569;
}

.swb-summary-help a {
    display: inline-block;
    margin-top: 2px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.swb-summary-help a:hover {
    text-decoration: underline;
}

/* Mobile Sticky Summary Bar & Backdrop */
.swb-mobile-summary-bar,
.swb-mobile-summary-backdrop {
    display: none;
}

@media (max-width: 991px) {
    .swb-ux-layout {
        grid-template-columns: 1fr;
        padding-bottom: 58px;
    }

    .swb-ux-main {
        padding: 20px 16px;
    }

    .swb-mobile-summary-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 99988;
        background: rgba(15, 23, 42, 0.45);
    }

    .swb-ux-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(102px + env(safe-area-inset-bottom, 0px));
        top: auto;
        z-index: 99995;
        padding: 0 12px;
        display: none;
    }

    .swb-ux-sidebar.is-mobile-open {
        display: block;
    }

    .swb-ux-sidebar .swb-summary-card {
        max-height: calc(100dvh - 185px - env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.22);
    }

    /* Sits cleanly right above stuffworks-theme's slim 48px bottom Call/Book bar */
    .swb-mobile-summary-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(48px + env(safe-area-inset-bottom, 0px));
        z-index: 99990;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 7px 14px;
        background: #1e293b;
        border-top: 1px solid #334155;
        color: #ffffff;
        box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.16);
    }

    .swb-mobile-bar-price {
        display: block;
        font-weight: 700;
        font-size: 0.9rem;
        line-height: 1.2;
    }

    .swb-mobile-bar-time {
        display: block;
        font-size: 0.75rem;
        color: #cbd5e1;
        line-height: 1.2;
    }

    .swb-mobile-bar-btn {
        background: #2563eb;
        color: #ffffff;
        border: 0;
        border-radius: 999px !important;
        padding: 7px 14px;
        font-weight: 700;
        font-size: 0.8rem;
        white-space: nowrap;
        cursor: pointer;
    }
}

/* Landscape / Short Mobile Viewport Clearance */
@media (max-width: 991px) and (orientation: landscape), (max-width: 991px) and (max-height: 520px) {
    .swb-mobile-summary-bar {
        bottom: calc(40px + env(safe-area-inset-bottom, 0px));
        padding: 5px 14px;
    }

    .swb-ux-sidebar {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }

    .swb-ux-sidebar .swb-summary-card {
        max-height: calc(100dvh - 140px - env(safe-area-inset-bottom, 0px));
        padding: 14px 16px;
    }
}

@media (max-width: 480px) {
    .swb-svc-inline-meta {
        white-space: normal;
    }
}
