/**
 * Checkout Configurator Styles
 * Styles for checkout section on index.html and checkout/custom-request pages
 */

/* ============================================
   CHECKOUT CONFIGURATOR SECTION (index.html)
   ============================================ */

#checkout .checkout-configurator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    #checkout .checkout-configurator-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Left Column: Configurator Fields - Uses existing form-group/form-row classes */
#checkout .checkout-configurator-fields {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Inherit form styles from existing styles.css - no additional styles needed */

/* Precision Filters Section */
#checkout .checkout-precision-filters-section {
    margin-bottom: 1.5rem;
}

#checkout .checkout-add-precision-filter-btn {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid #1a365d;
    border-radius: 8px;
    background: white;
    color: #1a365d;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

#checkout .checkout-add-precision-filter-btn:hover {
    background: #f8fafc;
    border-color: #1e40af;
    box-shadow: 0 2px 4px rgba(26, 54, 93, 0.1);
}

#checkout .checkout-selected-precision-filters {
    display: none;
}

#checkout .checkout-precision-filter-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#checkout .checkout-precision-filter-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(26, 54, 93, 0.06);
    background: #f9fbfd;
}

#checkout .checkout-precision-filter-row label {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1e293b;
    letter-spacing: -0.01em;
    margin-bottom: 0.625rem;
}

/* Billing Cycle Pill Toggle */
#checkout .checkout-billing-cycle-wrapper {
    margin-top: 0;
}

#checkout .checkout-period-toggle-wrapper {
    display: flex;
    background: #f1f5f9;
    border-radius: 50px;
    padding: 0.5rem;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#checkout .checkout-period-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-family: inherit;
}

#checkout .checkout-period-btn[data-active="true"] {
    background: #1a365d;
    color: white;
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.3);
}

#checkout .checkout-period-btn:hover:not([data-active="true"]) {
    background: rgba(26, 54, 93, 0.05);
}

/* Advanced Filters */
#checkout .checkout-advanced-filters-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

#checkout .checkout-add-filters-btn {
    background: transparent;
    border: 1.5px solid #1a365d;
    color: #1a365d;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

#checkout .checkout-add-filters-btn:hover {
    background: #1a365d;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

#checkout .checkout-advanced-filters {
    display: none;
    margin-top: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 10px;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

#checkout .checkout-advanced-filter-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

#checkout .checkout-advanced-filter-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#checkout .checkout-filter-enable {
    margin-top: 0.125rem;
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

#checkout .checkout-advanced-filter-item > label {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    line-height: 1.5;
}

#checkout .checkout-filter-input-wrapper {
    flex: 1;
    margin-top: 0.5rem;
}

#checkout .checkout-filter-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-family: var(--font-primary);
    background: #ffffff;
    color: #1e293b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#checkout .checkout-filter-input:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

#checkout .checkout-filter-input:not(:disabled):hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

#checkout .checkout-filter-input:not(:disabled):focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1), 0 2px 4px rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

/* Select dropdown styling to match "Find lead" filters */
#checkout .checkout-filter-input[type="select"],
#checkout select.checkout-filter-input {
    appearance: none;
    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='%2364758b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Brand native checkboxes/radios */
#checkout input[type="checkbox"],
#checkout input[type="radio"] {
    accent-color: #1a365d;
}

/* Dual-range slider (min/max) for Exclusive filters */
#checkout .checkout-dual-range-wrapper {
    position: relative;
    height: 34px;
    margin-top: 0.25rem;
}

#checkout .checkout-dual-range-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    pointer-events: none;
    z-index: 1;
}

#checkout .checkout-dual-range-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    background: #1a365d;
    border-radius: 999px;
    left: 0%;
    right: 0%;
    pointer-events: none;
    z-index: 2;
}

#checkout input.checkout-dual-range {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 34px;
    margin: 0;
    background: transparent;
    pointer-events: none; /* enable per-thumb with separate classes below */
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    touch-action: none;
    z-index: 3;
}

#checkout input.checkout-dual-range.checkout-dual-range-min,
#checkout input.checkout-dual-range.checkout-dual-range-max {
    pointer-events: auto;
}

#checkout input.checkout-dual-range.checkout-dual-range-min { z-index: 3; }
#checkout input.checkout-dual-range.checkout-dual-range-max { z-index: 4; }

#checkout input.checkout-dual-range::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
}

#checkout input.checkout-dual-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #1a365d;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    margin-top: -6px;
}

#checkout input.checkout-dual-range::-moz-range-track {
    height: 6px;
    background: transparent;
}

#checkout input.checkout-dual-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #1a365d;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#checkout .checkout-filter-multiselect {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 0.5rem;
}

#checkout .checkout-filter-multiselect input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

#checkout .checkout-filter-multiselect label {
    font-size: 0.875rem;
    font-weight: 400;
    color: #475569;
    cursor: pointer;
}

/* Right Column: Plan Recommendation */
#checkout .checkout-plan-recommendation {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    max-height: calc(100vh - 120px);
    overflow: visible;
}

#checkout .checkout-plan-recommendation h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
}

#checkout .checkout-plan-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex: 1;
    min-height: 0;
}

