/* Test Ride Modal */
#testRideModal {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
}

#testRideModal.is-open {
    display: flex;
}

#testRideModal .tr-card {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 92vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: trModalIn 0.2s ease-out;
}

@keyframes trModalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#testRideModal .tr-scroll {
    overflow-y: auto;
    padding: 28px 32px 24px;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: #D1D5DB transparent;
}

/* WebKit / Chromium */
#testRideModal .tr-scroll::-webkit-scrollbar {
    width: 6px;
}

#testRideModal .tr-scroll::-webkit-scrollbar-track {
    background: transparent;
}

#testRideModal .tr-scroll::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

#testRideModal .tr-scroll::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

#testRideModal .tr-close {
    position: absolute;
    top: 20px;
    right: 22px;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    z-index: 2;
    border-radius: 4px;
}

#testRideModal .tr-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

#testRideModal .tr-step-label {
    color: #B68A00;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0 0 10px;
}

#testRideModal .tr-title {
    color: #082E42;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 8px;
}

#testRideModal .tr-subtitle {
    color: #6b7280;
    font-size: 15px;
    margin: 0 0 22px;
}

#testRideModal .tr-subtitle strong {
    color: #082E42;
    font-weight: 700;
}

#testRideModal .tr-screen {
    display: none;
}

#testRideModal .tr-screen.is-active {
    display: block;
}

/* Bike grid */
#testRideModal .tr-bike-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

#testRideModal .tr-bike-card {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px 10px 14px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

#testRideModal .tr-bike-card:hover {
    border-color: #c9b27a;
}

#testRideModal .tr-bike-card.is-selected {
    border-color: #B68A00;
    background: #FDF9F0;
}

#testRideModal .tr-bike-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #B68A00;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
}

#testRideModal .tr-bike-card.is-selected .tr-bike-check {
    display: flex;
}

#testRideModal .tr-bike-img {
    display: block;
    width: 100%;
    max-width: 140px;
    height: 90px;
    object-fit: contain;
    margin: 0 auto 8px;
}

#testRideModal .tr-bike-name {
    color: #082E42;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
}

#testRideModal .tr-bike-sizes {
    color: #6b7280;
    font-size: 13px;
    margin: 0;
}

#testRideModal .tr-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 22px 0;
}

/* Size selection */
#testRideModal .tr-size-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

#testRideModal .tr-size-head-text {
    color: #082E42;
    font-size: 17px;
    font-weight: 700;
}

#testRideModal .tr-size-fit-link {
    color: #082E42;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
}

#testRideModal .tr-size-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

#testRideModal .tr-size-btn {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 14px 10px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

#testRideModal .tr-size-btn:hover {
    border-color: #082E42;
}

#testRideModal .tr-size-btn.is-selected {
    border-color: #082E42;
    background: #F4F7FA;
}

#testRideModal .tr-size-btn-label {
    display: block;
    color: #082E42;
    font-size: 16px;
    font-weight: 700;
}

#testRideModal .tr-size-btn-height {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-top: 3px;
}

/* Sticky bottom CTA area */
#testRideModal .tr-footer-cta {
    padding: 16px 32px 20px;
    border-top: 1px solid #f3f4f6;
    background: #fff;
}

#testRideModal .tr-gold-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    background: #B68A00;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

#testRideModal .tr-gold-btn:hover:not(:disabled) {
    background: #d39f02;
}

#testRideModal .tr-gold-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Summary box */
#testRideModal .tr-summary {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 22px;
}

#testRideModal .tr-summary-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #F8F9FB;
}

#testRideModal .tr-summary-row+.tr-summary-row {
    border-top: 1px solid #e9edf1;
}

#testRideModal .tr-summary-icon {
    color: #082E42;
    flex-shrink: 0;
}

#testRideModal .tr-summary-text {
    flex: 1;
    color: #082E42;
    font-size: 16px;
    font-weight: 600;
}

#testRideModal .tr-summary-sub {
    color: #6b7280;
    font-size: 14px;
    font-weight: 400;
    margin-top: 2px;
}

#testRideModal .tr-change-link {
    color: #082E42;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
}

/* Date strip */
#testRideModal .tr-date-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

#testRideModal .tr-section-label {
    color: #082E42;
    font-size: 17px;
    font-weight: 700;
}

#testRideModal .tr-month-label {
    color: #6b7280;
    font-size: 14px;
}

#testRideModal .tr-month-nav {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-left: 10px;
}

#testRideModal .tr-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: #fff;
    color: #082E42;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#testRideModal .tr-nav-btn:hover:not(:disabled) {
    border-color: #082E42;
}

#testRideModal .tr-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#testRideModal .tr-date-strip {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

#testRideModal .tr-date-cell {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 10px 4px;
    text-align: center;
    cursor: pointer;
    min-width: 0;
}

#testRideModal .tr-date-cell:hover:not(:disabled) {
    border-color: #082E42;
}

#testRideModal .tr-date-cell.is-selected {
    background: #082E42;
    border-color: #082E42;
}

