/* ========== QUOTE BUILDER STYLING ========== */

/* Quote banner section - minimal height */
.quote-banner-section {
    position: relative !important;
    padding: 80px 0 40px 0 !important;
    overflow: visible !important;
    margin-top: 100px !important;
    min-height: auto !important;
    height: auto !important;
    z-index: 0 !important; /* Override the global section z-index: -1 */
}

/* Override any global banner section styles specifically for quote page */
section.quote-banner-section.banner-section {
    padding: 80px 0 40px 0 !important;
    min-height: auto !important;
    height: auto !important;
}

.quote-banner-content {
    text-align: center;
    margin-bottom: 15px;
}

.quote-banner-content h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
    color: var(--black-color);
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.quote-banner-content p {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color-1);
    opacity: 1 !important;
    transform: translateX(0) !important;
    margin-bottom: 0;
}

/* Quote search form - exactly like homepage */
.quote-search-wrapper {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

/* Fix postcode text visibility and icon colors */
.quote-search-wrapper .search-bar-input input {
    color: #333 !important;
    padding-left: 70px !important;
    background-color: rgba(241, 90, 41, 0.05) !important;
    border: 1px solid rgba(241, 90, 41, 0.15) !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
}

.quote-search-wrapper .search-bar-input input:focus {
    background-color: rgba(241, 90, 41, 0.08) !important;
    border-color: rgba(241, 90, 41, 0.3) !important;
    box-shadow: 0 4px 12px rgba(241, 90, 41, 0.1) !important;
    outline: none !important;
}

.quote-search-wrapper .search-bar-input input::placeholder {
    color: #888 !important;
}

.quote-search-wrapper .search-bar-input {
    position: relative;
    width: 257px;
}

.quote-search-wrapper .search-bar-icon {
    position: absolute;
    top: 25px;
    left: 2px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: rgb(241, 90, 41) !important;
    background-color: var(--bg-1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quote-search-wrapper .header-search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(241, 90, 41) !important;
    cursor: pointer;
    z-index: 5;
}

.quote-search-wrapper .category-reset-btn {
    position: absolute;
    right: 45px;
    top: 65%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgb(241, 90, 41) !important;
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    transition: color 0.3s ease;
}

.quote-search-wrapper .category-reset-btn:hover {
    color: #dc3545 !important;
}

.quote-search-wrapper .banner-two-search {
    margin-top: 0;
    margin-bottom: 0;
}

.quote-search-wrapper .search-bar-container {
    width: 100%;
    margin-bottom: 0;
}

.quote-search-wrapper .search-box-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.quote-search-wrapper .search-box-single {
    flex: 1;
    min-width: 250px;
}

.quote-search-wrapper .search-box-single.search-box {
    flex: 1.5;
    min-width: 300px;
}

.quote-search-wrapper .search-bar-submit {
    flex: 0 0 auto;
}

.quote-search-wrapper .search-bar-submit .btn-1 {
    padding: 15px 30px;
    white-space: nowrap;
}

/* Service selection section - outside banner */
.service-selection-section {
    padding: 30px 0;
    background: #f8f9fa;
    display: none;
}

/* Force visibility when services are available */
.service-selection-section.show-services {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.service-selection-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.service-selection-box {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.service-selection-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.service-selection-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
}

.service-dropdown-wrapper {
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

.service-select {
    width: 100%;
    padding: 15px 45px 15px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    font-size: 16px;
    color: #333;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.service-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.service-dropdown-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
}

/* Quote steps section */
.quote-steps-section {
    padding: 40px 0;
    background: white;
    min-height: auto;
    display: none;
}

.quote-steps-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

.quote-step {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.quote-step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.step-header {
    text-align: center;
    margin-bottom: 40px;
}

.step-number {
    display: inline-block;
    background: #007bff;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    line-height: 40px;
    font-weight: 600;
    margin-bottom: 15px;
}

.step-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.step-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}

.step-content {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.question-group {
    margin-bottom: 25px;
}

.question-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.question-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.question-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.question-textarea {
    resize: vertical;
    min-height: 120px;
}

.question-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.option-button {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.option-button:hover {
    border-color: #007bff;
    color: #007bff;
}

.option-button.selected {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Step navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.nav-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn-secondary {
    background: #6c757d;
    color: white;
}

.nav-btn-secondary:hover {
    background: #5a6268;
}

.nav-btn-primary {
    background: #007bff;
    color: white;
}

.nav-btn-primary:hover {
    background: #0056b3;
}

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

/* Progress indicator */
.progress-indicator {
    text-align: center;
    margin-bottom: 30px;
}

.progress-bar {
    background: #e9ecef;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: #007bff;
    height: 100%;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: #666;
}



/* Better dropdown positioning for quote page */
.quote-search-wrapper .search-content-box {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 400px !important;
    max-width: 90vw !important;
    max-height: 80vh !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25) !important;
    z-index: 99999999 !important;
    overflow-y: auto !important;
}

/* Add backdrop */
.quote-search-wrapper .search-box.active::before {
    content: '';
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.4) !important;
    z-index: 9999999 !important;
    pointer-events: none !important;
}

/* Ensure popup appears at top level */
.quote-search-wrapper .search-content-box {
    z-index: 99999999 !important; /* High but not maximum, in case we need to go higher */
}

/* Ensure headers/navigation don't appear over popup when active */
body:has(.quote-search-wrapper .search-box.active) header,
body:has(.quote-search-wrapper .search-box.active) nav,
body:has(.quote-search-wrapper .search-box.active) .header,
body:has(.quote-search-wrapper .search-box.active) .navbar,
body:has(.quote-search-wrapper .search-box.active) h1,
body:has(.quote-search-wrapper .search-box.active) h2,
body:has(.quote-search-wrapper .search-box.active) h3 {
    z-index: 1000 !important;
}

/* Add extra height to page when popup is open */
body:has(.quote-search-wrapper .search-box.active) {
    min-height: 185vh !important; /* Original 100vh + 85vh extra */
    transition: min-height 0.3s ease !important;
}

/* Alternative: Add height to the quote section specifically */
body:has(.quote-search-wrapper .search-box.active) .quote-banner-section {
    min-height: 185vh !important;
    transition: min-height 0.3s ease !important;
}

/* Clean dropdown styling */
.quote-search-wrapper .search-options {
    padding: 20px !important;
    max-height: none !important;
}

.quote-search-wrapper .search-options li {
    color: #333 !important;
    padding: 12px 15px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    border-radius: 6px !important;
    margin-bottom: 5px !important;
    transition: all 0.2s ease !important;
}

.quote-search-wrapper .search-options li:hover {
    background: #f8f9fa !important;
    color: #333 !important;
}

.quote-search-wrapper .search-options li h6 {
    color: #333 !important;
    font-size: 15px !important;
    margin-bottom: 3px !important;
}

.quote-search-wrapper .search-options li p {
    color: #666 !important;
    font-size: 13px !important;
    margin-bottom: 0 !important;
}

.quote-search-wrapper .search-options li .options-list-icon i {
    color: rgb(241, 90, 41) !important;
    font-size: 18px !important;
}

/* Responsive design */
@media (max-width: 767px) {
    .quote-banner-section {
        padding: 15px 0;
    }

    .quote-banner-content h1 {
        font-size: 24px;
        margin-bottom: 5px;
    }

    .quote-banner-content p {
        font-size: 12px;
    }

    .quote-search-wrapper {
        padding: 20px 15px;
        margin: 0 -15px;
        border-radius: 0;
    }

    .quote-search-wrapper .search-box-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .quote-search-wrapper .search-box-single,
    .quote-search-wrapper .search-box-single.search-box {
        min-width: auto;
        flex: none;
    }

    .service-selection-section {
        padding: 20px 0;
    }

    .service-selection-container {
        padding: 0 15px;
    }

    .service-selection-box {
        padding: 25px 15px;
        margin: 0 -15px;
        border-radius: 0;
    }

    .service-selection-title {
        font-size: 20px;
    }

    .quote-steps-section {
        padding: 30px 0;
    }

    .quote-steps-container {
        padding: 0 15px;
    }

    .step-content {
        padding: 20px 15px;
        margin: 0 -15px 20px -15px;
        border-radius: 0;
    }

    .step-title {
        font-size: 20px;
    }

    .question-options {
        flex-direction: column;
    }

    .option-button {
        text-align: center;
    }

    .step-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .nav-btn {
        width: 100%;
        order: 2;
    }

    .nav-btn-secondary {
        order: 1;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .quote-banner-section {
        padding: 18px 0;
    }

    .quote-banner-content h1 {
        font-size: 28px;
    }

    .quote-search-wrapper {
        padding: 25px 20px;
    }

    .quote-search-wrapper .search-box-single {
        min-width: 200px;
    }

    .quote-search-wrapper .search-box-single.search-box {
        min-width: 250px;
    }
}

/* ========== FORM VALIDATION ERROR STYLES ========== */

/* Error state for question groups */
.question-group.has-error {
    animation: shake 0.5s ease-in-out;
}

/* Red border for form inputs */
.question-input.is-invalid,
.question-textarea.is-invalid {
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Red border for question options */
.question-options.is-invalid {
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Red border for option buttons */
.option-button.is-invalid {
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Red border for checkbox containers */
.question-checkboxes.is-invalid {
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Error shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Focus states for invalid fields */
.question-input.is-invalid:focus,
.question-textarea.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5) !important;
}

/* Error state for question labels */
.has-error .question-label {
    color: #dc3545;
    font-weight: 600;
}

/* Clear error styles when user starts typing */
.question-input.is-invalid:focus,
.question-textarea.is-invalid:focus,
.option-button.is-invalid:hover,
.option-button.is-invalid:focus {
    animation: none;
}

/* ========== SERVICES DROPDOWN UPDATE FEEDBACK ========== */

/* Visual feedback when services dropdown is updated */
.service-dropdown-wrapper.updated-services {
    animation: pulse-highlight 2s ease-in-out;
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

.service-dropdown-wrapper.updated-services .service-select {
    border: 2px solid #198754 !important;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25) !important;
}

/* Pulse highlight animation */
@keyframes pulse-highlight {
    0% {
        background-color: transparent;
        transform: scale(1);
    }
    15% {
        background-color: rgba(25, 135, 84, 0.1);
        transform: scale(1.02);
    }
    30% {
        background-color: rgba(25, 135, 84, 0.05);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Loading state styling */
.service-dropdown-wrapper.loading-services {
    opacity: 0.7;
    pointer-events: none;
}

.service-dropdown-wrapper.loading-services .service-select {
    background-color: #f8f9fa;
    cursor: wait;
}

.service-dropdown-wrapper .service-select:disabled {
    background-color: #f8f9fa;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading spinner for service dropdown */
.service-dropdown-wrapper.loading-services::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 40px;
    width: 16px;
    height: 16px;
    border: 2px solid #dee2e6;
    border-top: 2px solid #007aff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* ========== BUSINESS SELECTION STYLING ========== */

.business-selection-section {
    padding: 50px 0;
    background-color: #f8f9fa;
}

.business-selection-content {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.business-selection-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.business-selection-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
}

.businesses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.business-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}

.business-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.business-card.selected {
    border-color: #007aff;
    background-color: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,122,255,0.15);
}

.business-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.business-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.business-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
}

.business-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rating-stars {
    color: #ffa500;
    font-size: 14px;
}

.rating-value {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.business-summary {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.business-details {
    font-size: 13px;
    color: #888;
    line-height: 1.3;
}

.business-distance {
    font-weight: 600;
    color: #007aff;
}

.business-select-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.business-card.selected .business-select-checkbox {
    background-color: #007aff;
    border-color: #007aff;
    color: white;
}

.business-select-checkbox::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.business-card.selected .business-select-checkbox::after {
    opacity: 1;
}

.business-selection-actions {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 500px;
    margin: 0 auto;
}

.selected-count {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.btn-contact-businesses {
    background-color: #007aff;
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-contact-businesses:hover {
    background-color: #0056cc;
    transform: translateY(-1px);
}

.btn-contact-businesses:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.no-businesses-found {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-businesses-found h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.no-businesses-found p {
    font-size: 16px;
    margin-bottom: 0;
}

/* Mobile responsive styles */
@media (max-width: 767px) {
    .business-selection-section {
        padding: 30px 0;
    }

    .business-selection-title {
        font-size: 24px;
    }

    .businesses-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 30px;
    }

    .business-card {
        padding: 20px;
    }

    .business-selection-actions {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .btn-contact-businesses {
        width: 100%;
    }
}

/* ========== SUCCESS MESSAGE STYLING ========== */

.contact-success-message {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.contact-success-message h3 {
    font-size: 28px;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 15px;
}

.contact-success-message p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.contacted-businesses {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.contacted-businesses h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.contacted-businesses ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contacted-businesses li {
    padding: 5px 0;
    color: #666;
    border-bottom: 1px solid #e9ecef;
}

.contacted-businesses li:last-child {
    border-bottom: none;
}

/* ========== SUBMIT BUTTON STYLING FIX ========== */

.submit-quote-btn {
    background-color: #007aff !important;
    color: white !important;
    border: none !important;
    padding: 15px 40px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 2 !important;
}

.submit-quote-btn:hover {
    background-color: #0056cc !important;
    color: white !important;
    transform: translateY(-1px) !important;
}

.submit-quote-btn:disabled {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.submit-quote-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3) !important;
}

/* Override any conflicting styles */
.btn.submit-quote-btn {
    background-color: #007aff !important;
    color: white !important;
}

.btn.submit-quote-btn:hover {
    background-color: #0056cc !important;
    color: white !important;
}

.btn.submit-quote-btn:after {
    display: none !important;
}

.btn-1.submit-quote-btn {
    background-color: #007aff !important;
    color: white !important;
}

.btn-1.submit-quote-btn:hover {
    background-color: #0056cc !important;
    color: white !important;
}

.btn-1.submit-quote-btn:after {
    display: none !important;
}
