/* ==========================================
   Parts List + Part Detail CSS
   ========================================== */

/* Shared: Vehicle Summary Banner (reused from spare_parts) */
.vehicle-summary-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f9f9f9;
    padding: 15px 40px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
}

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

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

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

.genuine-badge {
    color: #ff0000;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    margin-top: 2px;
}

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

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

/* ==========================================
   Parts List Page
   ========================================== */

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

.parts-count {
    font-size: 14px;
    color: #666;
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif;
}

.parts-count strong {
    color: #ff9900;
    font-weight: 700;
}

/* Subcategory header bar */
.subcategory-header-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #f2f2f2;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.subcategory-header-bar img {
    height: 50px;
    width: 50px;
    object-fit: contain;
    border-radius: 4px;
}

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

/* Parts product grid */
.parts-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 0;
}

.stock-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: capitalize;
    font-family: 'Inter', sans-serif;
}

.stock-badge.in-stock {
    background-color: #e6f9e6;
    color: #2d8a2d;
}

.stock-badge.out-of-stock {
    background-color: #ffe6e6;
    color: #c00;
}

.product-oem {
    font-size: 13px;
    color: #888;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.product-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background: #eef2f5;
    margin: 12px 0 0 0;
    overflow: hidden;
}

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

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

.product-card-name {
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #000;
    margin: 0 0 4px;
}

.product-card-category {
    font-size: 13px;
    color: #888;
    font-family: 'Inter', sans-serif;
    margin: 0;
}

.product-card-actions {
    padding: 12px 14px 14px;
    margin-top: auto;
}

/* Action Buttons */
.btn-price-request,
.btn-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #fff;
}

.btn-price-request {
    background-color: #3b76f5;
}

.btn-price-request:hover {
    background-color: #2a5cc7;
}

.btn-add-to-cart {
    background-color: #1cc051;
}

.btn-add-to-cart:hover {
    background-color: #17a645;
}

.btn-price-request .btn-icon,
.btn-add-to-cart .btn-icon {
    font-size: 16px;
    font-weight: 700;
}

/* Price display */
.product-price {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    font-family: 'Inter', sans-serif;
    margin-bottom: 10px;
}

.product-price .currency {
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

/* ==========================================
   Part Detail Page
   ========================================== */

.part-detail-section {
    padding: 2rem 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.part-detail-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Image side */
.part-detail-image-container {
    position: relative;
    background: #f2f2f2;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 0;
}

.part-detail-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.genuine-badge-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    padding: 10px 14px;
    border-radius: 8px;
}

.genuine-badge-overlay img {
    height: 24px;
    width: auto;
}

.genuine-badge-overlay span {
    color: #e60000;
    font-weight: 700;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
}

/* Info side */
.part-detail-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
}

.part-detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.part-detail-name {
    font-size: 42px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #111;
    margin: 4px 0;
    line-height: 1.1;
}

.part-detail-category {
    font-size: 14px;
    color: #888;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    margin: 0;
}

.part-detail-shipping {
    font-size: 13px;
    color: #888;
    font-family: 'Inter', sans-serif;
    margin-top: 12px;
}

.part-detail-shipping strong {
    color: #3b76f5;
    font-weight: 500;
}

.part-detail-action {
    margin-top: 16px;
    width: 100%;
}

.price-request-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.price-request-form textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.price-request-form textarea:focus {
    outline: none;
    border-color: #3b76f5;
    box-shadow: 0 0 0 3px rgba(59, 118, 245, 0.15);
}

.price-request-form .btn-price-request {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    border-radius: 10px;
}

.part-detail-action .btn-price-request,
.part-detail-action .btn-add-to-cart {
    padding: 14px 20px;
    font-size: 16px;
    border-radius: 10px;
}

.part-detail-price {
    font-size: 32px;
    font-weight: 700;
    color: #111;
    font-family: 'Inter', sans-serif;
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
}

.part-detail-price .tax-note {
    font-size: 14px;
    font-weight: 400;
    color: #999;
    margin-left: 8px;
}

/* Specs row */
.part-specs-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.part-spec-item {
    flex: 1;
    background: #f4f4f4;
    padding: 18px 20px;
    text-align: center;
    border-radius: 8px;
}

.part-spec-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #888;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.part-spec-value {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    font-family: 'Inter', sans-serif;
}

/* Vehicle Compatibility Section */
.compatibility-section {
    margin-top: 2rem;
}

.compatibility-section h2 {
    font-size: 22px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: #000;
    margin-bottom: 1.5rem;
}

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

.compat-card {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 18px;
    position: relative;
    transition: box-shadow 0.2s;
}

.compat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.compat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.compat-card-header img {
    margin-left: -20px;
    height: 45px;
    object-fit: contain;
}

.matching-badge {
    background-color: #fcecd9;
    color: #d67a1b;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}

.compat-card-name {
    font-size: 16px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: #000;
    margin: 0 0 4px;
}

.compat-card-years {
    font-size: 13px;
    color: #888;
    font-family: 'Inter', sans-serif;
    margin: 0 0 10px;
}

.compat-card-engines {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compat-card-engines li {
    font-size: 12px;
    color: #555;
    font-family: 'Inter', sans-serif;
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.compat-card-engines li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border: 1px solid #d67a1b;
    border-radius: 50%;
    margin-right: 2px;
}

/* Price visibility toggle */
.price-toggle-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff3e0;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #333;
}

.price-toggle-bar label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #ff9900;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(16px);
}

/* ==========================================
   No Image Placeholders
   ========================================== */

.no-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Inter', sans-serif;
}

.no-image-placeholder.in-stock {
    background-color: #e8f8e8;
    border: 2px dashed #a8d8a8;
}

.no-image-placeholder.out-of-stock {
    background-color: #fef0f0;
    border: 2px dashed #f8a8a8;
}

.part-number-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    max-width: 90%;
    line-height: 1.4;
}

.no-image-placeholder.in-stock .part-number-badge {
    background-color: #d4f4d4;
    color: #1a6b1a;
    border: 1px solid #a8d8a8;
}

.no-image-placeholder.out-of-stock .part-number-badge {
    background-color: #fce4e4;
    color: #a00;
    border: 1px solid #f8a8a8;
}

/* Product card image adjustments for no-image placeholder */
.product-card-image .no-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 180px;
}

.product-card-image .part-number-badge {
    font-size: 12px;
    padding: 6px 12px;
}

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

@media (max-width: 900px) {
    .part-detail-hero {
        grid-template-columns: 1fr;
    }

    .vehicle-summary-banner {
        flex-direction: column;
        padding: 15px;
        text-align: center;
    }

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

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

    .parts-list-section,
    .part-detail-section {
        padding: 1.5rem 15px;
    }

    .part-specs-row {
        flex-direction: column;
        gap: 12px;
    }

    .part-spec-item {
        width: 100%;
    }
}

@media (max-width: 1400px) {
    .parts-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .parts-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .parts-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .parts-product-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .part-detail-name {
        font-size: 22px;
    }
}