/**
 * Cleaning Services Booking - Frontend Styles
 * Version 2.0.0 - Square Footage Based Pricing
 */

/* Square Footage Selection Container */
.csb-sqft-selection {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Service Info Header */
.csb-service-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.csb-service-type-label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.csb-rate-info {
    font-size: 14px;
    color: #666;
}

/* Square Footage Input */
.csb-sqft-wrapper {
    margin-bottom: 20px;
}

.csb-residential-pricing-wrapper {
    margin-bottom: 12px;
}

.csb-residential-pricing-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.csb-residential-pricing-select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 10px 12px;
    background: #fff;
}

.csb-sqft-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.csb-sqft-input {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 280px;
}

.csb-sqft-field {
    flex: 1;
    height: 48px;
    padding: 0 15px;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    text-align: center;
    transition: border-color 0.2s ease;
}

.csb-sqft-field:focus {
    outline: none;
    border-color: #007cba;
}

.csb-sqft-unit {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.csb-sqft-help {
    margin-top: 8px;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* Discount Notices */
.csb-discount-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.csb-first-time-notice {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    color: #155724;
}

.csb-launch-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    color: #856404;
}

.csb-free-membership-notice {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #17a2b8;
    color: #0c5460;
}

.csb-notice-icon {
    font-size: 20px;
}

.csb-notice-text {
    flex: 1;
    font-weight: 500;
}

/* One-Time Options */
.csb-onetime-options {
    margin-bottom: 20px;
}

.csb-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.csb-toggle-label:hover {
    border-color: #007cba;
}

.csb-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Service Date Selection - Styled to match theme */
.csb-service-date-wrapper {
    margin-top: 20px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.csb-service-date-wrapper h4 {
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csb-service-date-wrapper h4::before {
    content: '📅';
    font-size: 20px;
}

.csb-date-fields {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.csb-date-field,
.csb-time-field {
    flex: 1;
    min-width: 200px;
}

.csb-date-field label,
.csb-time-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
    color: #34495e;
}

.csb-date-field label .required,
.csb-time-field label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.csb-date-input,
.csb-time-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.csb-date-input:hover,
.csb-time-select:hover {
    border-color: #007cba;
}

.csb-date-input:focus,
.csb-time-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.15);
}

/* Custom styling for date input */
.csb-date-input {
    color: #2c3e50;
    background: #fff !important;
    cursor: pointer;
}

.csb-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    opacity: 0.7;
    transition: background-color 0.2s ease;
}

.csb-date-input::-webkit-calendar-picker-indicator:hover {
    background-color: #007cba;
    filter: invert(1);
}

/* Custom styling for time select */
.csb-time-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.csb-date-note {
    margin: 18px 0 0;
    padding: 12px 15px;
    font-size: 13px;
    color: #5d6d7e;
    background: #e8f4f8;
    border-radius: 6px;
    border-left: 3px solid #007cba;
}

.csb-cancellation-policy-brief {
    margin-top: 15px;
    padding: 12px 15px;
    background: #fff8e1;
    border-radius: 6px;
    font-size: 13px;
    color: #6d5a00;
    border-left: 3px solid #ffc107;
}

.csb-cancellation-policy-brief strong {
    color: #5d4a00;
}

/* One-time only service notice */
.csb-onetime-only-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #e3f2fd;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #90caf9;
}

.csb-onetime-only-notice .csb-notice-icon {
    font-size: 18px;
}

.csb-onetime-only-notice .csb-notice-text {
    font-size: 14px;
    color: #1565c0;
    font-weight: 500;
}

/* Quote request form (quote-only services) */
.csb-quote-form-wrapper {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
}

.csb-quote-form-wrapper h3 {
    margin: 0 0 8px;
}

.csb-quote-form-intro {
    margin: 0 0 16px;
    color: #555;
}

.csb-quote-form .form-row {
    margin-bottom: 14px;
}

.csb-quote-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.csb-quote-form input[type="number"],
.csb-quote-form input[type="text"],
.csb-quote-form input[type="email"],
.csb-quote-form input[type="date"],
.csb-quote-form textarea {
    width: 100%;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 10px 12px;
    background: #fff !important;
    font-size: 14px;
}

.csb-quote-form input[type="date"] {
    cursor: pointer;
}

.csb-quote-form input:focus,
.csb-quote-form textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.csb-quote-form .required {
    color: #d63638;
}

.csb-quote-form .button.alt {
    min-height: 42px;
    padding: 0 18px;
}

