/* Bookly-inspired Booking System Styles */

.bookly-form {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    font-family: var(--public-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif);
}

/* Dark theme overrides (public booking) */
html[data-theme="dark"] .bookly-form {
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .bookly-service-step,
html[data-theme="dark"] .bookly-time-step,
html[data-theme="dark"] .bookly-details-step,
html[data-theme="dark"] .bookly-confirmation {
    background: rgba(var(--bg-card-rgb, 15, 23, 42), 0.72);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-dark, rgba(148, 163, 184, 0.18));
}

html[data-theme="dark"] .bookly-bold,
html[data-theme="dark"] .bookly-form-group label {
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .bookly-select-mobile,
html[data-theme="dark"] .bookly-input-field {
    background: rgba(var(--bg-input-rgb, 2, 6, 23), 0.55);
    border-color: var(--border-card-dark, rgba(148, 163, 184, 0.35));
    color: var(--text-main, rgba(226, 232, 240, 0.95));
}

html[data-theme="dark"] .bookly-select-mobile:focus,
html[data-theme="dark"] .bookly-input-field:focus {
    border-color: var(--primary-color, #8177f4);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #8177f4) 22%, transparent);
}

html[data-theme="dark"] .bookly-input-field::placeholder {
    color: rgba(148, 163, 184, 0.9);
}

html[data-theme="dark"] .bookly-input-field:-webkit-autofill,
html[data-theme="dark"] .bookly-input-field:-webkit-autofill:hover,
html[data-theme="dark"] .bookly-input-field:-webkit-autofill:focus,
html[data-theme="dark"] .bookly-input-field:-webkit-autofill:active,
html[data-theme="dark"] .bookly-select-mobile:-webkit-autofill,
html[data-theme="dark"] .bookly-select-mobile:-webkit-autofill:hover,
html[data-theme="dark"] .bookly-select-mobile:-webkit-autofill:focus,
html[data-theme="dark"] .bookly-select-mobile:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(var(--bg-input-rgb, 2, 6, 23), 0.95) inset !important;
    -webkit-text-fill-color: rgba(226, 232, 240, 0.95) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
    transition: background-color 5000s ease-in-out 0s;
}

html[data-theme="dark"] .bookly-progress-tracker>div {
    color: rgba(148, 163, 184, 0.95);
}

html[data-theme="dark"] .bookly-progress-tracker .step {
    background: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .picker__header {
    background: rgba(var(--bg-card-rgb, 30, 41, 59), 0.85);
    color: rgba(226, 232, 240, 0.95);
    border-bottom-color: var(--primary-color, #8177f4);
}

html[data-theme="dark"] .picker__frame {
    background: rgba(var(--bg-body-rgb, 15, 23, 42), 0.9);
    border: 1px solid var(--border-dark, rgba(148, 163, 184, 0.18));
}

html[data-theme="dark"] .picker__weekday {
    color: rgba(148, 163, 184, 0.95);
}

html[data-theme="dark"] .picker__day {
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .picker__day--outfocus {
    color: rgba(148, 163, 184, 0.65);
}

html[data-theme="dark"] .picker__day--disabled {
    opacity: 0.45;
}

html[data-theme="dark"] .picker__day--today {
    background: rgba(217, 119, 6, 0.25);
    color: #fbbf24;
}

html[data-theme="dark"] .picker__day--selected {
    background: linear-gradient(135deg, var(--primary-color, #8177f4) 0%, var(--secondary-color, #37acfb) 100%);
    color: #fff !important;
}

html[data-theme="dark"] .picker__day:hover {
    background: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .bookly-time-slots-container .bookly-time-slots>div:not(.bookly-time-slot):only-child {
    background: rgba(var(--bg-input-rgb, 2, 6, 23), 0.45);
    border-color: var(--border-card-dark, rgba(148, 163, 184, 0.28));
}

html[data-theme="dark"] .bookly-time-slot {
    background: rgba(var(--bg-input-rgb, 2, 6, 23), 0.45);
    border: 1px solid var(--border-card-dark, rgba(148, 163, 184, 0.25));
    color: var(--text-main, rgba(226, 232, 240, 0.95));
}

html[data-theme="dark"] .bookly-time-slot:hover {
    background: rgba(var(--bg-card-rgb, 30, 41, 59), 0.85);
    border-color: color-mix(in srgb, var(--primary-color, #8177f4) 50%, transparent);
}

html[data-theme="dark"] .bookly-time-slot.selected {
    background: linear-gradient(135deg, var(--primary-color, #8177f4) 0%, var(--secondary-color, #37acfb) 100%);
    border-color: var(--primary-color, #8177f4);
    color: #fff;
}

html[data-theme="dark"] .bookly-btn-secondary {
    background: rgba(var(--bg-input-rgb, 2, 6, 23), 0.35);
    color: var(--text-main, rgba(203, 213, 225, 0.95));
    border: 1px solid var(--border-card-dark, rgba(148, 163, 184, 0.28));
}

html[data-theme="dark"] .bookly-btn-secondary:hover {
    background: rgba(var(--bg-card-rgb, 30, 41, 59), 0.7);
    border-color: var(--border-card-dark, rgba(148, 163, 184, 0.38));
}

html[data-theme="dark"] .bookly-btn-outline {
    border-color: color-mix(in srgb, var(--primary-color, #8177f4) 75%, transparent);
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .bookly-btn-outline:hover {
    color: #fff;
}

html[data-theme="dark"] .bookly-summary,
html[data-theme="dark"] .bookly-summary-item {
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .bookly-summary {
    background: rgba(var(--bg-input-rgb, 2, 6, 23), 0.35);
    border: 1px solid var(--border-dark, rgba(148, 163, 184, 0.18));
}

html[data-theme="dark"] .bookly-summary-item {
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .bookly-summary-item strong {
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .bookly-recurring-section {
    background: color-mix(in srgb, var(--primary-color, #8177f4) 8%, transparent);
    border-color: color-mix(in srgb, var(--primary-color, #8177f4) 25%, transparent);
}

html[data-theme="dark"] .bookly-hint-text {
    color: rgba(148, 163, 184, 0.85) !important;
}

html[data-theme="dark"] .bookly-empty-state {
    color: rgba(148, 163, 184, 0.7) !important;
}

html[data-theme="dark"] .bookly-nav-steps {
    border-top-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .total-price {
    border-top-color: color-mix(in srgb, var(--primary-color, #8177f4) 45%, transparent);
}

html[data-theme="dark"] .total-price .price-amount {
    color: color-mix(in srgb, var(--primary-color, #8177f4) 95%, transparent);
}

html[data-theme="dark"] .bookly-modal-content {
    background: rgba(var(--bg-body-rgb, 15, 23, 42), 0.92);
    border: 1px solid var(--border-card-dark, rgba(148, 163, 184, 0.22));
}

html[data-theme="dark"] .bookly-modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .bookly-modal-header h3 {
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .bookly-modal-body h4 {
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .bookly-modal-footer {
    border-top-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .bookly-modal-close {
    color: rgba(226, 232, 240, 0.85);
}

html[data-theme="dark"] .bookly-modal-close:hover {
    background: rgba(var(--bg-card-rgb, 30, 41, 59), 0.7);
    color: rgba(255, 255, 255, 0.95);
}

html[data-theme="dark"] .bookly-modal .form-group label {
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .bookly-modal .form-group input,
html[data-theme="dark"] .bookly-modal .form-group select,
html[data-theme="dark"] .bookly-modal .form-group textarea {
    background: rgba(var(--bg-input-rgb, 2, 6, 23), 0.55);
    border-color: var(--border-card-dark, rgba(148, 163, 184, 0.35));
    color: var(--text-main, rgba(226, 232, 240, 0.95));
}

html[data-theme="dark"] .bookly-modal .form-group input:focus,
html[data-theme="dark"] .bookly-modal .form-group select:focus,
html[data-theme="dark"] .bookly-modal .form-group textarea:focus {
    border-color: var(--primary-color, #8177f4);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #8177f4) 22%, transparent);
}

html[data-theme="dark"] .bookly-modal .waitlist-info {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.45);
    color: rgba(253, 230, 138, 0.95);
}

html[data-theme="dark"] .bookly-modal .waitlist-info h4,
html[data-theme="dark"] .bookly-modal .waitlist-info p {
    color: rgba(253, 230, 138, 0.95);
}

html[data-theme="dark"] .bookly-modal .waitlist-form {
    background: rgba(var(--bg-input-rgb, 2, 6, 23), 0.35);
    border-color: var(--border-dark, rgba(148, 163, 184, 0.18));
}

html[data-theme="dark"] .bookly-modal .waitlist-form p {
    color: rgba(226, 232, 240, 0.92);
}

html[data-theme="dark"] .days-selector label {
    background: rgba(var(--bg-input-rgb, 2, 6, 23), 0.55);
    border-color: var(--border-card-dark, rgba(148, 163, 184, 0.35));
    color: var(--text-main, rgba(226, 232, 240, 0.92));
}

html[data-theme="dark"] .days-selector label:hover {
    background: rgba(var(--bg-card-rgb, 30, 41, 59), 0.7);
}

html[data-theme="dark"] .recurring-preview,
html[data-theme="dark"] .recurring-appointments-preview {
    background: rgba(var(--bg-input-rgb, 2, 6, 23), 0.35);
    border: 1px solid var(--border-dark, rgba(148, 163, 184, 0.18));
}

html[data-theme="dark"] .appointment-preview-item {
    background: rgba(var(--bg-input-rgb, 2, 6, 23), 0.45);
    border-color: var(--border-card-dark, rgba(148, 163, 184, 0.22));
}

html[data-theme="dark"] .appointment-preview-item.unavailable {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.35);
}

html[data-theme="dark"] .appointment-date {
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .appointment-time {
    color: rgba(148, 163, 184, 0.95);
}

html[data-theme="dark"] .appointment-preview-item.unavailable .appointment-date {
    color: rgba(252, 165, 165, 0.95);
}

html[data-theme="dark"] .appointment-status.available {
    background: rgba(16, 185, 129, 0.16);
    color: rgba(110, 231, 183, 0.95);
}

html[data-theme="dark"] .appointment-status.unavailable {
    background: rgba(239, 68, 68, 0.16);
    color: rgba(252, 165, 165, 0.95);
}

html[data-theme="dark"] .capacity-warning {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.45);
    color: rgba(253, 230, 138, 0.95);
}

html[data-theme="dark"] .recurring-appointments-list {
    border-color: rgba(148, 163, 184, 0.22);
    background: var(--bg-body, #0f172a);
}

html[data-theme="dark"] .recurring-appointment-item {
    background: var(--bg-body, #0f172a);
    border-bottom-color: rgba(148, 163, 184, 0.18);
    color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .bookly-form .text-muted {
    color: rgba(148, 163, 184, 0.9) !important;
}

html[data-theme="dark"] .recurring-appointment-item .appointment-time {
    color: color-mix(in srgb, var(--primary-color, #8177f4) 95%, transparent);
}

html[data-theme="dark"] .recurring-appointment-item .appointment-price {
    color: rgba(110, 231, 183, 0.95);
}

/* Helper text classes for theme compatibility */
.bookly-hint-text {
    color: #666;
}

.bookly-empty-state {
    color: #999;
    grid-column: 1 / -1;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
}
.bookly-modal .recurring-preview {
    display: none !important;
}

.bookly-modal .summary-info {
    display: none !important;
}

/* Progress Tracker */
.bookly-progress-tracker {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0;
    background: transparent;
    counter-reset: step-counter;
}

.bookly-progress-tracker>div {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    position: relative;
    color: var(--text-muted, #737373);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.bookly-progress-tracker>div::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color, #e5e5e5);
    color: var(--text-muted, #737373);
    font-weight: 700;
    font-size: 13px;
    margin: 0 auto 6px;
    transition: all 0.3s ease;
}

.bookly-progress-tracker>div.active {
    color: var(--primary-color, #8177f4);
    font-weight: 600;
}

.bookly-progress-tracker>div.active::before {
    background: linear-gradient(135deg, var(--primary-color, #8177f4) 0%, var(--secondary-color, #37acfb) 100%);
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color, #8177f4) 35%, transparent);
}

.bookly-progress-tracker .step {
    height: 4px;
    background: var(--border-color, #e5e5e5);
    margin-top: 8px;
    border-radius: 2px;
    transition: background 0.4s ease;
}

.bookly-progress-tracker>div.active .step {
    background: linear-gradient(90deg, var(--primary-color, #8177f4) 0%, var(--secondary-color, #37acfb) 100%);
}

/* Step content transitions */
.bookly-step-content {
    animation: stepFadeIn 0.35s ease-out;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Summary item icons */
.bookly-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--primary-color, #8177f4) 10%, transparent);
    gap: 8px;
}

.bookly-summary-item strong::before {
    display: inline-block;
    margin-right: 6px;
    font-size: 14px;
    vertical-align: middle;
}

/* Service Step */
.bookly-service-step {
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.bookly-box {
    margin-bottom: 20px;
}

.bookly-bold {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-main, #333);
}

.bookly-form-group {
    margin-bottom: 20px;
}

.bookly-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main, #555);
}

.bookly-select-mobile {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: var(--surface-color, #ffffff);
}

.bookly-select-mobile:focus {
    outline: none;
    border-color: var(--primary-color, #8177f4);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #8177f4) 10%, transparent);
}

.bookly-select-mobile.bookly-error {
    border-color: var(--danger, #ef4444);
}

.bookly-label-error {
    color: var(--danger, #ef4444);
    font-size: 13px;
    margin-top: 5px;
}

/* Estados de error mejorados para selects/inputs */
.bookly-input-field.bookly-error,
.bookly-select-mobile.bookly-error {
    border-color: var(--danger, #ef4444);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Campos deshabilitados: aspecto coherente y legible */
.bookly-input-field:disabled,
.bookly-select-mobile:disabled {
    background: var(--bg-body, #f8f9fa);
    color: var(--text-muted, #6b7280);
    cursor: not-allowed;
    opacity: 0.9;
}

/* Time Step */
.bookly-time-step {
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.bookly-calendar-wrapper {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.bookly-calendar-container {
    flex: 1;
    min-width: 300px;
}

.bookly-mobile-staff-summary {
    display: none;
}

.bookly-time-slots-container {
    flex: 1;
    min-width: 250px;
    min-height: 380px;
    max-height: 440px;
    overflow-y: auto;
    overflow-x: clip;
    overflow-clip-margin: 8px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    /* Custom pill-shaped scrollbar */
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary-color, #8177f4) 35%, transparent) transparent;
}

/* Webkit: pill-shaped rounded scrollbar */
.bookly-time-slots-container::-webkit-scrollbar { width: 6px; }
.bookly-time-slots-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.03);
    border-radius: 100px;
    margin: 4px 0;
}
.bookly-time-slots-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color, #8177f4), var(--secondary-color, #37acfb));
    border-radius: 100px;
    min-height: 36px;
}
.bookly-time-slots-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--secondary-color, #37acfb), var(--primary-color, #8177f4));
}
html[data-theme="dark"] .bookly-time-slots-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.04);
}
html[data-theme="dark"] .bookly-time-slots-container {
    scrollbar-color: color-mix(in srgb, var(--primary-color, #8177f4) 50%, transparent) rgba(255,255,255,0.04);
}

/* Placeholder cuando no hay fecha seleccionada - solo el mensaje inicial, NO los slots */
.bookly-time-slots-container .bookly-time-slots>div:not(.bookly-time-slot):only-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    grid-column: 1 / -1;
    padding: 30px 20px;
    min-height: 180px;
    color: var(--text-muted, #6b7280);
    background: var(--bg-body, #f9fafb);
    border-radius: 12px;
    border: 2px dashed var(--border-color, #e5e5e5);
    box-sizing: border-box;
}

.bookly-time-slots-container .bookly-time-slots>div:not(.bookly-time-slot):only-child i {
    font-size: 36px;
    color: var(--primary-color, #8177f4);
    opacity: 0.35;
    margin-bottom: 12px;
}

.bookly-time-slots-container .bookly-time-slots>div:not(.bookly-time-slot):only-child p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    max-width: 200px;
    color: var(--text-muted, #6b7280);
}

/* Calendar Styles */
.picker {
    width: 100%;
}

.picker__frame {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.picker__header {
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-primary, #1e293b);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--primary-color, #8177f4);
}

.picker__month {
    font-size: 18px;
    font-weight: 700;
    text-transform: capitalize;
}

.picker__year {
    font-size: 15px;
    opacity: 0.7;
}

.picker__nav--prev,
.picker__nav--next {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color, #8177f4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    position: relative;
}

.picker__nav--prev:hover,
.picker__nav--next:hover {
    background: var(--secondary-color, #37acfb);
    transform: scale(1.1);
}

.picker__nav--prev::before {
    content: '‹';
    font-size: 22px;
    color: #fff;
}

.picker__nav--next::before {
    content: '›';
    font-size: 22px;
    color: #fff;
}

.picker__nav--disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.picker__table {
    width: 100%;
    border-collapse: collapse;
    padding: 15px;
}

.picker__weekday {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
}

.picker__day {
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.picker__day > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.picker__day:hover {
    background: var(--bg-hover, #e5e7eb);
}

.picker__day--infocus {
    color: var(--text-main, #111827);
}

.picker__day--outfocus {
    color: var(--text-muted, #9ca3af);
}

.picker__day--disabled {
    color: #b0b8c4;
    cursor: not-allowed;
    opacity: 0.5;
}

.picker__day--disabled:hover {
    background: transparent;
}

.picker__day--today {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
    font-weight: 700;
    box-shadow: inset 0 0 0 2px #d97706;
}

.picker__day--selected {
    background: linear-gradient(135deg, var(--primary-color, #8177f4) 0%, var(--secondary-color, #37acfb) 100%);
    color: white !important;
    font-weight: 600;
}

.picker__day--selected:hover {
    background: linear-gradient(135deg, var(--primary-color, #8177f4) 0%, var(--secondary-color, #37acfb) 100%);
    filter: brightness(0.85);
}

/* Time Slots */
.bookly-time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    flex: 1;
    align-content: start;
    padding: 4px;
}

.bookly-time-slot {
    padding: 8px 6px;
    border: 2px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
    background: var(--surface-color, #ffffff);
    min-height: 34px;
    position: relative;
}

.bookly-time-slot:focus-visible {
    border-color: var(--primary-color, #8177f4);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #8177f4) 30%, transparent);
    outline: none;
    z-index: 1;
}

.bookly-time-slot:hover:not(.selected) {
    border-color: var(--primary-color, #8177f4);
    background: color-mix(in srgb, var(--primary-color, #8177f4) 6%, transparent);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    z-index: 1;
}

.bookly-time-slot.selected {
    border-color: var(--primary-color, #8177f4);
    background: linear-gradient(135deg, var(--primary-color, #8177f4) 0%, var(--secondary-color, #37acfb) 100%);
    color: white;
    z-index: 1;
}

.bookly-time-main {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookly-time-additional {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

.bookly-hour-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    position: relative;
}

.bookly-hour-icon span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.bookly-hour-icon span:before {
    content: '';
    position: absolute;
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 4px;
    background: currentColor;
}

/* Navigation Buttons */
.bookly-nav-steps {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #e5e5e5);
    align-items: center;
}

.bookly-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bookly-btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary-color, #8177f4) 90%, transparent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #8177f4) 35%, transparent);
}

.bookly-btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #8177f4) 0%, var(--secondary-color, #37acfb) 100%);
    color: white;
}

.bookly-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--primary-color, #8177f4) 30%, transparent);
}

.bookly-btn-secondary {
    background: var(--bg-body, #f8f9fa);
    color: var(--text-muted, #6b7280);
    border: 1px solid var(--border-color, #e5e5e5);
}

.bookly-btn-secondary:hover {
    background: var(--bg-hover, #e5e7eb);
    border-color: var(--border-color-dark, #cbd5e1);
}

.bookly-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Details Step */
.bookly-details-step {
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.bookly-input-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
    color: var(--text-main, #333);
}

.bookly-input-field:focus {
    outline: none;
    border-color: var(--primary-color, #8177f4);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #8177f4) 10%, transparent);
}

.bookly-input-field::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Summary */
.bookly-summary {
    background: var(--bg-body, #f8f9fa);
    border: 1px solid color-mix(in srgb, var(--primary-color, #8177f4) 15%, transparent);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.bookly-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--primary-color, #8177f4) 10%, transparent);
}

.bookly-summary-item:last-child {
    border-bottom: none;
}

/* Confirmation */
.bookly-confirmation {
    text-align: center;
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.bookly-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    margin: 0 auto 20px;
}

.bookly-confirmation h2 {
    color: var(--text-main, #111827);
    margin-bottom: 10px;
}

.bookly-confirmation p {
    color: var(--text-muted, #6b7280);
    margin-bottom: 30px;
}

/* Loading States */
.bookly-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted, #6b7280);
}

.bookly-loading i {
    color: var(--primary-color, #8177f4);
    margin-bottom: 15px;
}

/* Error States */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.alert-danger {
    background: var(--danger-light, #fee2e2);
    border: 1px solid var(--danger, #ef4444);
    color: var(--danger-dark, #dc2626);
}

.alert-success {
    background: var(--success-light, #d1fae5);
    border: 1px solid var(--success, #10b981);
    color: var(--success-dark, #059669);
}

.alert-info {
    background: var(--info-light, #dbeafe);
    border: 1px solid var(--info, #3b82f6);
    color: var(--info-dark, #2563eb);
}

/* Responsive */
@media (max-width: 768px) {
    .bookly-calendar-wrapper {
        flex-direction: column;
    }

    .bookly-service-step,
    .bookly-details-step,
    .bookly-confirmation {
        padding: 20px;
    }

    .bookly-progress-tracker>div {
        font-size: 12px;
        padding: 10px 5px;
    }

    .bookly-time-slots {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }

    .bookly-nav-steps {
        flex-direction: column-reverse; /* Continuar arriba, Atrás abajo */
        gap: 12px;
    }

    .bookly-btn {
        width: 100%;
        justify-content: center;
    }

    .bookly-btn-primary {
        font-size: 16px;
        padding: 14px 24px;
        order: -1; /* Ensure primary always first visually */
    }

    .bookly-btn-secondary {
        font-size: 14px;
        padding: 10px 20px;
    }

    .bookly-time-main {
        font-size: 13px;
    }

    .bookly-time-additional {
        font-size: 11px;
    }

    .bookly-waitlist-slot .bookly-time-main {
        font-size: 11.5px;
    }

    /* Recurring items - stack on mobile */
    .recurring-appointment-item {
        flex-wrap: wrap;
        gap: 4px;
        padding: 10px 12px;
    }

    .recurring-appointment-item .appointment-date {
        width: 100%;
        font-size: 14px;
    }

    .recurring-appointment-item .appointment-time {
        margin: 0;
        margin-right: auto;
    }

    .recurring-appointment-item .appointment-price {
        margin-left: auto;
    }

    .total-price {
        text-align: center;
    }
}

@media (max-width: 480px) {

    .bookly-form {
        padding: 20px 8px 40px;
    }

    .bookly-service-step,
    .bookly-time-step,
    .bookly-details-step,
    .bookly-confirmation {
        padding: 16px;
        border-radius: 10px;
    }

    /* Progress tracker: show short texts on small screens */
    .bookly-progress-tracker>div {
        font-size: 9px;
        padding: 8px 2px;
        line-height: 1.2;
    }

    .bookly-progress-tracker>div::before {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .bookly-progress-tracker>div.active {
        font-size: 9px;
        font-weight: 700;
    }

    /* Prevent iOS auto-zoom on focus */
    .bookly-input-field,
    .bookly-select-mobile {
        font-size: 16px;
        padding: 10px 12px;
    }

    .bookly-form-group label {
        font-size: 14px;
        margin-bottom: 4px;
    }

    /* Calendar compact */
    .bookly-calendar-container {
        min-width: 100%;
    }

    .bookly-time-slots-container {
        min-width: 100%;
        max-height: 300px;
    }

    .picker__day {
        padding: 8px 4px;
        font-size: 13px;
    }

    .picker__header {
        padding: 14px;
    }

    .picker__month {
        font-size: 16px;
    }

    .picker__nav--prev,
    .picker__nav--next {
        width: 34px;
        height: 34px;
    }

    .bookly-step2-staff-pill--desktop {
        display: none !important;
    }

    .bookly-mobile-staff-summary {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
        width: 100%;
        margin-top: -4px;
        text-align: center;
    }

    .bookly-mobile-staff-summary .bookly-step2-staff-pill {
        justify-content: center;
    }

    .bookly-calendar-container {
        order: 1;
    }

    .bookly-time-slots-container {
        order: 3;
    }

    .bookly-time-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    #recurringSection {
        margin-top: 12px;
    }

    /* Summary items stack on very small screens */
    .bookly-summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .bookly-summary-item span:last-child {
        font-weight: 600;
        color: var(--primary-color, #8177f4);
    }

    .bookly-confirmation {
        padding: 20px 16px;
    }

    .bookly-confirmation h2 {
        font-size: 1.25rem;
    }

    .bookly-confirmation p {
        font-size: 0.9rem;
    }

    /* Loyalty & membership banners adapt */
    #loyaltyBannerContainer > div {
        flex-direction: column !important;
        text-align: center !important;
        padding: 12px !important;
        gap: 8px !important;
    }

    #loyaltyBannerContainer label {
        width: 100% !important;
        justify-content: center !important;
    }

    #membershipCreditsBanner > div {
        flex-direction: column !important;
        text-align: center !important;
        padding: 10px !important;
    }

    .bookly-time-additional {
        opacity: 0.7;
    }
}

.bookly-btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color, #8177f4);
    color: var(--primary-color, #8177f4);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.bookly-btn-outline:hover {
    background: var(--primary-color, #8177f4);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color, #8177f4) 30%, transparent);
}

/* Slots de lista de espera */
.bookly-waitlist-slot {
    background: var(--warning-light, #fef3c7) !important;
    /* claro */
    border-color: var(--warning, #f59e0b) !important;
    color: var(--text-main, #111827) !important;
    /* texto oscuro */
}

.bookly-waitlist-slot .bookly-time-main {
    font-size: 12px;
    /* más pequeño para que quepa */
    color: var(--text-main, #111827);
}

.bookly-waitlist-slot:hover {
    background: var(--warning-light, #fef3c7) !important;
    color: var(--text-main, #111827);
    border-color: var(--warning-dark, #d97706) !important;
}

.bookly-waitlist-slot .bookly-time-main i {
    color: var(--warning, #f59e0b);
}

.bookly-waitlist-slot:hover .bookly-time-main i {
    color: var(--warning-dark, #d97706);
}

/* Mantener estilo legible cuando está seleccionado un slot de lista de espera */
.bookly-waitlist-slot.selected {
    background: var(--warning-light, #fef3c7) !important;
    color: var(--text-main, #111827) !important;
    border-color: var(--warning-dark, #d97706) !important;
}

/* Dark theme: waitlist slots — dark bg with amber accent, readable text */
html[data-theme="dark"] .bookly-waitlist-slot {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: rgba(245, 158, 11, 0.6) !important;
    color: #fde68a !important;
}

html[data-theme="dark"] .bookly-waitlist-slot .bookly-time-main {
    color: #fde68a;
}

html[data-theme="dark"] .bookly-waitlist-slot:hover {
    background: rgba(245, 158, 11, 0.28) !important;
    border-color: rgba(217, 119, 6, 0.8) !important;
    color: #fde68a;
}

html[data-theme="dark"] .bookly-waitlist-slot .bookly-time-main i {
    color: #f59e0b;
}

html[data-theme="dark"] .bookly-waitlist-slot:hover .bookly-time-main i {
    color: #fbbf24;
}

html[data-theme="dark"] .bookly-waitlist-slot.selected {
    background: rgba(245, 158, 11, 0.25) !important;
    color: #fde68a !important;
    border-color: rgba(217, 119, 6, 0.8) !important;
}

/* Modal styles - defined in unified block below (search: "Modal unificado") */

/* Responsive para modales */
@media (max-width: 768px) {
    .bookly-modal {
        padding: 8px;
    }

    .bookly-modal-content {
        max-height: min(92vh, 600px);
        max-width: 100%;
        border-radius: 10px;
    }

    .bookly-modal-header {
        padding: 10px 14px;
    }

    .bookly-modal-header h3 {
        font-size: 16px;
    }

    .bookly-modal-body {
        padding: 12px 14px;
    }

    .bookly-modal-footer {
        padding: 10px 14px;
    }

    .bookly-modal .form-group {
        margin-bottom: 10px;
    }

    .bookly-modal .form-group input,
    .bookly-modal .form-group select,
    .bookly-modal .form-group textarea {
        padding: 7px 10px;
        font-size: 13px;
    }

    .days-selector {
        justify-content: center;
        gap: 4px;
    }

    .days-selector label {
        flex: 0 1 auto;
        min-width: 42px;
        justify-content: center;
        padding: 5px 8px;
        font-size: 12px;
    }

    .appointment-preview-item {
        flex-wrap: wrap;
        padding: 6px 10px;
        gap: 4px;
    }

    .appointment-date {
        font-size: 13px;
    }

    .appointment-time {
        font-size: 12px;
    }

    .appointment-actions .bookly-btn {
        padding: 4px 8px;
        font-size: 12px;
    }

    .capacity-warning {
        padding: 10px;
        margin: 8px 0;
        font-size: 13px;
    }

    .waitlist-info {
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .waitlist-form {
        padding: 10px;
    }

    .recurring-appointments-preview {
        max-height: 220px;
        padding: 8px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.bookly-modal-content {
    animation: fadeIn 0.3s ease-out;
}

/* Mejoras para slots de tiempo */
.bookly-time-slot {
    position: relative;
}

/* Indicadores de estado */
.bookly-time-slot.available {
    border-left: 4px solid var(--success, #10b981);
}

.bookly-time-slot.waitlist {
    border-left: 4px solid var(--warning, #f59e0b);
}

.bookly-time-slot.full {
    border-left: 4px solid var(--danger, #ef4444);
    opacity: 0.6;
    cursor: not-allowed;
}

/* Tooltips para información adicional */
.bookly-tooltip {
    position: relative;
    cursor: help;
}

.bookly-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800, #1f2937);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.bookly-tooltip:hover::after {
    opacity: 1;
}

/* Días con solo lista de espera */
.picker__day--waitlist-only {
    background: linear-gradient(135deg, var(--warning, #f59e0b) 0%, var(--warning-dark, #d97706) 100%);
    color: white !important;
    position: relative;
}

.picker__day--waitlist-only:hover {
    background: linear-gradient(135deg, var(--warning-dark, #d97706) 0%, var(--warning, #f59e0b) 100%);
}

.picker__day--waitlist-only::after {
    content: "⏰";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.8;
}

/* Modal unificado para citas recurrentes y lista de espera */
.bookly-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 16px;
}

.bookly-modal-content {
    background: var(--surface-color, #ffffff);
    border-radius: 12px;
    padding: 0;
    max-width: 560px;
    width: 100%;
    max-height: min(85vh, 640px);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.bookly-modal[style*="flex"] .bookly-modal-content {
    transform: scale(1);
}

.bookly-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    flex-shrink: 0;
}

.bookly-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main, #111827);
    margin: 0;
}

.bookly-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.bookly-modal-close:hover {
    background: var(--bg-hover, #e5e7eb);
    color: var(--text-main, #111827);
}

.bookly-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.bookly-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color, #e5e5e5);
    flex-shrink: 0;
}

.bookly-modal-footer .bookly-btn {
    min-width: 100px;
}

/* Formularios dentro del modal - compactos */
.bookly-modal .form-group {
    margin-bottom: 12px;
}

.bookly-modal .form-group:last-child {
    margin-bottom: 0;
}

.bookly-modal .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-main, #374151);
}

.bookly-modal .form-group input,
.bookly-modal .form-group select,
.bookly-modal .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: var(--surface-color, #ffffff);
    box-sizing: border-box;
}

.bookly-modal .form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.bookly-modal .form-group input:focus,
.bookly-modal .form-group select:focus,
.bookly-modal .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color, #8177f4);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #8177f4) 10%, transparent);
}

/* Selector de días de la semana - compacto */
.days-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.days-selector label {
    display: flex !important;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    margin-bottom: 0 !important;
}

.days-selector label:hover {
    border-color: var(--primary-color, #8177f4);
    background: var(--bg-hover, #eef2ff);
}

.days-selector input[type="checkbox"] {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.days-selector input[type="checkbox"]:checked+span {
    font-weight: 600;
}

/* Preview de recurrencia */
.recurring-preview {
    margin-top: 15px;
    padding: 15px;
    background: var(--success-light, #d1fae5);
    border: 1px solid var(--success, #10b981);
    border-radius: 6px;
    color: var(--success-dark, #059669);
    font-size: 14px;
}

/* Info de lista de espera - compacto */
.waitlist-info {
    text-align: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--warning-light, #fef3c7);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.waitlist-info i.fa-3x {
    font-size: 1.5em !important;
}

.waitlist-info i {
    color: var(--warning, #f59e0b);
}

.waitlist-info h4 {
    color: var(--text-main, #111827);
    margin: 8px 0 6px 0;
    font-size: 15px;
}

.waitlist-info p {
    margin: 2px 0;
    font-size: 13px;
}

.waitlist-form {
    background: var(--bg-body, #f8f9fa);
    border-radius: 8px;
    padding: 14px;
}

.waitlist-form>p {
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Estilos para el paso de revisión de citas recurrentes - compacto */
.recurring-appointments-preview {
    background: var(--bg-body, #f8f9fa);
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    max-height: 280px;
    overflow-y: auto;
}

.recurring-appointments-preview h4 {
    color: var(--text-main, #111827);
    margin-bottom: 10px;
    font-size: 15px;
}

.appointment-preview-item {
    background: var(--surface-color, #ffffff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.appointment-preview-item:last-child {
    margin-bottom: 0;
}

.appointment-preview-item.unavailable {
    background: #fff5f5;
    border-color: #fed7d7;
}

.appointment-preview-item.unavailable .appointment-date {
    color: var(--danger, #ef4444);
}

.appointment-date {
    font-weight: 600;
    color: var(--text-main, #333);
}

.appointment-time {
    color: var(--text-main, #666);
    font-size: 14px;
}

.appointment-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.appointment-status.available {
    background: var(--success-light, #d1fae5);
    color: var(--success-dark, #059669);
}

.appointment-status.unavailable {
    background: var(--danger-light, #fee2e2);
    color: var(--danger-dark, #dc2626);
}

.capacity-warning {
    background: var(--warning-light, #fef3c7);
    border: 1px solid var(--warning, #f59e0b);
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    color: var(--warning-dark, #d97706);
}

.capacity-warning i {
    margin-right: 8px;
}

/* Botón de editar horarios */
.edit-schedule-btn {
    background: var(--warning, #f59e0b);
    color: #212529;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-schedule-btn:hover {
    background: var(--warning-dark, #d97706);
    transform: translateY(-1px);
}

/*
 Recurring appointments summary styles */
.recurring-appointments-list {
    margin-top: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.recurring-appointment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: var(--bg-body, #f8f9fa);
}

.recurring-appointment-item:last-child {
    border-bottom: none;
}

.recurring-appointment-item .appointment-date {
    font-weight: 500;
    color: var(--text-main, #333);
    flex: 1;
}

.recurring-appointment-item .appointment-time {
    font-weight: 600;
    color: var(--primary-color, #8177f4);
    margin: 0 15px;
}

.recurring-appointment-item .appointment-price {
    font-weight: 600;
    color: var(--success, #10b981);
}

.total-price {
    border-top: 2px solid var(--primary-color, #8177f4);
    padding-top: 15px;
    margin-top: 15px;
}

.total-price .price-amount {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-color, #8177f4);
}

/* Change Service Link (when user has preselected a service) */
.bookly-change-service-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--surface-color, #f8fafc);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--bookly-accent, var(--primary-color, #8177f4));
    text-decoration: none;
    transition: all 0.2s ease;
}

.bookly-change-service-link:hover {
    background: color-mix(in srgb, var(--bookly-accent, var(--primary-color, #8177f4)) 12%, transparent);
    border-color: var(--bookly-accent, var(--primary-color, #8177f4));
    color: color-mix(in srgb, var(--bookly-accent, var(--primary-color, #8177f4)) 85%, #000);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--bookly-accent, var(--primary-color, #8177f4)) 15%, transparent);
    text-decoration: none;
}

.bookly-change-service-link i {
    font-size: 12px;
}

/* ─── Waitlist Slot States ─── */
.bookly-time-slot.bookly-on-waitlist {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    cursor: default;
    position: relative;
}

.bookly-time-slot.bookly-on-waitlist .bookly-time-main {
    color: #b45309;
    font-size: 13px;
}

.bookly-time-slot.bookly-on-waitlist .bookly-time-main i {
    margin-right: 4px;
    color: #f59e0b;
}

/* Leave waitlist ✕ button — small, inside the slot, no size change */
.bookly-waitlist-leave-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 2;
}

.bookly-waitlist-leave-btn:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.15);
}

.bookly-waitlist-leave-btn:disabled {
    cursor: wait;
    opacity: 0.6;
}

.bookly-waitlist-leave-btn i.fa-spinner {
    font-size: 10px;
}

/* Dark theme overrides for on-waitlist */
html[data-theme="dark"] .bookly-time-slot.bookly-on-waitlist {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.1);
}

html[data-theme="dark"] .bookly-time-slot.bookly-on-waitlist .bookly-time-main {
    color: #fbbf24;
}

html[data-theme="dark"] .bookly-time-slot.bookly-on-waitlist .bookly-time-main i {
    color: #fbbf24;
}

html[data-theme="dark"] .bookly-waitlist-leave-btn {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

html[data-theme="dark"] .bookly-waitlist-leave-btn:hover {
    background: #ef4444;
    color: #fff;
}

/* ─── Full Slot (visible but disabled, no waitlist) ─── */
.bookly-slot-full {
    background: rgba(239, 68, 68, 0.07) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    cursor: not-allowed !important;
    pointer-events: none;
    opacity: 0.7;
}
.bookly-slot-full .bookly-time-main {
    color: #dc2626;
}
.bookly-waitlist-badge.bookly-full-badge {
    background: #dc2626;
}
html[data-theme="dark"] .bookly-slot-full {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}
html[data-theme="dark"] .bookly-slot-full .bookly-time-main {
    color: #fca5a5;
}
html[data-theme="dark"] .bookly-waitlist-badge.bookly-full-badge {
    background: rgba(220, 38, 38, 0.7);
}

/* ─── Waitlist Badge Icon (replaces text label in slot) ─── */
.bookly-waitlist-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--warning, #f59e0b);
    color: #fff;
    font-size: 9px;
    flex-shrink: 0;
    margin-left: auto;
}
.bookly-waitlist-badge.on-waitlist {
    background: #92400e;
}
html[data-theme="dark"] .bookly-waitlist-badge {
    background: rgba(245, 158, 11, 0.75);
}
html[data-theme="dark"] .bookly-waitlist-badge.on-waitlist {
    background: rgba(146, 64, 14, 0.75);
}

/* ═══════════════════════════════════════ */
/* Service Cards (Step 1)                  */
/* ═══════════════════════════════════════ */
.bookly-service-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.bookly-service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.bookly-service-card.selected {
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

html[data-theme="dark"] .bookly-service-card {
    background: var(--bg-secondary, #1e293b) !important;
    border-color: var(--border-color, #334155);
}
html[data-theme="dark"] .bookly-service-card.selected {
    background: color-mix(in srgb, var(--primary-color, #8177f4) 10%, transparent) !important;
}
html[data-theme="dark"] .bookly-service-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .bookly-card-check {
    border-color: var(--border-color, #475569) !important;
}

@media (max-width: 1023.98px) {
    .bookly-form {
        max-width: 100%;
        padding: 24px 14px calc(56px + env(safe-area-inset-bottom, 0px));
    }

    .bookly-custom-header {
        padding: 1rem 0.25rem 0.5rem !important;
    }

    .bookly-custom-header h2 {
        font-size: clamp(1.35rem, 6vw, 2rem);
        line-height: 1.15;
    }

    .bookly-custom-header p {
        font-size: 0.95rem;
        line-height: 1.45;
    }

    .bookly-progress-tracker {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.35rem;
        padding: 0.5rem;
        margin: 0 0 1rem;
        background: color-mix(in srgb, var(--surface-color, #ffffff) 92%, transparent);
        border: 1px solid color-mix(in srgb, var(--primary-color, #8177f4) 14%, transparent);
        border-radius: 18px;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    }

    .bookly-progress-tracker > div {
        min-width: 0;
        padding: 0.45rem 0.25rem;
        font-size: 0.72rem;
        line-height: 1.15;
        border-radius: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .bookly-progress-tracker > div.active {
        background: color-mix(in srgb, var(--primary-color, #8177f4) 10%, transparent);
    }

    .bookly-progress-tracker > div::before {
        width: 32px;
        height: 32px;
        margin-bottom: 0.35rem;
        font-size: 0.85rem;
    }

    .bookly-service-step,
    .bookly-time-step,
    .bookly-details-step,
    .bookly-confirmation {
        padding: 1rem !important;
        border-radius: 20px !important;
    }

    .bookly-service-card {
        min-height: 74px;
        padding: 14px !important;
        border-radius: 16px !important;
    }

    .bookly-calendar-wrapper {
        gap: 1rem;
    }

    .bookly-calendar-container,
    .bookly-time-slots-container {
        min-width: 0 !important;
        width: 100%;
    }

    .bookly-time-slots-container {
        min-height: 0;
        max-height: none;
        overflow-y: visible;
    }

    .picker__nav--prev,
    .picker__nav--next {
        width: 44px;
        height: 44px;
    }

    .picker__weekday {
        padding: 8px 2px;
    }

    .picker__day {
        min-width: 38px;
        min-height: 38px;
        padding: 0 !important;
        vertical-align: middle;
    }

    .bookly-time-slots {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem;
        padding: 0;
    }

    .bookly-time-slot {
        min-height: 48px;
        padding: 0.75rem 0.65rem;
        border-radius: 14px;
    }

    .bookly-time-main {
        font-size: 0.95rem;
    }

    .bookly-nav-steps {
        position: sticky;
        bottom: 0;
        z-index: 15;
        flex-direction: column;
        gap: 0.75rem;
        margin: 1rem -1rem -1rem;
        padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
        background: color-mix(in srgb, var(--surface-color, #ffffff) 92%, transparent);
        border-top: 1px solid color-mix(in srgb, var(--primary-color, #8177f4) 14%, transparent);
        box-shadow: 0 -16px 36px rgba(15, 23, 42, 0.08);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .bookly-btn {
        min-height: 48px;
        border-radius: 14px;
        justify-content: center;
    }

    .bookly-input-field,
    .bookly-select-mobile {
        min-height: 50px;
        font-size: 16px;
        border-radius: 14px;
    }

    .bookly-form-group {
        margin-bottom: 1rem;
    }

    .bookly-summary {
        padding: 1rem;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .bookly-form {
        padding: 16px 10px calc(52px + env(safe-area-inset-bottom, 0px));
    }

    .bookly-progress-tracker {
        gap: 0.25rem;
        padding: 0.4rem;
    }

    .bookly-progress-tracker > div {
        font-size: 0.62rem;
        padding: 0.4rem 0.12rem;
    }

    .bookly-progress-tracker > div::before {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }

    .bookly-time-slots {
        gap: 0.5rem;
    }

    .bookly-time-slot {
        padding: 0.65rem 0.55rem;
    }

    .bookly-time-main {
        font-size: 0.88rem;
    }

    .bookly-summary-item {
        align-items: stretch;
    }
}