/* ============================================================
   NEW iOS BOOKING FORM - COMPACT FIT-TO-SCREEN + SNAKE SLIDER
   ============================================================ */

/* Overlay */
.new-booking-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.new-booking-overlay.show {
    display: flex;
    opacity: 1;
    align-items: flex-end;
    justify-content: center;
}

/* Modal - Compact */
.new-booking-modal.compact {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    height: 75vh;
    /* Reduced height as requested */
    max-height: 75vh;
    display: flex;
    /* Flex layout for sticky footer */
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.new-booking-overlay.show .new-booking-modal {
    transform: translateY(0);
}

/* Desktop */
@media (min-width: 768px) {
    .new-booking-overlay.show {
        align-items: center;
    }

    .new-booking-modal.compact {
        max-width: 420px;
        border-radius: 20px;
        height: 70vh;
        /* Slightly smaller on desktop */
        max-height: 700px;
    }
}

/* Header - Compact: explicitly white bg, black title */
.new-booking-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    background: #ffffff !important;
    /* Force white — overrides any blue tint */
    z-index: 10;
    border-radius: 20px 20px 0 0;
    /* Match modal top radius */
}

.new-booking-title {
    font-size: 18px;
    font-weight: 700;
    color: #000000 !important;
    /* Force black title */
    margin: 0;
}

.new-booking-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 16px;
}

/* Body - Compact */
.new-booking-body.compact {
    flex: 1;
    /* Take remaining space */
    padding: 8px 16px 12px;
    overflow-y: auto;
    /* Scrollable */
    overscroll-behavior: contain;
}

/* Footer - Fixed */
.new-booking-footer {
    flex-shrink: 0;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

/* Section - Compact */
.new-section.compact {
    margin-bottom: 14px;
}

.new-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.new-section-label i {
    color: #555;
    font-size: 14px;
}

/* ===================== DATE SLIDER ===================== */
.date-slider-container {
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px;
    scrollbar-width: none;
}

.date-slider-container::-webkit-scrollbar {
    display: none;
}

.date-slider {
    display: flex;
    gap: 8px;
}

.date-pill {
    flex-shrink: 0;
    min-width: 52px;
    padding: 10px 8px;
    background: #f5f5f5;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.date-pill:hover {
    background: #eee;
}

.date-pill.selected {
    background: #007AFF;
    border-color: #007AFF;
}

.date-pill .day-name {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #777;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.date-pill .day-num {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.date-pill.selected .day-name,
.date-pill.selected .day-num {
    color: #fff;
}

/* ===================== SNAKE TIME SLIDER ===================== */

/* Time Bubble - Selected time display */
.time-bubble {
    text-align: center;
    margin-bottom: 8px;
}

.time-bubble span {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 122, 255, 0.12);
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    color: #007AFF;
    border: 2px solid rgba(0, 122, 255, 0.25);
}

/* Snake Track - Wavy line */
.snake-track-container {
    position: relative;
    height: 50px;
    margin: 0 10px;
}

.snake-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    transform: translateY(-50%);
    cursor: pointer;
    touch-action: none;
}

/* SVG Snake Path */
.snake-path {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 8;
    stroke-linecap: round;
}

.snake-path-fill {
    fill: none;
    stroke: #007AFF;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.15s;
}

/* Snake thumb */
.snake-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 0 0 2px #007AFF;
    left: 0%;
    transition: left 0.1s;
    pointer-events: none;
    z-index: 10;
}

.time-labels {
    display: flex;
    justify-content: space-between;
    padding: 4px 0 0;
}

.time-labels span {
    font-size: 9px;
    font-weight: 600;
    color: #888;
}

/* ===================== TIME BOXES GRID ===================== */
.time-boxes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.time-box {
    padding: 10px 6px;
    background: #f5f5f5;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.time-box:hover {
    background: #e8e8e8;
}

.time-box.selected {
    background: #007AFF;
    color: #fff;
    border-color: #007AFF;
}

.time-box.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===================== CART SERVICES ===================== */
.cart-services-container.compact {
    max-height: 120px;
    overflow-y: auto;
    background: #f8f8f8;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
}

.cart-services-container.compact::-webkit-scrollbar {
    width: 3px;
}

.cart-services-container.compact::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.empty-cart-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #aaa;
}

.empty-cart-message i {
    font-size: 28px;
    margin-bottom: 6px;
}

.empty-cart-message p {
    margin: 0;
    font-size: 13px;
}

/* Cart Service Item */
.cart-service-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
}

.cart-service-item:last-child {
    border-bottom: none;
}

.cart-service-icon {
    width: 36px;
    height: 36px;
    background: #333;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-service-icon i {
    font-size: 14px;
    color: #fff;
}

.cart-service-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.cart-service-info {
    flex: 1;
    min-width: 0;
}

.cart-service-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.cart-service-price {
    font-size: 12px;
    font-weight: 700;
    color: #007AFF;
}

/* Cart Controls */
.cart-service-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    padding: 3px 5px;
    border-radius: 8px;
}

.cart-service-controls button {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
}

.cart-service-controls .cart-minus {
    background: #ddd;
    color: #666;
}

.cart-service-controls .cart-plus {
    background: #007AFF;
    color: #fff;
}

.cart-service-controls .cart-qty {
    font-size: 13px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* Total Row */
.total-row-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f0f0f0;
    border-radius: 10px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
}

.total-row-compact .total-amount {
    font-size: 18px;
    font-weight: 800;
    color: #007AFF;
}

/* ===================== OPTIONAL - INLINE ===================== */
.optional-inline {
    margin-bottom: 12px;
}

.optional-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.optional-toggle i {
    color: #007AFF;
    transition: transform 0.3s;
}

.optional-inline.expanded .optional-toggle i {
    transform: rotate(45deg);
}

.optional-content-inline {
    display: none;
    padding: 10px 0;
}

.optional-inline.expanded .optional-content-inline {
    display: block;
}

.optional-content-inline textarea {
    width: 100%;
    padding: 10px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 13px;
    resize: none;
    height: 60px;
    font-family: inherit;
    margin-bottom: 8px;
}

.optional-content-inline textarea:focus {
    outline: none;
    border-color: #007AFF;
}

.image-upload-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f5f5f5;
    border: 1px dashed #ccc;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.image-upload-compact i {
    color: #007AFF;
}

.image-upload-compact.has-image {
    border-color: #007AFF;
    background: #f0f7ff;
}

/* ===================== CONFIRM BUTTON ===================== */
.confirm-booking-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #007AFF 0%, #0051d5 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
}

.confirm-booking-btn:active {
    transform: scale(0.98);
}

.confirm-booking-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.confirm-booking-btn i {
    font-size: 16px;
}

/* Loading spinner */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .new-booking-body.compact {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}