/* Legacy Hours Selection Container (for backwards compatibility) */
.csb-hours-selection {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Hours Wrapper */
.csb-hours-wrapper {
    margin-bottom: 20px;
}

.csb-hours-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

/* Hours Input with +/- buttons */
.csb-hours-input {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 200px;
}

.csb-hours-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.csb-hours-btn:hover {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.csb-hours-btn:active {
    transform: scale(0.95);
}

.csb-hours-minus {
    border-radius: 4px 0 0 4px;
}

.csb-hours-plus {
    border-radius: 0 4px 4px 0;
}

.csb-hours-field {
    width: 60px;
    height: 44px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    background: #fff;
    -moz-appearance: textfield;
    appearance: textfield;
}

.csb-hours-field::-webkit-outer-spin-button,
.csb-hours-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Price Display */
.csb-price-wrapper {
    margin-bottom: 16px;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.single-product div.product .summary .csb-sqft-selection {
    margin-top: 14px;
}

.csb-calculated-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

.csb-price-label {
    font-weight: 600;
    color: #333;
}

.csb-price-value {
    font-size: 24px;
    font-weight: bold;
    color: #007cba;
}

.csb-discount-display {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    font-size: 14px;
    color: #666;
}

.csb-discount-label {
    color: #28a745;
    font-weight: 500;
}

.csb-original-price {
    text-decoration: line-through;
    color: #999;
    margin-left: 10px;
}

/* Recurring Options */
.csb-recurring-wrapper {
    margin-bottom: 20px;
}

.csb-recurring-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.csb-recurring-toggle:hover {
    border-color: #007cba;
}

.csb-recurring-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.csb-recurring-options {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #007cba;
    border-radius: 6px;
}

.csb-recurring-option {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.csb-recurring-option:last-child {
    margin-bottom: 0;
}

.csb-recurring-option:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.csb-recurring-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
}

.csb-recurring-option.selected {
    border-color: #007cba;
    background: #f0f8ff;
}

.csb-option-text {
    flex: 1;
    font-weight: 500;
}

.csb-option-discount {
    font-size: 12px;
    color: #28a745;
    font-weight: normal;
    margin-left: 8px;
}

.csb-option-price {
    font-weight: bold;
    color: #007cba;
}

/* Membership Notice */
.csb-membership-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff8e5 0%, #fff3cd 100%);
    border: 1px solid #ffc107;
    border-radius: 6px;
    margin-bottom: 20px;
}

.csb-membership-badge {
    background: #ffc107;
    color: #333;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.csb-membership-text {
    color: #856404;
    font-size: 14px;
}

/* Payment Notice */
.csb-payment-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    background: #f0f8ff;
    border: 1px solid #007cba;
    border-radius: 6px;
    margin-bottom: 20px;
}

.csb-notice-icon {
    font-size: 18px;
    color: #007cba;
}

.csb-notice-text {
    color: #0056b3;
    font-size: 13px;
    line-height: 1.5;
}

/* Starting Price Display */
.csb-price-display {
    display: block;
}

.csb-starting-price {
    font-size: 16px;
    color: #333;
}

.csb-price-note {
    font-size: 14px;
    color: #666;
}

/* Cart Item Recurring Badge */
.csb-recurring-badge {
    display: inline-block;
    background: #007cba;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

/* Subscription Period in Cart */
.subscription-period {
    font-size: 13px;
    color: #666;
    font-weight: normal;
}

/* Payment Breakdown Table */
.csb-payment-breakdown {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.csb-payment-breakdown h3 {
    margin: 0 0 15px;
    color: #333;
}

.csb-payment-table {
    width: 100%;
}

.csb-payment-table td {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.csb-payment-table tr:last-child td {
    border-bottom: none;
}

.csb-paid-badge {
    display: inline-block;
    background: #28a745;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}

.csb-pending-badge {
    display: inline-block;
    background: #ffc107;
    color: #333;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}

/* Thank You Page Notice */
.csb-thankyou-notice {
    margin: 20px 0;
}

/* Hide default quantity for cleaning services */
.csb-hours-selection ~ .quantity,
.csb-sqft-selection ~ .quantity {
    display: none !important;
}

/* Variable Products - hide selection until variation selected */
.csb-variable-product {
    display: none;
}

.csb-variable-product.variation-selected {
    display: block;
}

/* Subscription wrapper styles */
.csb-subscription-wrapper {
    margin-bottom: 20px;
}

.csb-subscription-label {
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 480px) {
    .csb-hours-selection {
        padding: 15px;
    }

    .csb-hours-input {
        max-width: 100%;
    }

    .csb-hours-btn {
        width: 50px;
        height: 50px;
    }

    .csb-hours-field {
        flex: 1;
        height: 50px;
    }

    .csb-calculated-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .csb-recurring-option {
        flex-wrap: wrap;
    }

    .csb-option-price {
        width: 100%;
        margin-top: 5px;
        padding-left: 30px;
    }
}

/* Ensure WooCommerce error notices are clearly styled as errors */
.woocommerce-error,
.wc-block-components-notice-banner.is-error {
    background-color: #f8d7da !important;
    border-color: #f5c2c7 !important;
    color: #842029 !important;
}

.woocommerce-error li,
.wc-block-components-notice-banner.is-error .wc-block-components-notice-banner__content {
    color: #842029 !important;
}

.woocommerce-error::before {
    color: #842029 !important;
}
