/* CSS for Spare Parts Navigation */

.spare-parts-section {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.spare-parts-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.spare-parts-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    position: relative;
}

.part-category-card {
    background-color: #f2f2f2;
    border: 3px solid transparent;
    height: 200px;
    margin-top: 30px;
    border-radius: 8px;
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    user-select: none;
    color: #000;
}

.part-category-card:hover {
    border-color: #ff9900;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.part-category-card.selected {
    border-color: #ff9900;
    background-color: #fff9f0;
    box-shadow: none;
}

.part-category-card img {
    margin-top: -60px;
    width: 180px;
}

.part-category-card span {
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

/* Disabled category card */
.part-category-card.disabled {
    opacity: 0.45;
    filter: grayscale(100%);
    cursor: pointer;
    box-shadow: none !important;
    transform: none !important;
    border-color: transparent !important;
}

/* Subcategory Accordion Container */
.subcategory-container {
    grid-column: 1 / -1;
    background-color: #f9f9f9;
    border: 1px solid #ff9900;
    border-radius: 8px;
    overflow: hidden;

    /* Animation base state */
    max-height: 0;
    opacity: 0;
    padding: 0 2rem;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, padding 0.5s ease;
}

.subcategory-container.active {
    max-height: 2000px;
    /* large enough to hold items */
    opacity: 1;
    padding: 2rem;
}

.subcategory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
}

.subcategory-header h2 {
    font-size: 17px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    margin: 0;
    color: #000;
}

.close-subcategory {
    cursor: pointer;
    background: none;
    border: none;
    color: #888;
    font-size: 2rem;
    line-height: 1;
    transition: color 0.2s;
}

.close-subcategory:hover {
    color: #ff9900;
}

.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.subcategory-item {
    background-color: #fff;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: #000;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subcategory-item:hover {
    background-color: #fff9f0;
    border-color: #ff9900;
    transform: translateX(5px);
}

.subcategory-item::before {
    content: '→';
    color: #ff9900;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s;
}

.subcategory-item:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Disabled subcategory item */
.subcategory-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: #f9f9f9;
    border-color: #e0e0e0;
}

.subcategory-item.disabled::before {
    display: none;
}

.subcategory-item .subcat-name {
    flex: 1;
}

/* Product Count Badge */
.product-count-badge {
    background-color: #e0e0e0;
    color: #444;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: auto;
    font-family: 'Inter', sans-serif;
    line-height: 1.2;
    display: inline-block;
}

.subcategory-item.disabled .product-count-badge {
    background-color: #eaeaea;
    color: #999;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .parts-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .subcategory-container.active {
        padding: 1.5rem 1rem;
    }

    .subcategory-grid {
        grid-template-columns: 1fr;
    }
}

/* Vehicle Summary Banner */
.vehicle-summary-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 40px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.vehicle-summary-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.vehicle-brand-logo {
    height: 30px;
    object-fit: contain;
}

.vehicle-summary-title {
    font-size: 18px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #000;
    margin: 0;
}

.vehicle-summary-right {
    display: flex;
    align-items: center;
}

.vehicle-model-image {
    height: 80px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .vehicle-summary-banner {
        flex-direction: column;
        padding: 15px;
        text-align: center;
    }

    .vehicle-summary-left {
        flex-direction: column;
        margin-bottom: 15px;
    }

    .vehicle-model-image {
        height: 60px;
    }
}