/* Square 2.3.2 - centered equal-gutter booking layout with an aligned sticky cart rail */

.ssbc-app,
.ssbc-app * { box-sizing: border-box; }

.ssbc-app {
    width: min(100%, 1888px);
    max-width: 1888px;
    margin: 0 auto;
    padding: 0 24px;
    color: inherit;
}

.ssbc-status,
.ssbc-result { width: 100%; font-weight: 700; }
.ssbc-status:not(:empty), .ssbc-result:not(:empty) { margin-bottom: 16px; }
.ssbc-status:empty, .ssbc-result:empty { display: none; }

.ssbc-booking-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(280px, 20vw, 340px);
    gap: 24px;
    margin-top: 18px;
    align-items: start;
}

.ssbc-booking-main,
.ssbc-step { min-width: 0; }
.ssbc-catalog > h2 { margin: 0; }
.ssbc-location-wrap { display: grid; gap: 6px; max-width: 420px; margin-top: 14px; }

/* Compact service catalog */
.ssbc-services {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 0;
    align-items: stretch;
}

.ssbc-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    min-width: 0;
    min-height: 172px;
    overflow: hidden;
    color: inherit;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-color: color-mix(in srgb, currentColor 24%, transparent);
    border-radius: 11px;
}

.ssbc-card img,
.ssbc-card-image-placeholder {
    display: block;
    width: 92px;
    height: 92px;
    aspect-ratio: 1 / 1;
    align-self: start;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    border-color: color-mix(in srgb, currentColor 16%, transparent);
}

.ssbc-card-body { display: flex; flex-direction: column; min-width: 0; padding: 10px; }
.ssbc-card h3 { margin: 0; font-size: clamp(1.05rem, 1.15vw, 1.3rem); line-height: 1.16; overflow-wrap: anywhere; }
.ssbc-card-footer { display: flex; flex: 1; flex-direction: column; margin-top: 6px; }
.ssbc-card-footer .ssbc-variation { margin-bottom: 2px; font-size: .88rem; font-weight: 600; }
.ssbc-card-footer .ssbc-meta { font-size: .84rem; opacity: .78; }
.ssbc-card-footer .ssbc-price { margin: 3px 0 5px; font-size: .94rem; font-weight: 700; }
.ssbc-card-footer .ssbc-description-details { margin: 0 0 5px; }

.ssbc-description-details { border-top: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14); border-color: color-mix(in srgb, currentColor 14%, transparent); }
.ssbc-description-details summary { padding: 4px 0; cursor: pointer; font-size: .78rem; font-weight: 700; list-style-position: inside; user-select: none; }
.ssbc-description-details summary:hover, .ssbc-description-details summary:focus-visible { text-decoration: underline; }
.ssbc-description-details[open] summary { border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.ssbc-description { max-height: 150px; margin: 0; padding: 8px 0; overflow-y: auto; font-size: .84rem; line-height: 1.45; white-space: pre-line; }
.ssbc-card-footer > button[data-add] { align-self: flex-start; margin-top: auto; padding: 5px 9px; font-size: .84rem; }

/* Sticky cart architecture: the rail owns layout, the cart owns stickiness. */
.ssbc-cart-rail { position: relative; min-width: 0; align-self: stretch; }
.ssbc-cart {
    --ssbc-cart-sticky-offset: 24px;
    position: sticky;
    top: var(--ssbc-cart-sticky-offset);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - var(--ssbc-cart-sticky-offset) - 24px);
    overflow: hidden;
    color: inherit;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.25);
    border-color: color-mix(in srgb, currentColor 25%, transparent);
    border-radius: 13px;
    box-shadow: 0 14px 36px rgba(0,0,0,.12);
}
body.admin-bar .ssbc-cart { --ssbc-cart-sticky-offset: 56px; }
.ssbc-cart-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 13px; border-bottom: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
.ssbc-cart-header h2 { margin: 2px 0 0; font-size: 1.3rem; }
.ssbc-cart-eyebrow { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .08em; opacity: .62; text-transform: uppercase; }
.ssbc-cart-count { flex: 0 0 auto; padding: 4px 8px; background: color-mix(in srgb, currentColor 10%, transparent); border-radius: 999px; font-size: .76rem; font-weight: 700; }
.ssbc-cart-items { min-height: 0; padding: 0 18px; overflow-y: auto; overscroll-behavior: contain; }
.ssbc-cart-empty { margin: 0; padding: 20px 18px; opacity: .72; }
.ssbc-cart-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent); }
.ssbc-cart-copy { min-width: 0; }
.ssbc-cart-service, .ssbc-cart-variation { display: block; overflow-wrap: anywhere; }
.ssbc-cart-service { font-size: .9rem; font-weight: 700; line-height: 1.3; }
.ssbc-cart-variation { margin-top: 3px; font-size: .78rem; line-height: 1.3; opacity: .7; }
.ssbc-quantity-controls { display: inline-grid; grid-template-columns: 28px minmax(24px, auto) 28px; align-items: center; gap: 4px; }
.ssbc-app .ssbc-quantity-button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; min-width: 28px; padding: 0; border-radius: 50%; font-size: 1rem; line-height: 1; }
.ssbc-quantity { min-width: 24px; text-align: center; font-size: .84rem; font-weight: 800; }
.ssbc-cart-footer { margin-top: auto; padding: 14px 18px 18px; border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
.ssbc-cart-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: .86rem; }
.ssbc-cart-summary strong { font-size: 1rem; }

