/* AutoParts 24 Suite - Premium Enterprise Design */

:root {
    --ap24-primary: #0f172a;
    /* Slate 900 */
    --ap24-primary-hover: #1e293b;
    /* Slate 800 */
    --ap24-accent: #2563eb;
    /* Blue 600 */
    --ap24-accent-hover: #1d4ed8;
    /* Blue 700 */
    --ap24-bg: #ffffff;
    --ap24-bg-alt: #f8fafc;
    /* Slate 50 */
    --ap24-border: #e2e8f0;
    /* Slate 200 */
    --ap24-text: #334155;
    /* Slate 700 */
    --ap24-text-light: #64748b;
    /* Slate 500 */
    --ap24-danger: #ef4444;
    /* Red 500 */
    --ap24-radius: 8px;
    --ap24-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ap24-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.ap24-finder {
    background: var(--ap24-bg);
    border: 1px solid var(--ap24-border);
    border-radius: var(--ap24-radius);
    box-shadow: var(--ap24-shadow);
    font-family: inherit;
    color: var(--ap24-text);
    /* overflow: hidden; Removed to prevent cutting off content */
    margin-bottom: 2rem;
}

/* ... (skipping unchanged lines) ... */

.ap24-finder__panel.is-active {
    display: block !important;
    min-height: 50px;
    /* Force height */
    opacity: 1 !important;
    visibility: visible !important;
}

/* Horizontal Layout for Tab 1 */
.ap24-finder__row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

.ap24-finder__col {
    flex: 1;
    min-width: 300px;
}

.ap24-finder__col--manual {
    flex: 1.5;
    /* Give manual section more space */
}

.ap24-finder__heading {
    font-size: 15px;
    font-weight: 500;
    color: var(--ap24-text);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ap24-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--ap24-primary);
    color: var(--ap24-primary);
    border-radius: 50%;
    font-size: 12px;
    cursor: help;
}

/* --- VIN Search --- */
.ap24-finder__vin-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ap24-finder__field--vin {
    flex: 1;
}

.ap24-finder__input-wrapper {
    position: relative;
    width: 100%;
}

.ap24-finder__input--vin {
    padding-right: 40px !important;
    /* Space for clear button */
}

