/**
 * Parts Inventory Frontend Styles
 */

/* ==========================================================================
   General Wrapper & Reset
   ========================================================================== */

body .parts-inventory-shortcode-wrapper,
body .parts-inventory-single-view-wrapper {
    margin-bottom: 30px !important;
    font-family: inherit !important;
    line-height: 1.6 !important;
    box-sizing: border-box !important;
}

body .parts-inventory-shortcode-wrapper *,
body .parts-inventory-single-view-wrapper *,
body .parts-inventory-shortcode-wrapper *::before,
body .parts-inventory-single-view-wrapper *::before,
body .parts-inventory-shortcode-wrapper *::after,
body .parts-inventory-single-view-wrapper *::after {
    box-sizing: border-box !important;
}

/* ==========================================================================
   List View Styles (Main Inventory Page)
   ========================================================================== */

body .parts-inventory-list {
    display: grid !important;
    gap: 25px !important;
    grid-template-columns: repeat(1, 1fr) !important;
    margin-bottom: 20px !important;
    clear: both !important;
}

@media (min-width: 768px) {
    body .parts-inventory-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 992px) {
    body .parts-inventory-list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

body .parts-inventory-list .part-item {
    border: 1px solid #dee2e6 !important;
    padding: 0 !important;
    background: #fff !important;
    border-radius: 0.375rem !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transition: all 0.3s ease-in-out !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

body .parts-inventory-list .part-item:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-5px) !important;
}

body .parts-inventory-list .part-item-image a {
    display: block;
    line-height: 0;
}

body .parts-inventory-list .part-item-image img,
body .parts-inventory-list .no-image-placeholder {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border: none !important;
    background-color: #f8f9fa !important;
    aspect-ratio: 16 / 10 !important;
    object-fit: cover !important;
    border-bottom: 1px solid #dee2e6 !important;
}

body .parts-inventory-list .no-image-placeholder {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #6c757d !important;
    font-size: 0.9rem;
}

body .parts-inventory-list .part-item-details {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1.25rem !important;
}

body .parts-inventory-list .part-item-title {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
    font-size: 1.25rem !important;
    font-weight: bold !important;
}

body .parts-inventory-list .part-item-title a {
    text-decoration: none !important;
    color: #212529 !important;
}

body .parts-inventory-list .part-item-title a:hover {
    color: #cc0000 !important;
}

body .parts-inventory-list .part-item-meta {
    list-style: none !important;
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    font-size: 0.9em !important;
    color: #6c757d !important;
}

body .parts-inventory-list .part-item-meta li { 
    margin-bottom: 0.25rem !important; 
}

body .parts-inventory-list .part-item-meta strong { 
    color: #212529 !important; 
}

body .parts-inventory-list .part-item-footer {
    margin-top: auto !important;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

body .parts-inventory-list .part-item-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #cc0000;
    margin-bottom: 1rem;
}

body .parts-inventory-list .price-ask {
    font-style: italic;
    color: #212529;
}

body .parts-inventory-list .button.part-detail-link {
    display: block !important;
    width: 100%;
    margin-top: 0 !important;
    padding: 0.5rem 1rem !important;
    background-color: #cc0000 !important;
    color: #fff !important;
    text-decoration: none !important;
    border: 1px solid #cc0000 !important;
    border-radius: 0.375rem !important;
    transition: all 0.3s ease-in-out !important;
    text-align: center;
}

body .parts-inventory-list .button.part-detail-link:hover {
    background-color: #a00000 !important;
    border-color: #a00000 !important;
}


/* ==========================================================================
   Single View Styles
   ========================================================================== */

body .parts-inventory-single-view-wrapper .entry-title {
    color: #000000 !important;
    font-weight: bold !important;
    position: relative !important;
    padding-bottom: 15px !important;
    margin-bottom: 30px !important;
    font-size: 2.5rem !important;
    text-align: center !important;
}

body .parts-inventory-single-view-wrapper .entry-title::after {
    content: '' !important;
    position: absolute !important;
    display: block !important;
    width: 300px !important;
    height: 5px !important;
    background: #D32F2F !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 3px !important;
}

