/* Sky Training Bookings — Frontend Styles */

/* Date selector on product page */
.stb-date-selector {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.stb-date-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.stb-date-selector select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.stb-no-dates {
    color: #666;
    font-style: italic;
}

/* Book Training button (shortcode + Elementor widget) */
.stb-book-button,
.stb-book-button:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #233d7b !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    cursor: pointer;
    line-height: 1;
}

.stb-book-button:hover,
.stb-book-button:focus {
    background: #1a2e5e !important;
    color: #fff !important;
}

/* Button icon */
.stb-book-button .stb-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.stb-book-button .stb-btn-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}
.stb-book-button .stb-btn-icon i {
    font-size: inherit;
}

/* Training dates list (shortcode) */
.stb-dates-list {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    margin: 20px 0;
}

.stb-date-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.stb-date-card-header {
    background: #233d7b;
    color: #fff;
    padding: 12px 18px;
}

.stb-date-card-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
}

.stb-date-card-body {
    padding: 18px;
}

.stb-date-card-body .stb-date-info {
    margin: 0 0 8px;
    font-size: 14px;
}

.stb-date-card-body .stb-book-button {
    margin-top: 10px;
}

.stb-error {
    color: #d63638;
    font-style: italic;
}

/* Waiting list form */
.stb-waitlist-form {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff9e6;
}

.stb-waitlist-form h4 {
    margin: 0 0 8px;
    font-size: 15px;
}

.stb-waitlist-form p {
    margin: 0 0 12px;
    font-size: 13px;
    color: #666;
}

.stb-waitlist-form select,
.stb-waitlist-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.stb-waitlist-form .stb-book-button {
    margin-top: 4px;
}

#stb-waitlist-message {
    margin-top: 10px;
    font-weight: 600;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════
   Booking Popup / Modal
   ═══════════════════════════════════════════════════════ */

.stb-popup-body-lock {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

html.stb-popup-body-lock {
    overflow: hidden !important;
}

.stb-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.stb-popup.stb-popup-open {
    display: flex;
}

.stb-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.stb-popup-container {
    position: relative;
    z-index: 2;
    width: 94%;
    max-width: 680px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: stbPopupIn 0.3s ease;
}

@keyframes stbPopupIn {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.stb-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #fafbfc;
    flex-shrink: 0;
}

.stb-popup-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.stb-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.stb-popup-close:hover {
    color: #333;
}

/* Body */
.stb-popup-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
}

/* Loader */
.stb-popup-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}

.stb-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8e8e8;
    border-top-color: #233d7b;
    border-radius: 50%;
    animation: stbSpin 0.7s linear infinite;
    margin-bottom: 12px;
}

@keyframes stbSpin {
    to { transform: rotate(360deg); }
}

/* Meta bar */
.stb-popup-meta-bar {
    display: flex;
    gap: 0;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #f9fafb;
}

.stb-popup-meta-item {
    flex: 1;
    padding: 12px 14px;
    text-align: center;
    font-size: 13px;
    color: #555;
    border-right: 1px solid #e8e8e8;
}

.stb-popup-meta-item:last-child {
    border-right: none;
}

.stb-popup-meta-item strong {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 2px;
}

.stb-popup-meta-price {
    color: #1a1a2e;
    font-weight: 700;
}

