/* ==========================================================================
   WHEELCAREHUB - TRUSTYWHEELS REPLICA CAR INQUIRY MODAL (IMAGE 4)
   ========================================================================== */

/* Top Navigation Trigger Button (Disabled per user request) */
.wch-top-inquiry-btn,
.wch-header-inquiry-injected {
    display: none !important;
}

/* Floating Right Edge Badge (Desktop) */
.wch-floating-corner-btn {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: right bottom;
    background: #d16527;
    color: #ffffff;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 10px 18px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    z-index: 9998;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}
.wch-floating-corner-btn:hover {
    background: #e27535;
    padding-bottom: 22px;
}

/* Mobile Floating Action Pill (Bottom Right) */
.wch-mobile-floating-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 18px;
    background: linear-gradient(135deg, #d16527 0%, #e27535 100%);
    color: #ffffff !important;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 11px 18px;
    border-radius: 50px;
    cursor: pointer;
    z-index: 99998;
    box-shadow: 0 6px 20px rgba(209, 101, 39, 0.45);
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    user-select: none;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    text-decoration: none !important;
}
.wch-mobile-floating-btn:active {
    transform: scale(0.96);
}

@media (max-width: 768px) {
    .wch-mobile-floating-btn {
        display: inline-flex !important;
        bottom: 75px !important;
        right: 14px !important;
    }
    .wch-floating-corner-btn {
        display: none !important;
    }
}

/* Pulse Animation on Launcher Badges */
.btn-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: wchPulse 1.8s infinite;
}
@keyframes wchPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Modal Overlay */
.wch-tw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 16px;
    box-sizing: border-box;
}

.wch-tw-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Card - Exact White Card from Image 4 */
.wch-tw-card {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    max-height: 94vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.92) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-sizing: border-box;
}

.wch-tw-modal-overlay.active .wch-tw-card {
    transform: scale(1) translateY(0);
}

/* Card Header */
.wch-tw-header {
    padding: 20px 22px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f3f5;
}
.wch-tw-title {
    font-size: 21px;
    font-weight: 800;
    color: #111827;
    margin: 0;
    letter-spacing: -0.3px;
    font-family: inherit;
}
.wch-tw-close {
    background: #f3f4f6;
    border: none;
    color: #4b5563;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: all 0.2s ease;
}
.wch-tw-close:hover {
    background: #e5e7eb;
    color: #111827;
    transform: scale(1.05);
}

/* Form Container */
.wch-tw-form {
    padding: 18px 22px 22px;
}

/* Field Groups */
.wch-tw-field {
    margin-bottom: 14px;
}
.wch-tw-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 6px;
}

