/* =============================================
   FIND PARTS — Grid Search (Offcanvas)
   ============================================= */

/* Vehicle Type Tabs */
.fp-vehicle-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.fp-vehicle-tab {
    flex: 1;
    padding: 10px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    background: #fff;
    color: #555;
    border: none;
    outline: none;
    transition: background 0.2s, color 0.2s;
    font-family: var(--font-family);
}

.fp-vehicle-tab:not(:last-child) {
    border-right: 1px solid #ddd;
}

.fp-vehicle-tab.active {
    background: var(--main-theme-red);
    color: #fff;
}

.fp-vehicle-tab:hover:not(.active) {
    background: #f5f5f5;
}

.fp-vehicle-tab-link {
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.fp-vehicle-tab-link:hover {
    background: var(--main-theme-red) !important;
    color: #fff !important;
}

/* Breadcrumb Navigation */
.fp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 14px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.fp-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 4px;
    color: #999;
    background: #f5f5f5;
    cursor: default;
    transition: background 0.2s, color 0.2s;
    font-family: var(--font-family);
}

.fp-breadcrumb-item.active {
    background: var(--main-theme-black);
    color: #fff;
}

.fp-breadcrumb-item.completed {
    background: #e8e8e8;
    color: var(--main-theme-black);
    cursor: pointer;
}

.fp-breadcrumb-item.completed:hover {
    background: #ddd;
}

.fp-breadcrumb-sep {
    margin: 0 4px;
    color: #ccc;
    font-size: 11px;
    flex-shrink: 0;
}

/* Filter / Search Input */
.fp-filter-wrap {
    position: relative;
    margin-bottom: 14px;
}

.fp-filter-input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

.fp-filter-input:focus {
    border-color: var(--main-theme-red);
}

.fp-filter-input::placeholder {
    color: #aaa;
}

.fp-filter-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 14px;
    pointer-events: none;
}

/* Grid Container */
.fp-grid-container {
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    margin-bottom: 16px;
}

.fp-grid-container::-webkit-scrollbar {
    width: 5px;
}

.fp-grid-container::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.fp-grid-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.fp-grid-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Brand Grid */
.fp-brand-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}

.fp-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 6px 10px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
    text-align: center;
    min-height: 90px;
}

.fp-brand-card:hover {
    border-color: #ddd;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.fp-brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    margin-bottom: 6px;
}

.fp-brand-initial {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--main-theme-black);
    margin-bottom: 6px;
    font-family: var(--heading-font-family);
}

.fp-brand-name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Model Grid (brick layout) */
.fp-model-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.fp-model-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 6px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
    min-height: 60px;
}

.fp-model-card:hover {
    border-color: #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.fp-model-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--main-theme-black);
    line-height: 1.3;
    word-break: break-word;
}

.fp-model-years {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
}

/* Year Grid */
.fp-year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.fp-year-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--main-theme-black);
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
}

.fp-year-card:hover {
    border-color: var(--main-theme-red);
    background: #fef5f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.fp-year-card.selected {
    background: var(--main-theme-red);
    color: #fff;
    border-color: var(--main-theme-red);
}

/* Search Actions */
.fp-search-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
}

.fp-search-actions .button {
    width: 100%;
    text-align: center;
    display: block;
}

.fp-search-actions .button:disabled,
.fp-search-actions .button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.fp-advance-link {
    font-size: 13px;
    color: var(--main-theme-red);
    text-decoration: underline;
}

.fp-advance-link:hover {
    color: var(--main-theme-black);
}

/* Loader */
.fp-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 0;
}

.fp-loader i {
    font-size: 28px;
    color: var(--main-theme-red);
}

.fp-loader p {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

/* Empty State */
.fp-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.fp-empty i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
    color: #ccc;
}

/* Step visibility */
.fp-step {
    display: none;
}

.fp-step.active {
    display: block;
}

/* Offcanvas body — relative for loader overlay */
#search-now .offcanvas-body {
    position: relative;
    padding-bottom: 20px;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 480px) {
    .fp-brand-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .fp-model-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .fp-year-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .fp-brand-card {
        padding: 10px 4px 8px;
        min-height: 80px;
    }

    .fp-brand-logo,
    .fp-brand-initial {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .fp-brand-name {
        font-size: 10px;
    }

    .fp-model-name {
        font-size: 11px;
    }

    .fp-vehicle-tab {
        font-size: 11px;
        padding: 8px 8px;
    }

    .fp-breadcrumb-item {
        font-size: 10px;
        padding: 5px 10px;
    }
}

@media (min-width: 481px) and (max-width: 575px) {
    .fp-brand-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .fp-model-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .fp-year-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