/* Slots header */
.stb-popup-slots-info {
    margin: 0 0 14px;
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

/* Slot cards */
.stb-popup-slots-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stb-popup-slot-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.stb-popup-slot-card:hover:not(.stb-slot-full) {
    border-color: #233d7b;
    background: #f0f3fa;
}

.stb-popup-slot-card.stb-slot-selected {
    border-color: #233d7b;
    background: #e8ecf6;
    box-shadow: 0 0 0 3px rgba(35, 61, 123, 0.15);
}

.stb-popup-slot-card.stb-slot-full {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

/* Date badge */
.stb-popup-slot-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 10px 8px;
    background: #233d7b;
    border-radius: 10px;
    color: #fff;
    text-align: center;
    flex-shrink: 0;
}

.stb-popup-slot-day {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.stb-popup-slot-month {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.stb-popup-slot-weekday {
    font-size: 10px;
    opacity: 0.85;
    margin-top: 1px;
}

/* Slot info */
.stb-popup-slot-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.stb-popup-slot-time {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
}

.stb-popup-slot-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.stb-popup-slot-venue,
.stb-popup-slot-trainer {
    font-size: 13px;
    color: #666;
}

.stb-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 3px;
}

.stb-icon svg {
    display: block;
}

.stb-popup-slot-bottom {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 2px;
}

.stb-popup-slot-places {
    font-size: 12px;
    font-weight: 600;
    color: #233d7b;
}

.stb-popup-slot-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #233d7b;
    background: #e8edf6;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.stb-popup-slot-places.stb-places-low {
    color: #d63638;
}

/* Selection check */
.stb-popup-slot-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid #ddd;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s;
}

.stb-check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: color 0.2s;
}

.stb-check-icon svg {
    display: block;
}

.stb-slot-selected .stb-popup-slot-check {
    border-color: #233d7b;
    background: #233d7b;
}

.stb-slot-selected .stb-check-icon {
    color: #fff;
}

/* Action button area */
.stb-popup-action {
    padding: 16px 0 0;
    border-top: 1px solid #eee;
    margin-top: 16px;
}

.stb-btn-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 6px;
}

.stb-btn-icon svg {
    display: block;
}

.stb-popup-add-btn {
    width: 100%;
    padding: 16px 24px;
    background: #233d7b !important;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stb-popup-add-btn:hover:not(:disabled) {
    background: #1a2e5e !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 61, 123, 0.3);
}

.stb-popup-add-btn.stb-btn-disabled,
.stb-popup-add-btn:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stb-popup-add-btn.stb-btn-loading {
    background: #888 !important;
}

/* No slots */
.stb-popup-no-slots {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.stb-popup-empty-icon {
    margin: 0 auto 12px;
    opacity: 0.4;
    color: #233d7b;
}

.stb-popup-empty-icon svg {
    display: block;
}

.stb-popup-no-slots p {
    margin: 0;
    line-height: 1.6;
    font-size: 14px;
}

/* Success state */
.stb-popup-success {
    text-align: center;
    padding: 20px 0;
}

.stb-popup-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #ecfdf5;
    color: #059669;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    border: 2px solid #a7f3d0;
}

.stb-popup-success h3 {
    margin: 0 0 8px;
    font-size: 1.3rem;
    color: #065f46;
}

