/**
 * Storefront booking — 5-step flow styles.
 *
 * Used by:
 *   1. The legacy /book/<slug> page (book.php).
 *   2. The website-builder `book` slug page (rendered via shop.php?page=book).
 *
 * Both pages render the same step-panel / service-card / staff-card /
 * date-grid / time-slot DOM, so the same stylesheet covers both. The
 * Liquid-template page additionally inherits the website builder's wb-*
 * page chrome (header, footer); these rules only target the booking flow
 * inside that chrome.
 */
:root {
    --brand-orange: #E57E00;
    --brand-orange-dark: #C46B00;
    --brand-blue: #025B92;
    --brand-blue-dark: #014A78;
}

.booking-header {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: #fff;
    padding: 24px 0;
    text-align: center;
    margin-bottom: 30px;
}

.booking-header h1 {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 600;
}

.booking-header .store-name {
    font-size: 1rem;
    opacity: 0.85;
    margin-top: 4px;
}

.booking-container {
    max-width: 1100px;
    margin: 0 auto 60px;
    padding: 0 16px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 4px;
}

.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.step-dot.active {
    background: var(--brand-orange);
    color: #fff;
}

.step-dot.completed {
    background: var(--brand-blue);
    color: #fff;
}

.step-line {
    width: 40px;
    height: 3px;
    background: #dee2e6;
    transition: background 0.3s;
}

.step-line.completed {
    background: var(--brand-blue);
}

.step-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.step-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brand-blue);
    margin-bottom: 20px;
}

.service-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.service-card:hover {
    border-color: var(--brand-orange);
    box-shadow: 0 2px 8px rgba(229, 126, 0, 0.15);
}

.service-card.selected {
    border-color: var(--brand-orange);
    background: #fff8f0;
    box-shadow: 0 2px 8px rgba(229, 126, 0, 0.2);
}

.service-card .service-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #222;
}

.service-card .service-desc {
    font-size: 0.875rem;
    color: #666;
    margin-top: 4px;
}

.service-card .service-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.875rem;
}

.service-card .service-duration {
    color: #888;
}

.service-card .service-price {
    font-weight: 600;
    color: var(--brand-orange);
    font-size: 1rem;
}

.staff-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}

.staff-card:hover {
    border-color: var(--brand-orange);
}

.staff-card.selected {
    border-color: var(--brand-orange);
    background: #fff8f0;
}

.staff-card .staff-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.staff-card .staff-name {
    font-weight: 600;
    font-size: 1rem;
}

.date-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}

.date-grid .day-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    padding-bottom: 4px;
}

.date-cell {
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
    background: #fff;
    border: 1px solid #e9ecef;
}

.date-cell:hover:not(.disabled) {
    background: #fff3e6;
    border-color: var(--brand-orange);
}

.date-cell.selected {
    background: var(--brand-orange);
    color: #fff;
    border-color: var(--brand-orange);
}

.date-cell.disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f8f9fa;
    border-color: transparent;
}

.date-cell.today {
    border-color: var(--brand-blue);
}

.month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.month-nav .month-label {
    font-weight: 600;
    font-size: 1.05rem;
}

.month-nav button {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
    color: #555;
}

.month-nav button:hover {
    background: #f0f0f0;
}

/* Time slots: uniform-width grid that auto-fits the available column.
 * Below 720px the slots fill the full content width; above 720px they
 * sit in the narrower right-hand column of the step-3 grid layout
 * defined further down. `auto-fit` plus a 120px floor keeps every slot
 * the same width regardless of label length. */
.time-slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.time-slot {
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    background: #fff;
    transition: all 0.15s;
    text-align: center;
}

.time-slot:hover {
    border-color: var(--brand-orange);
    background: #fff8f0;
}

.time-slot.selected {
    background: var(--brand-orange);
    color: #fff;
    border-color: var(--brand-orange);
}

.btn-booking {
    background: var(--brand-orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-booking:hover {
    background: var(--brand-orange-dark);
    color: #fff;
}

.btn-booking:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-back {
    background: transparent;
    color: #666;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:hover {
    background: #f0f0f0;
    color: #333;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.summary-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.summary-label {
    color: #888;
    font-size: 0.9rem;
}

.summary-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.confirmation-box {
    text-align: center;
    padding: 40px 20px;
}

.confirmation-box .check-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #d4edda;
    color: #28a745;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
}

.confirmation-box h2 {
    color: var(--brand-blue);
    margin-bottom: 10px;
}

.not-available {
    text-align: center;
    padding: 80px 20px;
}

.not-available .icon {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 16px;
}

.not-available h2 {
    color: #666;
    margin-bottom: 8px;
}

.not-available p {
    color: #999;
}

.deposit-notice {
    background: #fff3e6;
    border: 1px solid var(--brand-orange);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #855700;
}

.spinner-wrapper {
    display: flex;
    justify-content: center;
    padding: 30px 0;
}

.no-slots-msg {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 0.95rem;
}

/* Bootstrap-equivalent form & utility classes. The booking template uses
 * `.form-group`, `.form-control`, `.text-muted`, `.text-danger`, `.mb-3`,
 * `.mt-3`, `.text-left` — book.php's standalone page got these from a
 * Bootstrap 4 CDN, but custom-website pages don't load Bootstrap. We
 * recreate just the rules the booking flow actually needs so the form
 * looks intentional without dragging in Bootstrap's full reset/grid. */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 6px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 1rem;
    line-height: 1.4;
    color: #495057;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 0.15rem rgba(229, 126, 0, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.text-muted   { color: #6c757d; font-weight: normal; }
.text-danger  { color: #dc3545; }
.text-left    { text-align: left; }
.text-center  { text-align: center; }
.mb-3         { margin-bottom: 1rem; }
.mt-3         { margin-top: 1rem; }
.d-block      { display: block; }
.mb-2         { margin-bottom: .5rem; }
.p-3          { padding: 1rem; }

.cancellation-policy {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #666;
    margin-top: 16px;
}

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification.success { background: #28a745; }
.toast-notification.danger { background: #dc3545; }
.toast-notification.warning { background: #ffc107; color: #333; }
.toast-notification.info { background: var(--brand-blue); }

/* Step 3 (Pick a Date & Time): on tablets+ the calendar takes the left
 * column and the time-slot picker sits on the right, instead of stacking.
 * The grid kicks in only when this step is `.active` — otherwise the
 * panel inherits the parent `.step-panel { display: none }` rule.
 *
 * Below 720px we let the default `.step-panel.active { display: block }`
 * apply, so phones fall back to the original vertical stack. */
@media (min-width: 720px) {
    .step-panel#step3.active {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "title    title"
            "monthnav timeSlots"
            "dateGrid timeSlots"
            "actions  actions";
        column-gap: 24px;
    }
    .step-panel#step3.active > .step-title    { grid-area: title; }
    .step-panel#step3.active > .month-nav     { grid-area: monthnav; }
    .step-panel#step3.active > .date-grid     { grid-area: dateGrid; }
    .step-panel#step3.active > #timeSlotsArea { grid-area: timeSlots; align-self: start; }
    .step-panel#step3.active > .step-actions  { grid-area: actions; }
}