#checkout .checkout-plan-option {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    position: relative;
    /* Ensure card is clickable - no pointer-events blocking */
    pointer-events: auto;
    /* Ensure z-index doesn't block clicks */
    z-index: 1;
}

/* Ensure all child elements don't block clicks on the card itself */
#checkout .checkout-plan-option > * {
    pointer-events: none;
}

/* But allow clicks on interactive elements */
#checkout .checkout-plan-option input,
#checkout .checkout-plan-option button {
    pointer-events: auto;
}

#checkout .checkout-plan-option:hover:not(.unavailable):not(.selected) {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#checkout .checkout-plan-option.selected {
    border-color: #1a365d;
    background: #f0f9ff;
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.15);
}

#checkout .checkout-plan-option.unavailable {
    opacity: 0.65;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #e2e8f0;
    /* Disable clicks on unavailable plans */
    pointer-events: none;
}

/* Ensure available plans are always clickable */
#checkout .checkout-plan-option:not(.unavailable) {
    pointer-events: auto;
    cursor: pointer;
}

/* Screen reader only */
#checkout .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

#checkout .checkout-plan-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#checkout .checkout-plan-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: capitalize;
    letter-spacing: -0.01em;
    flex: 1;
}

#checkout .checkout-plan-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

#checkout .checkout-plan-price {
    font-size: 1rem;
    font-weight: 700;
    color: #1a365d;
    white-space: nowrap;
    line-height: 1.2;
}

#checkout .checkout-plan-discount {
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    white-space: nowrap;
    display: none;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#checkout .checkout-plan-unit-price {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
    display: none;
    line-height: 1.3;
}

#checkout .checkout-plan-filter-info {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
    line-height: 1.4;
}

#checkout .checkout-plan-reason {
    font-size: 0.8125rem;
    color: #ea580c;
    margin-top: 0.25rem;
    display: none;
    line-height: 1.4;
}

#checkout .checkout-plan-option.unavailable .checkout-plan-price-wrapper,
#checkout .checkout-plan-option.unavailable .checkout-plan-unit-price {
    display: none;
}

/* Filter slots info */
#checkout .checkout-filter-slots-info {
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: 8px;
    line-height: 1.4;
    display: none;
}

#checkout .checkout-filter-slots-info.has-content {
    display: block;
}

/* Sticky CTA wrapper */
#checkout .checkout-cta-wrapper {
    position: sticky;
    bottom: 0;
    background: #f8fafc;
    padding-top: 0.75rem;
    margin-top: auto;
    z-index: 10;
}

#checkout .checkout-plan-reason {
    font-size: 0.8125rem;
    color: #dc2626;
    margin-top: 0.25rem;
    display: none;
    line-height: 1.4;
}

#checkout .checkout-plan-option.unavailable .checkout-plan-reason {
    display: block;
}

#checkout .checkout-cta-button {
    width: 100%;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
    font-family: inherit;
    white-space: nowrap;
    min-width: 180px;
    text-align: center;
}

#checkout .checkout-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

#checkout .checkout-cta-button:active {
    transform: translateY(0);
}

/* ============================================
   CHECKOUT PAGE (checkout.html)
   ============================================ */

.checkout-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.checkout-steps {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.checkout-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.checkout-step.active {
    color: #1a365d;
    font-weight: 600;
}

.checkout-step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.checkout-step.active .checkout-step-number {
    background: #1a365d;
    color: white;
}

.checkout-step.completed .checkout-step-number {
    background: #22c55e;
    color: white;
}

.checkout-step-content {
    display: none;
}

.checkout-step-content.active {
    display: block;
}

.checkout-order-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.checkout-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.checkout-summary-item:last-child {
    border-bottom: none;
}

.checkout-summary-label {
    font-weight: 600;
    color: #374151;
}

.checkout-summary-value {
    color: #6b7280;
}

.checkout-summary-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #1a365d;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
}

.checkout-contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.checkout-contact-form .form-group-full {
    grid-column: 1 / -1;
}

.checkout-payment-placeholder {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    color: #6b7280;
}

.checkout-payment-placeholder h3 {
    margin-bottom: 1rem;
    color: #374151;
}

.checkout-payment-placeholder p {
    margin-bottom: 1.5rem;
}

.checkout-pay-button {
    padding: 1rem 2rem;
    background: #1a365d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.checkout-pay-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(26, 54, 93, 0.2);
}

.checkout-pay-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

/* ============================================
   CUSTOM REQUEST PAGE (custom-request.html)
   ============================================ */

.custom-request-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.custom-request-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .custom-request-options {
        grid-template-columns: 1fr;
    }
}

.custom-request-option {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.custom-request-option:hover {
    border-color: #1a365d;
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.1);
}

.custom-request-option.selected {
    border-color: #1a365d;
    background: #f0f9ff;
}

.custom-request-option h3 {
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.custom-request-option p {
    color: #6b7280;
    font-size: 0.875rem;
}

.custom-request-form {
    display: none;
}

.custom-request-form.active {
    display: block;
}

.custom-request-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.custom-request-time-slot {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-request-time-slot:hover {
    border-color: #1a365d;
}

.custom-request-time-slot input[type="checkbox"] {
    margin-right: 0.5rem;
}