.ap24-finder__clear-vin {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ap24-finder__clear-vin:hover {
    background-color: #f1f5f9;
    color: #ef4444;
}

/* Ensure all search buttons have consistent size and icon centering */
.ap24-finder__button--search,
.ap24-finder__button--vin {
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 48px !important;
    background-color: var(--ap24-accent) !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

.ap24-finder__button--search:hover,
.ap24-finder__button--vin:hover {
    background-color: var(--ap24-accent-hover) !important;
}

/* Manual Search Grid */
.ap24-finder__grid-manual {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ap24-finder__step {
    position: relative;
    flex: 1;
    min-width: 0;
}

/* Main Container Padding */
.ap24-finder {
    padding: 15px;
}

/* Step Badge Base */
.ap24-finder__step-badge {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    z-index: 2;
    pointer-events: none;
    transition: all 0.2s ease;
}

/* Active State (Orange) - Used for Step 1 and enabled steps */
.ap24-finder__step.is-active .ap24-finder__step-badge {
    background-color: var(--ap24-accent);
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Inactive State (Grey) - Used for disabled steps */
.ap24-finder__step:not(.is-active) .ap24-finder__step-badge {
    background-color: #f1f5f9;
    color: #94a3b8;
}

/* Hide the arrow from legacy design if present */
.ap24-finder__step-arrow {
    display: none;
}

.ap24-finder__step select {
    padding-left: 60px !important;
    /* Increased to 60px to prevent overlap */
    height: 48px !important;
    /* Match input height */
    width: 100%;
    text-overflow: ellipsis;
}

/* KBA Search Grid */
.ap24-finder__grid-kba {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.ap24-finder__kba-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ap24-finder__kba-field input {
    height: 40px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 0 10px !important;
    width: 100%;
}

.ap24-finder__sublabel {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    text-transform: uppercase;
}

/* Buttons */
.ap24-btn-search {
    height: 40px !important;
    padding: 0 20px !important;
    background-color: var(--ap24-accent) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    cursor: pointer;
    white-space: nowrap;
}

.ap24-btn-search:hover {
    background-color: var(--ap24-accent-hover) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .ap24-finder__row {
        flex-direction: column;
        gap: 20px;
    }

    .ap24-finder__grid-manual {
        flex-direction: column;
        align-items: stretch;
    }

    .ap24-finder__grid-kba {
        flex-wrap: wrap;
    }

    .ap24-finder__kba-field {
        min-width: 100px;
    }
}

.ap24-finder__vin-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* --- Form Elements --- */
.ap24-finder__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.ap24-finder__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ap24-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Inputs & Selects - Force Styles */
/* Inputs & Selects - Force Styles */
.ap24-finder input[type="text"] {
    width: 100% !important;
    height: 48px !important;
    padding: 0 16px !important;
    border: 1px solid var(--ap24-border) !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    background-color: #fff !important;
    color: var(--ap24-primary) !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.ap24-finder select,
.ap24-finder .ap24-finder__select {
    width: 100% !important;
    height: 48px !important;
    padding: 0 16px 0 45px !important;
    /* Force 45px left padding */
    text-indent: 1px;
    /* Force text shift */
    border: 1px solid var(--ap24-border) !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    background-color: #fff !important;
    color: var(--ap24-primary) !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.ap24-finder input[type="text"]:focus,
.ap24-finder select:focus {
    border-color: var(--ap24-accent) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    outline: none !important;
}

.ap24-finder input[type="text"]::placeholder {
    color: #94a3b8;
}

/* Select Wrapper for custom arrow */
.ap24-select-wrapper {
    position: relative;
    width: 100%;
}

.ap24-select-wrapper::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background-color: var(--ap24-text-light);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    pointer-events: none;
}

/* --- Buttons --- */
.ap24-finder .button {
    height: 48px !important;
    padding: 0 24px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid transparent !important;
    text-shadow: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.ap24-finder .button-primary {
    background: var(--ap24-accent) !important;
    color: #fff !important;
    border-color: var(--ap24-accent) !important;
}

.ap24-finder .button-primary:hover {
    background: var(--ap24-accent-hover) !important;
    border-color: var(--ap24-accent-hover) !important;
    transform: translateY(-1px);
}

.ap24-finder .ap24-btn-reset {
    background: #fff !important;
    color: var(--ap24-text-light) !important;
    border-color: var(--ap24-border) !important;
}

.ap24-finder .ap24-btn-reset:hover {
    background: var(--ap24-bg-alt) !important;
    color: var(--ap24-danger) !important;
    border-color: var(--ap24-border) !important;
}

.ap24-finder__actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.ap24-finder__actions--inline {
    margin-top: 0;
    align-self: flex-end;
}

/* --- VIN Specifics --- */
.ap24-finder__field--vin-input {
    flex: 1;
}

/* Manual Search Grid - Desktop Row Layout */
.ap24-finder__grid-3 {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.ap24-finder__step {
    flex: 1;
    min-width: 0;
    /* Prevent flex items from overflowing */
}

/* Ensure the search button doesn't stretch weirdly */
.ap24-finder__action {
    flex: 0 0 auto;
}

/* Increase padding to ensure text is not covered by badge */
/* Removed redundant rule - handled in main select block above */

/* --- Responsive --- */
@media (max-width: 768px) {
    .ap24-finder__grid-3 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ap24-finder__grid-kba {
        flex-direction: column;
        align-items: stretch;
    }

    .ap24-finder__vin-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .ap24-finder__actions--inline {
        margin-top: 12px;
    }

    .ap24-finder__tabs {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .ap24-finder__tab {
        white-space: nowrap;
    }
}

.ap24-finder__tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 10px;
}

.ap24-finder__tab {
    border: 1px solid transparent;
    background: transparent;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -1px;
}

.ap24-finder__tab:hover {
    color: #333;
    background: #f8f9fa;
}

.ap24-finder__tab.is-active {
    background: var(--ap24-accent);
    border: 1px solid var(--ap24-accent);
    border-bottom-color: var(--ap24-accent);
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.ap24-finder__tab-icon {
    display: flex;
    align-items: center;
}

.ap24-finder__panel {
    display: none;
    padding-top: 8px;
    /* Added separation */
}

.ap24-finder__panel[hidden] {
    display: none !important;
}

.ap24-finder__panel.is-active {
    display: block !important;
    min-height: 50px;
    /* Force height */
    opacity: 1 !important;
    visibility: visible !important;
}

.ap24-finder__section {
    margin-bottom: 18px;
}

.ap24-finder__heading {
    margin: 0 0 8px;
    font-size: 1em;
}

.ap24-finder__fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ap24-finder__fields--kba,
.ap24-finder__fields--vin {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ap24-finder__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ap24-finder__label {
    font-weight: 600;
}

.ap24-finder__actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.ap24-finder__info {

    /* =========================================
   AutoParts 24 Finder - Horizontal Design
   ========================================= */
    :root {
        --ap24-bg-white: #ffffff;
        --ap24-bg-dark: #1a2b4b;
        /* Dark blue from image for headers if needed */
        --ap24-primary-red: #e60000;
        /* Red from image */
        --ap24-text-dark: #333333;
        --ap24-text-white: #ffffff;
        --ap24-border: #cccccc;
        --ap24-radius: 4px;
        --ap24-spacing: 10px;
    }

    .ap24-finder--horizontal {
        font-family: 'Inter', sans-serif;
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px 0;
    }

    .ap24-finder__bar {
        display: flex;
        flex-wrap: wrap;
        background-color: var(--ap24-bg-white);
        border: 1px solid #e0e0e0;
        border-radius: var(--ap24-radius);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        padding: 15px;
        align-items: flex-end;
        /* Align inputs and buttons to bottom */
        gap: 20px;
    }

    /* Sections */
    .ap24-finder__section {
        flex: 1;
        min-width: 300px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .ap24-finder__section--manual {
        flex: 1.5;
        /* Give more space to manual section */
    }

    .ap24-finder__section--kba {
        flex: 1;
    }

    /* Divider */
    .ap24-finder__divider {
        width: 1px;
        background-color: #e0e0e0;
        align-self: stretch;
        margin: 0 10px;
        display: none;
        /* Hidden on mobile */
    }

    @media (min-width: 992px) {
        .ap24-finder__divider {
            display: block;
        }
    }

    /* Headers */
    .ap24-finder__header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 5px;
        color: var(--ap24-bg-dark);
        /* Dark blue text for headers */
        font-weight: 600;
        font-size: 14px;
    }

    .ap24-finder__icon,
    .ap24-finder__info-icon {
        font-size: 16px;
        color: #888;
        cursor: help;
    }

    /* Controls Row */
    .ap24-finder__controls {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    /* Inputs & Selects */
    .ap24-finder__select,
    .ap24-finder__input {
        width: 100%;
        height: 40px;
        padding: 0 12px;
        border: 1px solid var(--ap24-border);
        border-radius: var(--ap24-radius);
        background-color: #fff;
        color: var(--ap24-text-dark);
        font-size: 14px;
        box-sizing: border-box;
    }

    .ap24-finder__select:focus,
    .ap24-finder__input:focus {
        border-color: var(--ap24-bg-dark);
        outline: none;
    }

    /* Wrappers */
    .ap24-finder__select-wrapper,
    .ap24-finder__input-wrapper {
        flex: 1;
        position: relative;
    }

    /* Step 1 Badge */
    .ap24-finder__step-wrapper {
        flex: 1;
        display: flex;
        align-items: center;
        position: relative;
    }

    .ap24-finder__step-badge {
        background-color: var(--ap24-primary-red);
        color: #fff;
        font-weight: bold;
        font-size: 14px;
        width: 24px;
        height: 40px;
        /* Match input height */
        display: flex;
        align-items: center;
        justify-content: center;
        border-top-left-radius: var(--ap24-radius);
        border-bottom-left-radius: var(--ap24-radius);
        position: absolute;
        left: 0;
        top: 0;
        z-index: 2;
    }

    /* Add arrow to badge */
    .ap24-finder__step-badge::after {
        content: '';
        position: absolute;
        right: -10px;
        top: 50%;
        transform: translateY(-50%);
        border-left: 10px solid var(--ap24-primary-red);
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
    }

    .ap24-finder__step-wrapper .ap24-finder__select {
        padding-left: 35px;
        /* Make space for badge */
    }

    /* Buttons */
    .ap24-finder__btn {
        height: 40px;
        width: 40px;
        background-color: var(--ap24-accent);
        border: none;
        border-radius: var(--ap24-radius);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background-color 0.2s;
        flex-shrink: 0;
    }

    .ap24-finder__btn:hover {
        background-color: var(--ap24-accent-hover);
    }

    .ap24-finder__search-icon {
        font-size: 20px;
        line-height: 1;
        transform: rotate(-45deg);
        /* Magnifying glass orientation */
    }

    /* Responsive */
    @media (max-width: 991px) {
        .ap24-finder__bar {
            flex-direction: column;
            align-items: stretch;
        }

        .ap24-finder__controls {
            flex-wrap: wrap;
        }

        .ap24-finder__select-wrapper,
        .ap24-finder__input-wrapper,
        .ap24-finder__step-wrapper {
            min-width: 100%;
            /* Stack on mobile */
        }

        .ap24-finder__btn {
            width: 100%;
            /* Full width button on mobile */
        }
    }

    /* Garage Summary */
    .ap24-finder__garage-summary {
        background: #f8f9fa;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        padding: 10px 15px;
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .ap24-garage-summary__content {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .ap24-garage-summary__label {
        font-weight: 600;
        color: #555;
    }

    .ap24-garage-summary__vehicle {
        font-weight: bold;
        color: var(--ap24-bg-dark);
    }

    .ap24-garage-summary__actions {
        display: flex;
        gap: 15px;
    }

    .ap24-btn-link {
        background: none;
        border: none;
        color: var(--ap24-bg-dark);
        text-decoration: underline;
        cursor: pointer;
        font-size: 13px;
        padding: 0;
    }

    .ap24-btn-link--danger {
        color: #dc3545;
    }

    /* Loading Modal */
    .ap24-finder__modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 9999;
        align-items: center;
        justify-content: center;
    }

    .ap24-finder__modal.is-active {
        display: flex;
    }

    .ap24-finder__modal-backdrop {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
    }

    .ap24-finder__modal-dialog {
        background: #fff;
        border-radius: 8px;
        width: 90%;
        max-width: 600px;
        z-index: 10000;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        max-height: 90vh;
    }

    .ap24-finder__modal-header {
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .ap24-finder__modal-title {
        font-weight: bold;
        font-size: 18px;
    }

    .ap24-finder__modal-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        line-height: 1;
    }

    .ap24-finder__modal-body {
        padding: 20px;
        overflow-y: auto;
    }

    /* Vehicle List in Modal */
    .ap24-finder__vehicle-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .ap24-finder__vehicle-card {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 10px;
        border: 1px solid #eee;
        border-radius: 6px;
        background: #fff;
        cursor: pointer;
        transition: all 0.2s;
        text-align: left;
        width: 100%;
    }

    .ap24-finder__vehicle-card:hover {
        border-color: var(--ap24-bg-dark);
        background: #f8f9fa;
    }

    .ap24-vehicle-card__image img {
        width: 60px;
        height: 40px;
        object-fit: contain;
    }

    .ap24-vehicle-card__content {
        flex: 1;
    }

    .ap24-vehicle-card__title {
        font-weight: bold;
        color: var(--ap24-bg-dark);
    }

    .ap24-vehicle-card__subtitle {
        font-size: 13px;
        color: #666;
    }

    .ap24-vehicle-card__arrow {
        font-size: 20px;
        color: #ccc;
    }

    /* Loading Spinner */
    .ap24-finder__loading {
        text-align: center;
        padding: 20px;
    }

    .ap24-finder__spinner {
        border: 4px solid #f3f3f3;
        border-top: 4px solid var(--ap24-bg-dark);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        animation: spin 1s linear infinite;
        margin: 0 auto 15px;
    }

    @keyframes spin {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }

    /* Product Grid */
    .ap24-finder__product-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
        margin-top: 20px;
    }

    .ap24-finder__product-card {
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 15px;
        text-decoration: none;
        color: inherit;
        transition: box-shadow 0.2s;
        display: block;
    }

    .ap24-finder__product-card:hover {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .ap24-finder__product-thumb img {
        width: 100%;
        height: 150px;
        object-fit: contain;
        margin-bottom: 10px;
    }

    .ap24-finder__product-title {
        font-weight: bold;
        margin-bottom: 5px;
        font-size: 14px;
    }

    .ap24-finder__product-price {
        color: var(--ap24-bg-dark);
        font-weight: bold;
    }
}

/* Garage Summary */
.ap24-finder__garage-summary {
    background: #e8f4fa;
    border: 1px solid #bce0f5;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ap24-garage-summary__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ap24-garage-summary__label {
    font-size: 0.85em;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ap24-garage-summary__vehicle {
    font-weight: 700;
    color: #333;
    font-size: 1.05em;
}

.ap24-garage-summary__actions {
    display: flex;
    gap: 12px;
}

.ap24-btn-link {
    background: none;
    border: none;
    padding: 0;
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.95em;
}

.ap24-btn-link:hover {
    color: #005177;
}

.ap24-btn-link--danger {
    color: #d63638;
}

.ap24-btn-link--danger:hover {
    color: #a0282a;
}

/* Compatibility Badge */
.ap24-compatibility-badge {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.ap24-compatibility-badge.is-compatible {
    background-color: #edfaef;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.ap24-compatibility-badge.is-incompatible {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.ap24-badge-icon {
    font-size: 1.2em;
}

/* Pro Vehicle Card */
.ap24-finder__vehicle-card--pro {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 10px;
}

.ap24-finder__vehicle-card--pro:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.ap24-vehicle-card__image {
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 6px;
    overflow: hidden;
}

.ap24-vehicle-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ap24-vehicle-card__placeholder {
    font-size: 24px;
    opacity: 0.5;
}

.ap24-vehicle-card__content {
    flex: 1;
    min-width: 0;
}

.ap24-vehicle-card__title {
    font-weight: 700;
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.ap24-vehicle-card__subtitle {
    font-size: 14px;
    color: #475569;
    margin-bottom: 8px;
}

.ap24-vehicle-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ap24-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.ap24-badge--gray {
    background: #f1f5f9;
    color: #475569;
}

.ap24-badge--blue {
    background: #dbeafe;
    color: #1e40af;
}

.ap24-badge--purple {
    background: #f3e8ff;
    color: #6b21a8;
}

.ap24-badge--green {
    background: #dcfce7;
    color: #166534;
}

.ap24-badge--red {
    background: #fee2e2;
    color: #991b1b;
}

.ap24-vehicle-card__arrow {
    color: #cbd5e1;
    font-size: 24px;
    font-weight: 300;
}

/* Loading State */
.ap24-finder__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #64748b;
}

.ap24-finder__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: ap24-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes ap24-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal tweaks */
.ap24-finder__modal-dialog {
    max-width: 800px;
    width: 90%;
}

.ap24-finder__vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Form Elements Styling */
.ap24-finder input[type="text"],
.ap24-finder select {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    background-color: #fff !important;
    color: #333 !important;
    box-sizing: border-box !important;
    min-height: 40px !important;
    pointer-events: auto !important;
    z-index: 1;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.ap24-finder input[type="text"]:focus,
.ap24-finder select:focus {
    border-color: #0073aa !important;
    box-shadow: 0 0 0 1px #0073aa !important;
    outline: none !important;
}

/* Fix VIN layout to be full width */
.ap24-finder__fields--vin {
    grid-template-columns: 1fr !important;
    display: block !important;
    /* Force block to avoid grid issues */
}

/* Ensure buttons are visible */
.ap24-finder .button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
    min-height: 40px !important;
    transition: background 0.2s, border-color 0.2s;
    opacity: 1 !important;
    visibility: visible !important;
}

.ap24-finder .button-primary {
    background: #0073aa !important;
    border-color: #0073aa !important;
    color: #fff !important;
    text-shadow: none !important;
}

.ap24-finder .button-primary:hover {
    background: #005177 !important;
    border-color: #005177 !important;
}

/* Fix for disabled/readonly inputs if any */
.ap24-finder input:disabled,
.ap24-finder select:disabled {
    background-color: #f0f0f1 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* Legacy Card Styles */
.ap24vf-card {
    border: 1.8px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: block;
    overflow: hidden;
    text-decoration: none;
}

.ap24vf-card:hover,
.ap24vf-card:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
    border-color: #3b82f6;
    outline: none;
}

.ap24vf-card-media {
    position: relative;
}

.ap24vf-thumb {
    width: 100%;
    height: 12rem;
    /* 48 * 0.25rem = 12rem */
    object-fit: contain;
    border-radius: 0.5rem;
    background-color: #f8fafc;
    /* slate-50 */
    display: block;
}

.ap24vf-thumb.ph {
    background-color: #f1f5f9;
    /* slate-100 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    /* 4xl */
    color: #94a3b8;
    /* slate-400 */
}

.ap24vf-card-body {
    padding: 1.75rem;
    /* p-7 */
    padding-top: 0.75rem;
    /* pt-3 */
    padding-bottom: 0.75rem;
    /* pb-3 */
    text-align: center;
}

.ap24vf-title {
    font-size: 1rem;
    /* text-base */
    font-weight: 600;
    /* font-semibold */
    color: #1e293b;
    /* slate-800 */
    margin: 0;
}

.ap24vf-sku {
    font-size: 0.875rem;
    /* text-sm */
    color: #475569;
    /* slate-600 */
    margin-top: 0.25rem;
    /* mt-1 */
}

.ap24vf-price {
    font-size: 1.25rem;
    /* text-xl */
    font-weight: 600;
    /* font-semibold */
    color: #FF7400;
    margin-top: 0.5rem;
    /* mt-2 */
}

.ap24vf-results-title {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.75rem;
}

.ap24vf-empty {
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    color: #475569;
}

/* Tailwind Utilities (Minimal set for grid) */
.tw-grid {
    display: grid;
}

.tw-grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tw-gap-4 {
    gap: 1rem;
}

@media (min-width: 640px) {
    .sm\:tw-grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .xl\:tw-grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.tw-block {
    display: block;
}

.tw-border {
    border-width: 1px;
}

.tw-border-slate-200 {
    border-color: #e2e8f0;
}

.tw-rounded-xl {
    border-radius: 0.75rem;
}

.tw-bg-white {
    background-color: #ffffff;
}

.tw-shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.tw-transition {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.tw-overflow-hidden {
    overflow: hidden;
}

.tw-relative {
    position: relative;
}

.tw-w-full {
    width: 100%;
}

.tw-h-48 {
    height: 12rem;
}

.tw-object-contain {
    object-fit: contain;
}

.tw-rounded-lg {
    border-radius: 0.5rem;
}

.tw-bg-slate-50 {
    background-color: #f8fafc;
}

.tw-bg-slate-100 {
    background-color: #f1f5f9;
}

.tw-flex {
    display: flex;
}

.tw-items-center {
    align-items: center;
}

.tw-justify-center {
    justify-content: center;
}

.tw-text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.tw-text-slate-400 {
    color: #94a3b8;
}

.tw-p-7 {
    padding: 1.75rem;
}

.tw-pt-3 {
    padding-top: 0.75rem;
}

.tw-pb-3 {
    padding-bottom: 0.75rem;
}

.tw-text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.tw-font-semibold {
    font-weight: 600;
}

.tw-text-slate-800 {
    color: #1e293b;
}

.tw-text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.tw-text-slate-600 {
    color: #475569;
}

.tw-mt-1 {
    margin-top: 0.25rem;
}

.tw-text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.tw-text-blue-600 {
    color: #2563eb;
}

.tw-mt-2 {
    margin-top: 0.5rem;
}

/* ====================== KBA VEHICLE MODAL ====================== */
body.ap24-modal-open {
    overflow: hidden;
}

.ap24-kba-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.ap24-kba-modal.is-active {
    display: flex;
}

.ap24-kba-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.ap24-kba-dialog {
    position: relative;
    width: min(920px, 92%);
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ap24-kba-help-modal .ap24-kba-dialog {
    width: min(720px, 96%);
    max-width: 720px;
    min-width: 720px;
}

@media (max-width: 768px) {
    .ap24-kba-help-modal .ap24-kba-dialog {
        width: 100%;
        min-width: 100%;
    }
}

.ap24-kba-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.ap24-kba-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--ast-global-color-2, #0f172a);
    margin: 0;
    margin-bottom: 0 !important;
}

.ap24-kba-close {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.ap24-kba-close:hover,
.ap24-kba-close:focus {
    background: rgba(148, 163, 184, 0.16);
    color: #0f172a;
    outline: none;
}

.ap24-kba-body {
    padding: 16px 24px 24px;
    overflow-y: auto;
}

.ap24-kba-help-dialog .ap24-kba-body {
    overflow-y: visible;
}

.ap24-kba-help-header {
    justify-content: space-between;
}

.ap24-kba-help-body {
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 24px;
    background: #f8fafc;
}

.ap24-kba-help-body .ap24-contact-section {
    width: 100%;
    max-width: 100%;
    text-align: left;
}

.ap24-kba-help-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

/* --- Fitments (Accordion) --- */
.ap24-fitments {
    /* font-family: 'Inter', sans-serif; Removed to inherit from theme */
    color: #1e293b;
}

.ap24-fitments__title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: inherit;
}

.ap24-fitments__brand,
.ap24-fitments__model {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.ap24-fitments__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    background: #fff;
    transition: background-color 0.2s;
    list-style: none;
}

.ap24-fitments__summary::-webkit-details-marker {
    display: none;
}

/* Chevron Icon */
.ap24-fitments__summary::after {
    content: '';
    width: 1.25rem;
    height: 1.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s;
}

details[open]>.ap24-fitments__summary::after {
    transform: rotate(180deg);
}

.ap24-fitments__summary:hover {
    background-color: #f8fafc;
}

.ap24-fitments__label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.ap24-fitments__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: #e2e8f0;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.ap24-fitments__content {
    padding: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

/* Nested Model Accordion */
.ap24-fitments__model {
    margin-bottom: 0.5rem;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ap24-fitments__model .ap24-fitments__summary {
    background-color: #fff;
    font-size: 0.95rem;
}

.ap24-fitments__table-wrapper {
    overflow-x: auto;
    padding: 0;
    background: #fff;
    border-radius: 0 0 0.5rem 0.5rem;
}

.ap24-fitments__table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ap24-fitments__table th {
    text-align: center;
    /* Centered */
    font-weight: 600;
    padding: 0.75rem 1rem;
    background-color: #f1f5f9;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.ap24-fitments__table td {
    text-align: center;
    /* Centered */
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.ap24-fitments__table tr:last-child td {
    border-bottom: none;
}

.ap24-fitments__table tr:hover td {
    background-color: #f8fafc;
}

.ap24-fitments__table .text-right {
    text-align: center;
    /* Override to center */
}

/* --- Specs (Card) --- */
.ap24-specs {
    color: #1e293b;
    width: 100%;
}

.ap24-specs__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    line-height: 1.25;
}

.ap24-specs__card {
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ap24-specs__list {
    margin: 0;
}

.ap24-specs__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.ap24-specs__row:nth-child(even) {
    background: #f8fafc;
}

.ap24-specs__row:last-child {
    border-bottom: 0;
}

.ap24-specs__label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
}

.ap24-specs__value {
    font-size: 0.95rem;
    justify-self: start;
    color: #1e293b;
    margin: 0;
    line-height: 1.5;
}

@media (min-width: 640px) {
    .ap24-specs__row {
        grid-template-columns: 40% 60%;
        /* Fixed 2-column ratio */
        align-items: center;
    }

    .ap24-specs__value {
        justify-self: start;
        text-align: left;
    }
}

.ap24-kba-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.ap24-kba-card {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    border: 1.8px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 18px;
    background: #f8fafc;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    text-align: left;
    color: inherit;
}

.ap24-kba-card:hover,
.ap24-kba-card:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
    border-color: #3b82f6;
    background: #ffffff;
    outline: none;
}

.ap24-kba-card:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.ap24-kba-thumb {
    flex: 0 1 160px;
    width: min(360px, 100%);
    max-width: 100%;
    border-radius: 8px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.ap24-kba-thumb img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.ap24-kba-thumb-ph {
    font-size: 28px;
}

.ap24-kba-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ap24-kba-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--ast-global-color-2, #0f172a);
    text-transform: uppercase;
}

.ap24-kba-variant {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
}

.ap24-kba-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.ap24-kba-tag {
    font-size: 13px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #1e293b;
}

.ap24-kba-tag.is-spec {
    background: #e2e8f0;
    color: #0f172a;
}

.ap24-kba-tag.is-power {
    background: #dbeafe;
    color: #1d4ed8;
}

.ap24-kba-tag.is-years {
    background: #ede9fe;
    color: #6b21a8;
}

.ap24-kba-tag.is-fuel {
    background: #fee2e2;
    color: #b91c1c;
}

.ap24-kba-tag.is-engine {
    background: #dcfce7;
    color: #047857;
}

.ap24-kba-card-icon {
    font-size: 35px;
    color: #3b82f6;
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .ap24-kba-dialog {
        width: 92%;
        border-radius: 14px;
    }

    .ap24-kba-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .ap24-kba-thumb {
        flex: 0 0 100%;
        width: 100%;
    }

    .ap24-kba-card-icon {
        align-self: flex-end;
    }
}

/* Results Container */
.ap24-finder__results {
    padding-top: 15px !important;
}

/* Modal Styles */
.ap24-finder__modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.ap24-finder__modal.is-active {
    display: flex;
}

.ap24-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.ap24-modal__container {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1;
    overflow: hidden;
    animation: ap24-modal-in 0.3s ease-out;
}

@keyframes ap24-modal-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ap24-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.ap24-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.ap24-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
}

.ap24-modal__close:hover {
    color: #333;
}

.ap24-modal__content {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Combined Layout (Manual + KBA) */
.ap24-finder__combined-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.ap24-finder__section {
    flex: 1;
    min-width: 0;
    /* Prevent overflow */
}

.ap24-finder__section--manual {
    flex: 1.4;
    /* Give slightly more space to manual search */
}

.ap24-finder__section--kba {
    flex: 1;
}

/* Ensure grid-3 behaves correctly if missing */
.ap24-finder__grid-3 {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .ap24-finder__combined-row {
        flex-direction: column;
    }

    .ap24-finder__section {
        width: 100%;
    }

    .ap24-finder__grid-3 {
        flex-direction: column;
        align-items: stretch;
    }
}


/* Reset Button */
.ap24-finder__reset {
    background: none;
    border: none;
    color: var(--ap24-text-light);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    /* Push to right */
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ap24-finder__reset:hover {
    color: var(--ap24-danger);
    background-color: #fee2e2;
}

.ap24-finder__reset svg {
    width: 14px;
    height: 14px;
}


/* --- Hybrid Tab & Full Width Button Updates --- */

/* 1. Full Width Buttons (Mobile Only) */
@media (max-width: 768px) {
    .ap24-finder__action {
        width: 100%;
        margin-top: 10px;
    }

    .ap24-finder__button--search {
        width: 100% !important;
        justify-content: center !important;
        flex: none !important;
        border-radius: 6px !important;
    }

    /* Ensure grid wraps on mobile */
    .ap24-finder__grid-3 {
        flex-wrap: wrap;
    }

    /* --- Mobile Tab Styling (Stacked Icon + Text) --- */
    .ap24-finder__tabs {
        gap: 0;
        /* Remove gap to allow borders to touch if needed, or keep small gap */
        justify-content: space-between;
    }

    .ap24-finder__tab {
        flex: 1;
        flex-direction: column;
        gap: 4px;
        padding: 10px 4px;
        background: transparent;
        border: none;
        border-bottom: 3px solid transparent;
        /* Reserve space for active border */
        border-radius: 0;
        /* Remove rounded corners */
        color: #334155;
        /* Inactive color */
        height: auto;
    }

    /* Hide original text to replace with 2-line version */
    .ap24-finder__tab-text {
        display: none;
        content: none;
    }

    /* Reset the desktop hack for manual tab specifically if it leaks */
    .ap24-finder__tab[data-target*='_manual']::after {
        content: '';
    }

    /* Insert New Single-Line Text */
    .ap24-finder__tab::after {
        display: block;
        font-size: 12px;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
        /* Single line */
        font-weight: 600;
        color: inherit;
        /* Inherit color from parent */
    }

    .ap24-finder__tab[data-target*='_manual']::after {
        content: 'Manuelle Auswahl';
    }

    .ap24-finder__tab[data-target*='_kba']::after {
        content: 'KBA Suche';
    }

    .ap24-finder__tab[data-target*='_vin']::after {
        content: 'VIN Suche';
    }

    /* Active State - Keep Orange */
    .ap24-finder__tab.is-active {
        background: transparent;
        color: #ff6600;
        /* Orange active text */
        border-bottom-color: #ff6600;
        /* Orange active border */
        box-shadow: none;
    }

    /* Inactive State - Dark Grey */
    .ap24-finder__tab:not(.is-active) {
        color: #334155;
    }

    .ap24-finder__tab-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* 2. Mobile Default (3 Tabs) */
.ap24-combined-wrapper {
    display: block;
}

/* 3. Desktop Overrides (Combined View) */
@media (min-width: 768px) {

    /* Hide KBA Tab Button */
    .ap24-finder__tab[data-target*='_kba'] {
        display: none !important;
    }

    /* Rename 'Manuelle Suche' to 'Fahrzeugauswahl' */
    .ap24-finder__tab[data-target*='_manual'] .ap24-finder__tab-text {
        display: none;
    }

    /* Restore desktop text */
    .ap24-finder__tab[data-target*='_manual']::after {
        content: 'Fahrzeugauswahl';
        display: inline;
        /* Reset from mobile block */
        white-space: normal;
        font-size: inherit;
        font-weight: inherit;
    }

    /* Combined Panel Logic */
    .ap24-combined-wrapper:has(.ap24-finder__panel.is-active) {
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }

    .ap24-combined-wrapper:has(.ap24-finder__panel.is-active) .ap24-finder__panel {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: auto;
    }

    /* Sizing */
    .ap24-combined-wrapper .ap24-finder__panel[id*='_manual'] {
        flex: 1.4;
    }

    .ap24-combined-wrapper .ap24-finder__panel[id*='_kba'] {
        flex: 1;
    }

    /* Reset Action Width for Desktop */
    .ap24-finder__action {
        width: auto;
        margin-top: 0;
    }

    /* Ensure Manual Grid is single line on desktop */
    .ap24-finder__grid-3 {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
    }
}