#testRideModal .tr-date-cell.is-selected .tr-d-weekday,
#testRideModal .tr-date-cell.is-selected .tr-d-num,
#testRideModal .tr-date-cell.is-selected .tr-d-note {
    color: #fff;
}

#testRideModal .tr-date-cell:disabled {
    cursor: not-allowed;
    background: #fafafa;
}

#testRideModal .tr-date-cell:disabled .tr-d-weekday,
#testRideModal .tr-date-cell:disabled .tr-d-num {
    color: #c3c8cf;
}

#testRideModal .tr-date-cell:disabled .tr-d-note {
    color: #c3c8cf;
}

#testRideModal .tr-date-cell:disabled {
    border-style: dashed;
}

#testRideModal .tr-d-weekday {
    display: block;
    color: #4b5563;
    font-size: 13px;
}

#testRideModal .tr-d-num {
    display: block;
    color: #082E42;
    font-size: 20px;
    font-weight: 700;
    margin: 2px 0;
}

#testRideModal .tr-d-note {
    display: block;
    color: #6b7280;
    font-size: 11px;
}

/* Time grid */
#testRideModal .tr-time-meta {
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
}

#testRideModal .tr-time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

#testRideModal .tr-time-btn {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 12px 6px;
    color: #082E42;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

#testRideModal .tr-time-btn:hover:not(:disabled) {
    border-color: #082E42;
}

#testRideModal .tr-time-btn.is-selected {
    background: #082E42;
    border-color: #082E42;
    color: #fff;
}

#testRideModal .tr-time-btn:disabled {
    color: #c3c8cf;
    background: #fafafa;
    border-style: dashed;
    cursor: not-allowed;
    text-decoration: line-through;
    text-decoration-color: #c3c8cf;
    text-decoration-thickness: 1px;
}

/* Booking as */
#testRideModal .tr-booking-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

#testRideModal .tr-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #F5EBC9;
    color: #8a6d1f;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}

#testRideModal .tr-booking-info {
    flex: 1;
    min-width: 0;
}

#testRideModal .tr-booking-label {
    color: #6b7280;
    font-size: 13px;
}

#testRideModal .tr-booking-name {
    color: #082E42;
    font-size: 16px;
    font-weight: 700;
}

#testRideModal .tr-booking-contact {
    color: #6b7280;
    font-size: 13px;
    margin-top: 2px;
    word-break: break-all;
}

#testRideModal .tr-edit-fields {
    margin-top: 12px;
    display: none;
}

#testRideModal .tr-edit-fields.is-show {
    display: block;
}

#testRideModal .tr-edit-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

#testRideModal .tr-edit-input:focus {
    outline: none;
    border-color: #B68A00;
    box-shadow: 0 0 0 3px rgba(182, 138, 0, 0.15);
}

#testRideModal .tr-privacy-line {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    margin: 12px 0 0;
}

#testRideModal .tr-privacy-line a {
    color: #082E42;
    text-decoration: underline;
}

#testRideModal .tr-notnow {
    display: block;
    width: 100%;
    background: none;
    border-top: 1px solid #e5e7eb;
    color: #082E42;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    padding: 12px;
    margin-top: 4px;
}

#testRideModal .tr-notnow:hover {
    color: #B68A00;
}

/* Success screen */
#testRideModal .tr-success {
    text-align: center;
    padding: 12px 0 4px;
}

#testRideModal .tr-success-circle {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #F5EBC9;
    color: #B68A00;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

#testRideModal .tr-success-title {
    color: #082E42;
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 12px;
}

#testRideModal .tr-success-text {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto 22px;
}

#testRideModal .tr-success-summary {
    text-align: left;
    background: #F8F9FB;
    border-radius: 8px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
    margin-bottom: 24px;
}

#testRideModal .tr-ss-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

#testRideModal .tr-ss-value {
    color: #082E42;
    font-size: 15px;
    font-weight: 600;
}

#testRideModal .tr-success-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

#testRideModal .tr-outline-btn {
    padding: 14px;
    border: 1.5px solid #082E42;
    border-radius: 8px;
    background: #fff;
    color: #082E42;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

#testRideModal .tr-outline-btn:hover {
    background: #082E42;
    color: #fff;
}

#testRideModal .tr-loading-text {
    text-align: center;
    color: #6b7280;
    padding: 40px 0;
    font-size: 15px;
}

#testRideModal .tr-error-text {
    text-align: center;
    padding: 30px 0;
    font-size: 14px;
}

@media (max-width: 640px) {
    #testRideModal .tr-scroll {
        padding: 22px 18px 18px;
    }

    #testRideModal .tr-footer-cta {
        padding: 14px 18px 18px;
    }

    #testRideModal .tr-title,
    #testRideModal .tr-success-title {
        font-size: 24px;
    }

    #testRideModal .tr-time-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #testRideModal .tr-success-summary {
        grid-template-columns: 1fr;
    }
}