/**
 * Car Detailing Booking - Public Styles
 */

/* Reset & Base */
.cdb-booking-app *,
.cdb-dashboard * {
    box-sizing: border-box;
}

/* Progress Steps */
.cdb-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 20px;
}

.cdb-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.cdb-progress-step::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
}

.cdb-progress-step:last-child::after {
    display: none;
}

.cdb-progress-step.active::after,
.cdb-progress-step.completed::after {
    background: #2196F3;
}

.cdb-step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.cdb-progress-step.active .cdb-step-number,
.cdb-progress-step.completed .cdb-step-number {
    background: #2196F3;
    color: #fff;
}

.cdb-step-label {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.cdb-progress-step.active .cdb-step-label {
    color: #2196F3;
    font-weight: 500;
}

/* Running Total */
.cdb-running-total {
    background: #f5f5f5;
    padding: 10px 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 5px;
}

/* Steps */
.cdb-step {
    padding: 20px;
}

.cdb-step h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* Form Elements */
.cdb-form-group {
    margin-bottom: 15px;
}

.cdb-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.cdb-form-group input,
.cdb-form-group select,
.cdb-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.cdb-form-group input:focus,
.cdb-form-group select:focus,
.cdb-form-group textarea:focus {
    outline: none;
    border-color: #2196F3;
}

.cdb-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.cdb-form-row {
    display: flex;
    gap: 15px;
}

.cdb-form-row-2 .cdb-form-group {
    flex: 1;
}

.cdb-form-row-3 .cdb-form-group {
    flex: 1;
}

/* Buttons */
.cdb-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.cdb-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cdb-btn-primary {
    background: #2196F3;
    color: #fff;
}

.cdb-btn-primary:hover:not(:disabled) {
    background: #1976D2;
}

.cdb-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.cdb-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.cdb-btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #333;
}

.cdb-btn-outline:hover:not(:disabled) {
    background: #f5f5f5;
}

.cdb-btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.cdb-btn-add {
    width: 100%;
    margin-top: 10px;
}

.cdb-btn-pay {
    width: 100%;
    padding: 15px;
    font-size: 18px;
}

/* Actions */
.cdb-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Vehicle Cards */
.cdb-vehicle-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.cdb-vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cdb-vehicle-header h3 {
    margin: 0;
}

.cdb-btn-remove {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.cdb-btn-remove:hover {
    color: #f44336;
}

/* Services Grid */
.cdb-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.cdb-service-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.cdb-service-card:hover {
    border-color: #2196F3;
}

.cdb-service-card.selected {
    border-color: #2196F3;
    background: #e3f2fd;
}

.cdb-service-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.cdb-service-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.cdb-service-price {
    font-size: 18px;
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 5px;
}

.cdb-service-duration {
    font-size: 13px;
    color: #999;
}

/* Date Selection */
.cdb-available-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.cdb-date-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px 20px;
    cursor: pointer;
    text-align: center;
    min-width: 140px;
}

.cdb-date-card:hover {
    border-color: #2196F3;
}

.cdb-date-card.selected {
    border-color: #2196F3;
    background: #e3f2fd;
}

.cdb-date-day {
    display: block;
    font-weight: bold;
}

.cdb-date-full {
    display: block;
    font-size: 13px;
    color: #666;
}

/* Time Windows */
.cdb-time-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cdb-time-btn {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px 25px;
    cursor: pointer;
    text-align: center;
}

.cdb-time-btn:hover:not(:disabled) {
    border-color: #2196F3;
}

.cdb-time-btn.selected {
    border-color: #2196F3;
    background: #e3f2fd;
}

.cdb-time-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cdb-time-btn small {
    display: block;
    color: #666;
    font-size: 12px;
}

.cdb-unavailable {
    display: block;
    color: #f44336;
    font-size: 11px;
    margin-top: 5px;
}