body .part-gallery-and-details { display: grid !important; grid-template-columns: 1fr !important; gap: 30px !important; margin-bottom: 30px !important; }
@media (min-width: 768px) { body .part-gallery-and-details { grid-template-columns: repeat(2, 1fr) !important; gap: 40px !important; } body .part-gallery { grid-column: 1 !important; grid-row: 1 / span 2 !important; } body .part-price-section { grid-column: 2 !important; grid-row: 1 !important; align-self: start !important; } body .part-details-table { grid-column: 2 !important; grid-row: 2 !important; } }
body .part-gallery .main-image { margin-bottom: 15px !important; border: 1px solid #eee !important; }
body .part-gallery .main-image img { max-width: 100% !important; height: auto !important; display: block !important; background: #f9f9f9 !important; }
body .part-gallery .thumbnail-images { display: flex !important; flex-wrap: wrap !important; gap: 10px !important; }
body .part-gallery .thumbnail-images a { display: block !important; }
body .part-gallery .thumbnail-images img { width: 80px !important; height: 60px !important; object-fit: cover !important; border: 1px solid #ddd !important; cursor: pointer !important; opacity: 0.7 !important; transition: opacity 0.3s ease, border-color 0.3s ease !important; }
body .part-gallery .thumbnail-images img:hover, body .part-gallery .thumbnail-images a:focus img { opacity: 1 !important; border-color: #999 !important; }
body .part-gallery .gallery-note { font-size: 0.85em !important; color: #666 !important; margin-top: 10px !important; text-align: center !important; }
body .part-gallery .no-image-placeholder { display: flex !important; align-items: center !important; justify-content: center !important; min-height: 250px !important; background: #f0f0f0 !important; color: #aaa !important; border: 1px solid #eee !important; }
body .part-price-section { background: #f8f8f8 !important; padding: 25px !important; border: 1px solid #e0e0e0 !important; border-radius: 4px !important; margin-bottom: 20px !important; }
body .part-price-section .price-item { margin-bottom: 15px !important; padding-bottom: 15px !important; border-bottom: 1px dashed #ddd !important; } body .part-price-section .price-item:last-child { margin-bottom: 0 !important; padding-bottom: 0 !important; border-bottom: none !important; }
body .part-price-section .price-label { font-weight: 600 !important; display: block !important; margin-bottom: 5px !important; font-size: 1em !important; color: #444 !important; }
body .part-price-section .price-value { font-size: 2.2em !important; font-weight: bold !important; color: #D32F2F !important; line-height: 1 !important; }
body .part-price-section .price-value .currency { font-size: 0.5em !important; font-weight: normal !important; margin-left: 2px !important; vertical-align: super !important; }
body .part-details-table h3, body .part-description-section h3, body .part-contact-section h3 {
    color: #D32F2F !important;
    font-size: 1.4rem !important;
    margin-top: 30px !important;
    margin-bottom: 15px !important;
    border-bottom: 2px solid #eee !important;
    padding-bottom: 10px !important;
    font-weight: 600 !important;
}
body .part-details-table table { width: 100% !important; border-collapse: collapse !important; font-size: 1em !important; margin-bottom: 20px !important; }
body .part-details-table th, body .part-details-table td { padding: 12px 0 !important; border-bottom: 1px solid #eee !important; text-align: left !important; vertical-align: top !important; }
body .part-details-table th { font-weight: 600 !important; width: 35% !important; padding-right: 15px !important; color: #333 !important; }
body .part-details-table td { color: #555 !important; }
body .part-description-section { margin-bottom: 30px !important; }
body .part-description-section .description-content { margin-bottom: 30px !important; padding-left: 15px !important; border-left: 4px solid #f0f0f0 !important; font-size: 1.05em !important; }
body .part-contact-section { margin-top: 40px !important; padding-top: 25px !important; border-top: 1px solid #e0e0e0 !important; }
body .part-contact-section p { margin-bottom: 15px !important; }
body .part-contact-section .button {
    display: inline-block !important; padding: 15px 40px !important;
    background-color: #D32F2F !important;
    color: #fff !important;
    text-decoration: none !important;
    border-color: #D32F2F !important;
    border-radius: 50px !important;
    transition: background-color 0.3s ease, border-color 0.3s ease !important; font-size: 1.3rem !important;
    border: none !important;
}
body .part-contact-section .button:hover { background-color: #B71C1C !important; border-color: #B71C1C !important; }


/* ==========================================================================
   Pagination Styles
   ========================================================================== */

body .parts-inventory-pagination { clear: both !important; margin-top: 30px !important; margin-bottom: 30px !important; }
body .parts-inventory-pagination ul { list-style: none !important; padding: 0 !important; margin: 0 !important; text-align: center !important; }
body .parts-inventory-pagination ul li { display: inline-block !important; margin: 0 2px !important; }
body .parts-inventory-pagination ul li span, body .parts-inventory-pagination ul li a {
    display: block !important; padding: 8px 15px !important;
    background: #f9f9f9 !important;
    text-decoration: none !important;
    color: #D32F2F !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    transition: background-color 0.3s ease, color 0.3s ease !important;
}
body .parts-inventory-pagination ul li span.current {
    background: #D32F2F !important;
    color: white !important;
    border-color: #D32F2F !important;
    font-weight: bold !important;
}
body .parts-inventory-pagination ul li a:hover {
    background-color: #D32F2F !important;
    color: #fff !important;
    border-color: #D32F2F !important;
}

/* ==========================================================================
   Sale Status Labels (SOLD OUT / Negotiating)
   ========================================================================== */

.part-item-image, .part-card-image, .part-gallery .main-image {
    position: relative !important;
}

.sale-status-label {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 10 !important;
    padding: 5px 12px !important;
    font-weight: bold !important;
    color: #fff !important;
    border-radius: 4px !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.sale-status-label.soldout {
    background-color: #d32f2f !important; /* Red */
}

.sale-status-label.negotiating {
    background-color: #f39c12 !important; /* Orange */
}

/* Detail View Specific */
body .part-gallery .main-image .sale-status-label {
    font-size: 1.1rem !important;
    padding: 8px 20px !important;
    top: 15px !important;
    left: 15px !important;
}

/* Visual cue for soldout items in list */
.part-item.status-soldout img, 
.part-item-card.status-soldout img {
    filter: grayscale(0.5) !important;
    opacity: 0.8 !important;
}