.stb-popup-success p {
    margin: 0 0 24px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.stb-popup-success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.stb-popup-continue-btn {
    padding: 12px 28px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.stb-popup-continue-btn:hover {
    background: #e2e8f0;
}

.stb-popup-checkout-btn,
.stb-popup-checkout-btn:visited {
    padding: 12px 28px;
    background: #233d7b !important;
    color: #fff !important;
    text-decoration: none !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.stb-popup-checkout-btn:hover,
.stb-popup-checkout-btn:focus {
    background: #1a2e5e !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* Error message */
.stb-popup-msg {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.stb-popup-msg-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ═══════ Mobile: Full-page popup ═══════ */
@media (max-width: 768px) {
    .stb-popup.stb-popup-open {
        align-items: stretch;
    }

    .stb-popup-overlay {
        background: #fff;
        backdrop-filter: none;
    }

    .stb-popup-container {
        width: 100%;
        max-width: 100%;
        max-height: none;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
        animation: none;
    }

    /* Sticky header with prominent close button */
    .stb-popup-header {
        position: sticky;
        top: 0;
        z-index: 10;
        padding: 16px 20px;
        background: #fff;
        border-bottom: 1px solid #e8e8e8;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .stb-popup-title {
        font-size: 1.1rem;
        padding-right: 12px;
    }

    .stb-popup-close {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f1f5f9;
        border-radius: 50%;
        font-size: 24px;
        color: #333;
    }

    .stb-popup-close:hover {
        background: #e2e8f0;
    }

    /* Body scrolls the full page */
    .stb-popup-body {
        padding: 16px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .stb-popup-meta-bar {
        flex-direction: row;
    }

    .stb-popup-meta-item {
        border-right: 1px solid #e8e8e8;
        border-bottom: none;
        padding: 10px 8px;
        font-size: 12px;
    }

    .stb-popup-meta-item:last-child {
        border-right: none;
    }

    .stb-popup-meta-item strong {
        display: block;
        margin-bottom: 2px;
        font-size: 10px;
    }

    .stb-popup-slot-card {
        padding: 14px 12px;
        gap: 12px;
    }

    .stb-popup-slot-badge {
        min-width: 56px;
        padding: 8px 6px;
    }

    .stb-popup-slot-day {
        font-size: 1.4rem;
    }

    .stb-popup-slot-meta {
        flex-direction: column;
        gap: 2px;
    }

    .stb-popup-slot-bottom {
        flex-wrap: wrap;
    }

    .stb-popup-slot-time {
        font-size: 13px;
    }

    .stb-popup-slot-venue,
    .stb-popup-slot-trainer {
        font-size: 12px;
    }

    /* Sticky add-to-basket button at bottom */
    .stb-popup-action {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 14px 0;
        margin-top: 12px;
        border-top: 1px solid #eee;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    }

    .stb-popup-add-btn {
        padding: 14px 20px;
        font-size: 15px;
    }

    .stb-popup-success-actions {
        flex-direction: column;
    }

    .stb-popup-continue-btn,
    .stb-popup-checkout-btn {
        width: 100%;
        text-align: center;
    }

    .stb-popup-action-dual {
        flex-direction: column;
    }

    .stb-enquiry-row {
        flex-direction: column;
    }
}

/* ═══════ Dual Action Buttons ═══════ */
.stb-popup-action-dual {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stb-popup-enquiry-btn {
    width: 100%;
    padding: 13px 20px;
    border: 2px solid #233d7b !important;
    border-radius: 10px;
    background: #fff !important;
    color: #233d7b !important;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stb-popup-enquiry-btn:hover:not(:disabled) {
    background: #233d7b !important;
    border-color: #233d7b !important;
    color: #fff !important;
}

.stb-popup-enquiry-btn:disabled,
.stb-popup-enquiry-btn.stb-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ═══════ Enquiry Form ═══════ */
.stb-enquiry-container {
    padding: 0;
}

.stb-enquiry-header {
    margin-bottom: 20px;
}

.stb-enquiry-back-btn {
    background: none;
    border: none;
    color: #233d7b;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 10px;
    font-weight: 600;
}

.stb-enquiry-back-btn:hover {
    color: #1a2e5e;
    text-decoration: underline;
}

.stb-enquiry-header h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    color: #1e293b;
}

.stb-enquiry-slot-ref {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.stb-enquiry-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stb-enquiry-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.stb-enquiry-field {
    flex: 1;
}

.stb-enquiry-field-full {
    flex: 1 1 100%;
}

.stb-enquiry-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 5px;
}

.stb-enquiry-field input,
.stb-enquiry-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.stb-enquiry-field input:focus,
.stb-enquiry-field textarea:focus {
    border-color: #233d7b;
    outline: none;
    box-shadow: 0 0 0 2px rgba(35, 61, 123, 0.15);
}

.stb-enquiry-field textarea {
    resize: vertical;
    min-height: 80px;
}

.stb-enquiry-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}

.stb-enquiry-actions {
    margin-top: 4px;
}

.stb-enquiry-submit-btn {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 8px;
    background: #233d7b !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.stb-enquiry-submit-btn:hover:not(:disabled) {
    background: #1a2e5e !important;
    color: #fff !important;
}

.stb-enquiry-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Enquiry success icon */
.stb-popup-success-enquiry {
    background: #e0e7f5 !important;
    color: #233d7b !important;
}