/* Order Summary */
.cdb-order-summary {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.cdb-order-summary h3 {
    margin-top: 0;
}

.cdb-summary-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cdb-summary-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.cdb-summary-vehicle {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.cdb-summary-totals {
    margin-top: 15px;
}

.cdb-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.cdb-summary-row.cdb-balance {
    border-top: 1px solid #ddd;
    margin-top: 10px;
    padding-top: 10px;
}

/* Cancellation Policy */
.cdb-cancellation-policy {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.cdb-cancellation-policy h4 {
    margin: 0 0 10px 0;
    color: #e65100;
}

.cdb-cancellation-policy p {
    margin: 0;
    font-size: 14px;
}

/* Payment Form */
.cdb-payment-form {
    margin-bottom: 20px;
}

#card-element {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

/* Messages */
.cdb-error {
    color: #f44336;
    background: #ffebee;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.cdb-success {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.cdb-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Confirmation */
.cdb-confirmation {
    text-align: center;
    padding: 40px 20px;
}

.cdb-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #4CAF50;
    color: #fff;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.cdb-confirmation-details {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Out of Area */
.cdb-out-of-area {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.cdb-out-of-area h3 {
    margin-top: 0;
    color: #e65100;
}

/* Dashboard */
.cdb-dashboard {
    max-width: 1000px;
    margin: 0 auto;
}

.cdb-dashboard-nav {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.cdb-dashboard-nav a {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.cdb-dashboard-nav a:hover {
    color: #333;
}

.cdb-dashboard-nav a.active {
    color: #2196F3;
    border-bottom-color: #2196F3;
}

/* Booking Cards */
.cdb-booking-cards {
    display: grid;
    gap: 20px;
}

.cdb-booking-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.cdb-booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.cdb-booking-ref {
    font-weight: bold;
}

.cdb-booking-vehicles ul {
    margin: 5px 0;
    padding-left: 20px;
}

.cdb-booking-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Status Badges */
.cdb-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.cdb-status-confirmed {
    background: #e3f2fd;
    color: #1565c0;
}

.cdb-status-in-progress {
    background: #fff3e0;
    color: #e65100;
}

.cdb-status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.cdb-status-cancelled {
    background: #f5f5f5;
    color: #616161;
}

/* Vehicle Cards (Dashboard) */
.cdb-vehicle-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.cdb-dashboard .cdb-vehicle-card {
    text-align: center;
}

.cdb-add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    border-style: dashed;
    cursor: pointer;
}

.cdb-add-icon {
    font-size: 40px;
    color: #999;
}

.cdb-add-card:hover {
    border-color: #2196F3;
    background: #f5f5f5;
}

/* Table */
.cdb-table {
    width: 100%;
    border-collapse: collapse;
}

.cdb-table th,
.cdb-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.cdb-table th {
    font-weight: 500;
    color: #666;
}

/* Alert */
.cdb-alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.cdb-alert-warning {
    background: #fff3e0;
    border: 1px solid #ffcc80;
}

/* Modal */
.cdb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.cdb-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.cdb-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.cdb-modal-close:hover {
    color: #333;
}

.cdb-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Login Form */
.cdb-login-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
}

.cdb-register-link {
    text-align: center;
    margin-top: 20px;
}

/* Tip Section */
.cdb-tip-section {
    margin-bottom: 20px;
}

.cdb-tip-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.cdb-tip-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.cdb-tip-btn.active {
    border-color: #2196F3;
    background: #e3f2fd;
}

.cdb-payment-total {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.cdb-payment-total .cdb-total {
    font-size: 18px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
}

/* No Items */
.cdb-no-items {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* ===== New 8-Step Booking Flow Styles ===== */

/* Progress Bar (8 steps — smaller numbers) */
.cdb-progress .cdb-step-number {
    width: 28px;
    height: 28px;
    font-size: 13px;
}

/* Running Total - Discount Badge */
.cdb-discount-badge {
    color: #2e7d32;
    font-size: 13px;
    margin-left: 8px;
}

/* Running Total Inline (add-ons step) */
.cdb-running-total-inline {
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 14px;
}

/* Button Large Variant */
.cdb-btn-lg {
    padding: 18px 32px;
    font-size: 18px;
}

/* Step 2: Water & Power */
.cdb-utility-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.cdb-utility-buttons .cdb-btn {
    flex: 1;
    text-align: center;
}

.cdb-info-message {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    line-height: 1.6;
}

.cdb-info-message p {
    margin: 0;
}

/* Step 3: Vehicle Size Cards */
.cdb-size-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.cdb-size-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.cdb-size-card:hover {
    border-color: #2196F3;
}

.cdb-size-card.selected {
    border-color: #2196F3;
    background: #e3f2fd;
}

.cdb-size-name {
    font-weight: 500;
    font-size: 14px;
}

/* Multi-Vehicle Discount Badge */
.cdb-multi-vehicle-discount {
    margin-top: 15px;
    text-align: center;
}

.cdb-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
}

/* Step 4: Per-Vehicle Services */
.cdb-per-vehicle-services {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.cdb-per-vehicle-services h4 {
    margin: 0 0 10px 0;
    color: #666;
}

.cdb-vehicle-service-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.cdb-vehicle-service-row span {
    min-width: 120px;
    font-weight: 500;
}

.cdb-vehicle-service-row select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Step 5: Add-ons */
.cdb-addon-vehicle-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cdb-addon-vehicle-section:last-child {
    border-bottom: none;
}

.cdb-addon-vehicle-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
}

.cdb-addons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.cdb-addon-btn {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cdb-addon-btn:hover {
    border-color: #2196F3;
}

.cdb-addon-btn.selected {
    border-color: #2196F3;
    background: #e3f2fd;
}

.cdb-addon-name {
    font-weight: 500;
    font-size: 14px;
}

.cdb-addon-price {
    color: #2196F3;
    font-weight: bold;
    font-size: 15px;
}

/* Step 6: Login Prompt */
.cdb-login-prompt {
    background: #f5f5f5;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.cdb-login-prompt a {
    color: #2196F3;
    font-weight: 500;
}

/* Step 7: No Dates / Time Windows */
.cdb-no-dates {
    text-align: center;
    padding: 30px;
    color: #666;
    background: #f5f5f5;
    border-radius: 8px;
}

.cdb-time-windows {
    margin-top: 20px;
}

.cdb-time-windows h3 {
    margin-bottom: 10px;
}

/* Step 7: No Payment Message */
.cdb-no-payment {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin-top: 15px;
}

/* Step 8: Confirmation Details */
.cdb-confirmation-details {
    max-width: 500px;
}

.cdb-confirmation-vehicles {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.cdb-confirmation-vehicle {
    padding: 5px 0;
}

.cdb-confirmation-payment {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

/* Responsive */
@media (max-width: 768px) {
    .cdb-progress {
        padding: 0;
    }

    .cdb-step-label {
        display: none;
    }

    .cdb-form-row {
        flex-direction: column;
    }

    .cdb-services-grid {
        grid-template-columns: 1fr;
    }

    .cdb-time-grid {
        flex-direction: column;
    }

    .cdb-time-btn {
        width: 100%;
    }

    .cdb-actions {
        flex-direction: column;
    }

    .cdb-dashboard-nav {
        flex-wrap: wrap;
    }

    .cdb-vehicle-cards {
        grid-template-columns: 1fr;
    }

    .cdb-table {
        font-size: 14px;
    }

    .cdb-utility-buttons {
        flex-direction: column;
    }

    .cdb-size-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .cdb-addons-grid {
        grid-template-columns: 1fr;
    }

    .cdb-vehicle-service-row {
        flex-direction: column;
        align-items: stretch;
    }

    .cdb-vehicle-service-row span {
        min-width: auto;
    }

    .cdb-progress .cdb-step-number {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}