/* Controls */
.ssbc-app button { padding: 9px 13px; cursor: pointer; color: inherit; background: transparent; border: 1px solid rgba(255,255,255,.4); border-color: color-mix(in srgb, currentColor 38%, transparent); border-radius: 8px; font-weight: 600; transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease; }
.ssbc-app button:not(:disabled):not(.ssbc-remove-item):hover, .ssbc-app button:not(:disabled):not(.ssbc-remove-item):focus-visible { color: #1d1d1d; background: #fff; border-color: #fff; box-shadow: 0 7px 20px rgba(0,0,0,.2); transform: translateY(-1px); }
.ssbc-app button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.ssbc-app button:disabled { cursor: not-allowed; opacity: .38; }
.ssbc-app .ssbc-remove-item { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-width: 32px; padding: 0; border-radius: 50%; font-size: 1.25rem; line-height: 1; opacity: .72; }
.ssbc-app .ssbc-remove-item:hover, .ssbc-app .ssbc-remove-item:focus-visible { color: #1d1d1d; background: #fff; border-color: #fff; opacity: 1; transform: rotate(90deg); }
.ssbc-app .ssbc-to-schedule { width: 100%; min-height: 46px; padding: 11px 16px; color: #1d1d1d; background: #fff; border-color: #fff; font-size: .95rem; font-weight: 700; }
.ssbc-app .ssbc-to-schedule:not(:disabled):hover, .ssbc-app .ssbc-to-schedule:not(:disabled):focus-visible { color: #fff; background: transparent; box-shadow: 0 8px 24px rgba(0,0,0,.28); }

/* Booking form */
.ssbc-form { display: grid; gap: 12px; max-width: 620px; }
.ssbc-form label { display: grid; gap: 5px; }
.ssbc-form input, .ssbc-form textarea, .ssbc-location, .ssbc-date { width: 100%; padding: 10px; box-sizing: border-box; }
.ssbc-app input, .ssbc-app textarea, .ssbc-app select { color: inherit; background: transparent; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.ssbc-form textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.ssbc-form textarea::placeholder, .ssbc-form input::placeholder { color: currentColor; opacity: .55; }
.ssbc-required-message { margin: 0 0 8px; font-size: .9rem; opacity: .82; }
.ssbc-required-marker { color: #ff6b6b; font-weight: 800; }
.ssbc-selected-time { margin-bottom: 8px; font-weight: 700; }
.ssbc-form button[type="submit"] { min-height: 52px; margin-top: 8px; }

/* Date of birth tooltip */
.ssbc-field-heading { display: inline-flex; align-items: center; justify-self: start; gap: 8px; }
.ssbc-info-wrap { position: relative; display: inline-flex; align-items: center; }
.ssbc-app .ssbc-info-button { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; min-width: 22px; padding: 0; border: 1px solid currentColor; border-radius: 50%; font-family: inherit; font-size: .78rem; font-weight: 700; line-height: 1; opacity: .75; }
.ssbc-info-tooltip { position: absolute; z-index: 20; left: calc(100% + 6px); top: 50%; width: max-content; max-width: 260px; padding: 10px 12px; color: #1d1d1d; background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: .85rem; font-weight: 600; line-height: 1.4; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-50%) translateX(-4px); }
.ssbc-info-button:hover + .ssbc-info-tooltip, .ssbc-info-button:focus-visible + .ssbc-info-tooltip, .ssbc-info-wrap:focus-within .ssbc-info-tooltip { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }

/* Scheduling */
.ssbc-app.ssbc-scheduling .ssbc-booking-shell { display: none; }
.ssbc-app.ssbc-scheduling .ssbc-schedule { width: 100%; max-width: 1280px; margin: 0 auto; }
.ssbc-schedule-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.ssbc-schedule-heading h2 { margin: 0; }
.ssbc-continue-shopping { flex: 0 0 auto; white-space: nowrap; }
.ssbc-calendar-instruction { margin: 0 0 24px; opacity: .8; }
.ssbc-calendar-layout { display: grid; grid-template-columns: minmax(560px, 1.35fr) minmax(300px, .65fr); gap: 24px; align-items: start; }
.ssbc-calendar-panel, .ssbc-time-panel { width: 100%; min-width: 0; padding: 24px; border: 1px solid color-mix(in srgb, currentColor 28%, transparent); border-radius: 12px; }
.ssbc-calendar-panel { max-width: 800px; }
.ssbc-calendar-header { display: grid; grid-template-columns: 48px minmax(0,1fr) 48px; align-items: center; gap: 12px; margin-bottom: 24px; }
.ssbc-cal-title { text-align: center; font-size: 1.25rem; font-weight: 700; }
.ssbc-cal-prev, .ssbc-cal-next { width: 48px; min-height: 48px; padding: 0; font-size: 1.5rem; line-height: 1; }
.ssbc-calendar-weekdays, .ssbc-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(44px,1fr)); gap: 8px; }
.ssbc-calendar-weekdays { margin-bottom: 10px; }
.ssbc-calendar-weekdays span { text-align: center; font-size: .8rem; font-weight: 600; opacity: .7; }
.ssbc-cal-empty, .ssbc-app .ssbc-cal-day { min-height: 52px; }
.ssbc-app .ssbc-cal-day { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 6px; border-radius: 8px; }
.ssbc-app .ssbc-cal-day.today { border-style: dashed; }
.ssbc-app .ssbc-cal-day.selected { color: #1d1d1d; background: #fff; border-color: #fff; outline: 2px solid #fff; outline-offset: 2px; }
.ssbc-time-panel h3 { margin: 0 0 12px; }
.ssbc-selected-date { min-height: 28px; margin-bottom: 20px; font-weight: 600; }
.ssbc-slots { display: grid; grid-template-columns: repeat(2,minmax(120px,1fr)); gap: 12px; margin: 0; }
.ssbc-app .ssbc-slot { width: 100%; min-height: 48px; }
.ssbc-app .ssbc-slot.selected { background: color-mix(in srgb, currentColor 15%, transparent); outline: 2px solid currentColor; outline-offset: 2px; }
.ssbc-no-times { grid-column: 1 / -1; margin: 0; opacity: .8; }
.ssbc-availability-loading { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; white-space: nowrap; }
.ssbc-spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid color-mix(in srgb,currentColor 30%,transparent); border-top-color: currentColor; border-radius: 50%; animation: ssbc-spin .8s linear infinite; }
@keyframes ssbc-spin { to { transform: rotate(360deg); } }

/* Confirmation */
.ssbc-confirmation { width: 100%; max-width: 760px; margin: 24px auto; padding: 36px; color: inherit; background: rgba(255,255,255,.04); border: 1px solid color-mix(in srgb,currentColor 22%,transparent); border-radius: 16px; }
.ssbc-confirmation-header { display: flex; align-items: center; gap: 20px; padding-bottom: 28px; border-bottom: 1px solid color-mix(in srgb,currentColor 16%,transparent); }
.ssbc-confirmation-check { display: flex; flex: 0 0 58px; align-items: center; justify-content: center; width: 58px; height: 58px; color: #1d1d1d; background: #fff; border-radius: 50%; font-size: 2rem; font-weight: 700; }
.ssbc-confirmation-header h2 { margin: 0 0 8px; font-size: clamp(2rem,5vw,3.25rem); line-height: 1.05; }
.ssbc-confirmation-header p { margin: 0; opacity: .78; }
.ssbc-confirmation-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin: 28px 0 18px; }
.ssbc-confirmation-item, .ssbc-confirmation-number { padding: 20px; background: color-mix(in srgb,currentColor 5%,transparent); border: 1px solid color-mix(in srgb,currentColor 14%,transparent); border-radius: 10px; }
.ssbc-confirmation-label { margin-bottom: 8px; font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.ssbc-confirmation-value { font-size: 1.25rem; font-weight: 600; line-height: 1.35; }
.ssbc-confirmation-code { overflow-wrap: anywhere; font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; font-size: 1.1rem; letter-spacing: .04em; }
.ssbc-app .ssbc-add-calendar { width: 100%; min-height: 52px; margin-top: 24px; padding: 12px 18px; color: #1d1d1d; background: #fff; border-color: #fff; font-size: 1rem; font-weight: 700; }

/* Business hours inherit the active theme. */
.ssbc-business-hours { width: 100%; margin: 0; padding: 0; color: inherit; text-align: inherit; }
.ssbc-business-hours h2 { margin: 0 0 .5em; padding: 0; color: inherit; text-align: inherit; }
.ssbc-business-hours h3 { margin: 0 0 .4em; padding: 0; color: inherit; text-align: inherit; }
.ssbc-business-hours p.ssbc-hours-row { display: block; margin: 0 0 4px; padding: 0; border: 0; color: inherit; text-align: inherit; }
.ssbc-business-hours p.ssbc-hours-row strong { display: inline-block; width: 130px; margin: 0; padding: 0; color: inherit; white-space: nowrap; }
.ssbc-business-hours p.ssbc-hours-row span { display: inline; margin: 0; padding: 0; color: inherit; white-space: nowrap; }
.ssbc-hours-error { margin: 0; color: #ff8a8a; }

.ssbc-app [hidden] { display: none !important; }

@media (max-width: 1550px) { .ssbc-services { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 1180px) {
    .ssbc-booking-shell { grid-template-columns: minmax(0,1fr) 280px; gap: 18px; }
    .ssbc-services { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ssbc-calendar-layout { grid-template-columns: 1fr; }
    .ssbc-calendar-panel { max-width: none; }
}
@media (max-width: 900px) {
    .ssbc-app { width: 100%; max-width: 100%; padding-right: 16px; padding-left: 16px; }
    .ssbc-booking-shell { grid-template-columns: 1fr; }
    .ssbc-cart-rail { order: -1; }
    .ssbc-cart { position: static; max-height: none; }
    .ssbc-cart-items { max-height: 240px; }
}
@media (max-width: 680px) {
    .ssbc-services { grid-template-columns: 1fr; }
    .ssbc-card { grid-template-columns: 84px minmax(0,1fr); min-height: 158px; }
    .ssbc-card img, .ssbc-card-image-placeholder { width: 84px; height: 84px; }
    .ssbc-cart-row { grid-template-columns: minmax(0, 1fr) 32px; grid-template-areas: "copy remove" "quantity quantity"; }
    .ssbc-cart-copy { grid-area: copy; }
    .ssbc-quantity-controls { grid-area: quantity; justify-self: start; }
    .ssbc-remove-item { grid-area: remove; }
    .ssbc-calendar-panel, .ssbc-time-panel { padding: 16px; }
    .ssbc-calendar-weekdays, .ssbc-calendar-days { grid-template-columns: repeat(7,minmax(32px,1fr)); gap: 5px; }
    .ssbc-app .ssbc-cal-day { min-height: 42px; padding: 4px; }
    .ssbc-schedule-heading { align-items: flex-start; flex-direction: column; }
    .ssbc-availability-loading { white-space: normal; }
    .ssbc-confirmation { margin: 16px auto; padding: 24px 18px; }
    .ssbc-confirmation-header { align-items: flex-start; }
    .ssbc-confirmation-details { grid-template-columns: 1fr; }
    .ssbc-info-tooltip { right: auto; bottom: calc(100% + 8px); left: 50%; top: auto; width: min(240px,75vw); transform: translateX(-50%) translateY(4px); }
}
