/* Vehicle Parts Catalog - Frontend Styles */

/* Reset: prevent theme from overriding logo image styles */
.vpc-brand-logo img,
.vpc-model-image img,
.vpc-sidebar-brand-logo {
    border: none !important;
    box-shadow: none !important;
}

.vpc-catalog {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ========================================
   LAYOUT: Sidebar + Main
   ======================================== */
.vpc-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.vpc-main {
    flex: 1;
    min-width: 0;
}

/* ========================================
   SIDEBAR
   ======================================== */
.vpc-sidebar {
    width: 220px;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 0;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.vpc-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
    padding: 16px 16px 10px;
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
}

.vpc-sidebar-brands {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.vpc-sidebar-brand-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.vpc-sidebar-brand-item:hover {
    background: #f5f7fa;
    border-left-color: #ddd;
}

.vpc-sidebar-brand-item.active {
    background: #eef4ff;
    border-left-color: #2271b1;
    font-weight: 600;
}

.vpc-sidebar-brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.vpc-sidebar-brand-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.vpc-sidebar-brand-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.vpc-sidebar-brand-count {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

.vpc-sidebar-brand-item.active .vpc-sidebar-brand-count {
    background: #2271b1;
    color: #fff;
}

/* Breadcrumb */
.vpc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #eee;
}

.vpc-breadcrumb-item {
    cursor: pointer;
    color: #2271b1;
    transition: color 0.2s;
}

.vpc-breadcrumb-item:hover {
    color: #135e96;
    text-decoration: underline;
}

.vpc-breadcrumb-item.active {
    color: #1d2327;
    font-weight: 600;
    cursor: default;
}

.vpc-breadcrumb-sep {
    color: #ccc;
    user-select: none;
}

/* Grid */
.vpc-grid {
    display: grid;
    gap: 20px;
}

.vpc-grid-2 { grid-template-columns: repeat(2, 1fr); }
.vpc-grid-3 { grid-template-columns: repeat(3, 1fr); }
.vpc-grid-4 { grid-template-columns: repeat(4, 1fr); }
.vpc-grid-5 { grid-template-columns: repeat(5, 1fr); }
.vpc-grid-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 992px) {
    .vpc-grid-4, .vpc-grid-5, .vpc-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    .vpc-sidebar {
        width: 180px;
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .vpc-grid-3, .vpc-grid-4, .vpc-grid-5, .vpc-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    .vpc-layout {
        flex-direction: column;
    }
    .vpc-sidebar {
        width: 100%;
        min-width: 100%;
        position: static;
        max-height: none;
        border-radius: 8px;
    }
    .vpc-sidebar-brands {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px;
    }
    .vpc-sidebar-brand-item {
        padding: 6px 10px;
        border-left: none;
        border-radius: 20px;
        border: 1px solid #e0e0e0;
        font-size: 12px;
        gap: 6px;
    }
    .vpc-sidebar-brand-item.active {
        border-color: #2271b1;
        background: #eef4ff;
    }
    .vpc-sidebar-brand-logo {
        width: 20px;
        height: 20px;
    }
    .vpc-sidebar-title {
        display: none;
    }
}

@media (max-width: 480px) {
    .vpc-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Brand Cards */
.vpc-brand-card {
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 30px 24px 22px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible !important;
    box-sizing: border-box !important;
}

.vpc-brand-card:hover {
    border-color: #2271b1;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.vpc-brand-card::after {
    content: '→';
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 16px;
    color: #ccc;
    transition: all 0.3s;
}

.vpc-brand-card:hover::after {
    color: #2271b1;
    right: 10px;
}

.vpc-brand-logo {
    width: 100% !important;
    height: 120px;
    margin: 0 auto 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 15px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

.vpc-brand-logo img {
    display: block !important;
    max-width: 100% !important;
    max-height: 120px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 auto !important;
    filter: grayscale(20%);
    transition: filter 0.3s;
}

.vpc-brand-card:hover .vpc-brand-logo img {
    filter: grayscale(0%);
}

.vpc-brand-info h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #1d2327;
}

.vpc-brand-info .vpc-count {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}

.vpc-brand-info .vpc-product-count {
    display: block;
    font-size: 11px;
    color: #aaa;
}

/* Model Cards */
.vpc-model-card {
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vpc-model-card:hover {
    border-color: #2271b1;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.vpc-model-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vpc-model-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.vpc-model-card:hover .vpc-model-image img {
    transform: scale(1.05);
}

.vpc-model-info {
    padding: 14px 16px;
}

.vpc-model-info h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
}

.vpc-model-years {
    font-size: 12px;
    color: #2271b1;
    margin-bottom: 4px;
    font-weight: 500;
}

.vpc-model-info .vpc-count {
    font-size: 12px;
    color: #888;
}

/* Products Grid */
.vpc-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.vpc-products-header {
    margin-bottom: 20px;
}

.vpc-products-header h3 {
    font-size: 20px;
    margin: 0 0 4px;
    color: #1d2327;
}

.vpc-products-header .vpc-total {
    color: #888;
    font-size: 14px;
}

/* Product Card */
.vpc-product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.vpc-product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.vpc-product-card a {
    text-decoration: none;
    color: inherit;
}

.vpc-product-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f9f9f9;
}

.vpc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vpc-product-info {
    padding: 12px 14px;
}

.vpc-product-info h5 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vpc-product-sku {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 6px;
}

.vpc-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #2271b1;
}

.vpc-product-price del {
    color: #ccc;
    font-size: 13px;
    font-weight: 400;
}

.vpc-product-price ins {
    text-decoration: none;
}

/* Back Button */
.vpc-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    color: #2271b1;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.vpc-back-btn:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.vpc-arrow {
    font-size: 16px;
}

/* Loading */
.vpc-loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.vpc-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: vpc-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

/* Pagination */
.vpc-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.vpc-page-btn {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.vpc-page-btn:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.vpc-page-btn.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

/* Empty State */
.vpc-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.vpc-no-results {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 15px;
}

/* Slide animations */
.vpc-fade-in {
    animation: vpcFadeIn 0.3s ease forwards;
}

@keyframes vpcFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