/* Phone Input Wrap */
.wch-tw-phone-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    height: 44px;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.wch-tw-phone-wrap:focus-within {
    border-color: #d16527;
    box-shadow: 0 0 0 3px rgba(209, 101, 39, 0.18);
}
.wch-tw-phone-prefix {
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    border-right: 1px solid #e5e7eb;
    background: #f9fafb;
    height: 100%;
    display: flex;
    align-items: center;
    user-select: none;
}
.wch-tw-phone-input {
    border: none !important;
    height: 100% !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #111827 !important;
    flex: 1;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Select Dropdown Wrappers */
.wch-tw-select-wrap {
    position: relative;
}
.wch-tw-select-wrap::after {
    content: "▼";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #6b7280;
    pointer-events: none;
}
.wch-tw-select {
    width: 100% !important;
    height: 44px !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    padding: 0 32px 0 12px !important;
    color: #111827 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    outline: none !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}
.wch-tw-select:focus {
    border-color: #d16527 !important;
    box-shadow: 0 0 0 3px rgba(209, 101, 39, 0.18) !important;
}

/* Brand Header & Grid (TrustyWheels Replica with Official Logos) */
.wch-tw-section-header,
.wch-tw-model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.wch-tw-badge {
    font-size: 11px;
    font-weight: 600;
    color: #d16527;
    background: rgba(209, 101, 39, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* 3-Column Scrollable Grid of Brand Cards with Official Logos */
.wch-tw-brands-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 125px;
    overflow-y: auto;
    padding: 2px;
    margin-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.wch-tw-brands-grid::-webkit-scrollbar {
    width: 4px;
}
.wch-tw-brands-grid::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

/* Single Brand Card */
.wch-tw-brand-card {
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 56px;
}
.wch-tw-brand-card:hover {
    border-color: #d16527;
    background: #fffaf5;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}
.wch-tw-brand-card.selected {
    border-color: #d16527 !important;
    background: #fff5ee !important;
    box-shadow: 0 3px 10px rgba(209, 101, 39, 0.22) !important;
}
.wch-tw-brand-card.selected::before {
    content: "✓";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 14px;
    height: 14px;
    background: #d16527;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.wch-tw-brand-logo-wrap {
    width: 100%;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}
.wch-tw-brand-logo {
    max-width: 52px;
    max-height: 26px;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}
.wch-tw-brand-card:hover .wch-tw-brand-logo {
    transform: scale(1.06);
}
.wch-tw-brand-name {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.wch-tw-brand-card.selected .wch-tw-brand-name {
    color: #d16527;
}

/* 3-Column Scrollable Grid of Car Cards (Real Photo Cutouts) */
.wch-tw-models-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 165px;
    overflow-y: auto;
    padding: 2px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.wch-tw-models-grid::-webkit-scrollbar {
    width: 4px;
}
.wch-tw-models-grid::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

/* Single Car Card with Real Photo */
.wch-tw-car-card {
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 4px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 68px;
}
.wch-tw-car-card:hover {
    border-color: #d16527;
    background: #fffaf5;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}
.wch-tw-car-card.selected {
    border-color: #d16527 !important;
    background: #fff5ee !important;
    box-shadow: 0 4px 12px rgba(209, 101, 39, 0.22) !important;
}

/* Selected Checkmark Badge */
.wch-tw-car-card.selected::before {
    content: "✓";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 14px;
    height: 14px;
    background: #d16527;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Car Thumbnail (Photo) */
.wch-tw-car-thumb {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}
.wch-tw-car-photo {
    max-width: 82px;
    max-height: 36px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.12));
    transition: transform 0.2s ease;
}
.wch-tw-car-card:hover .wch-tw-car-photo {
    transform: scale(1.06);
}

/* Car Model Name */
.wch-tw-car-name {
    font-size: 11px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.25;
    padding: 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.wch-tw-car-card.selected .wch-tw-car-name {
    color: #d16527;
}

/* Action Button */
.wch-tw-action {
    margin-top: 16px;
}
.wch-tw-submit-btn {
    width: 100% !important;
    height: 48px !important;
    background: linear-gradient(135deg, #d16527 0%, #e27535 100%) !important;
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(209, 101, 39, 0.35) !important;
    transition: all 0.25s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}
.wch-tw-submit-btn:hover {
    background: linear-gradient(135deg, #e27535 0%, #f08343 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(209, 101, 39, 0.5) !important;
}
.wch-tw-submit-btn:active {
    transform: translateY(1px) !important;
}

/* Footer Guarantee Note */
.wch-tw-footer-note {
    text-align: center;
    margin-top: 10px;
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
}

/* Responsive Overrides for Mobile */
@media (max-width: 768px) {
    .wch-tw-modal-overlay {
        padding: 8px;
        align-items: flex-end; /* Clean bottom sheet experience on phones */
    }
    .wch-tw-card {
        max-width: 100% !important;
        border-radius: 16px 16px 8px 8px !important;
        max-height: 90vh !important;
    }
    .wch-tw-header {
        padding: 14px 16px 10px !important;
    }
    .wch-tw-title {
        font-size: 18px !important;
    }
    .wch-tw-form {
        padding: 12px 14px 16px !important;
    }
    .wch-tw-field {
        margin-bottom: 10px !important;
    }
    .wch-tw-brands-grid {
        max-height: 110px !important;
        gap: 6px !important;
    }
    .wch-tw-brand-card {
        min-height: 50px !important;
        padding: 4px 2px !important;
    }
    .wch-tw-brand-logo-wrap {
        height: 24px !important;
    }
    .wch-tw-brand-logo {
        max-width: 44px !important;
        max-height: 22px !important;
    }
    .wch-tw-brand-name {
        font-size: 10px !important;
    }
    .wch-tw-models-grid {
        max-height: 150px !important;
        gap: 6px !important;
    }
    .wch-tw-car-card {
        min-height: 62px !important;
        padding: 4px 2px 5px !important;
    }
    .wch-tw-car-thumb {
        height: 34px !important;
    }
    .wch-tw-car-photo {
        max-width: 72px !important;
        max-height: 32px !important;
    }
    .wch-tw-car-name {
        font-size: 10.5px !important;
    }
    .wch-tw-phone-wrap, .wch-tw-select {
        height: 40px !important;
    }
    .wch-tw-submit-btn {
        height: 44px !important;
        font-size: 13.5px !important;
    }
}
@media (max-width: 380px) {
    .wch-tw-brands-grid,
    .wch-tw-models-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
