/* product-listing.css — JP Spare Parts Plugin
 * Extracted from mu-plugins/jpspareparts-product-listing.php (inline CSS via
 * wp_add_inline_style in wp_enqueue_scripts callback).
 * Loaded on is_woocommerce_archive() via class-assets.php (handle: jps-product-listing)
 */

/* ===== Category page: hide Astra archive title (keep custom brand banner) ===== */
body.tax-product_cat .ast-archive-description,
body.tax-product_cat .ast-archive-title {
    display: none !important;
}

/* ===== Layout: sidebar + main content ===== */
.jps-listing-wrap {
    max-width: 1280px;
    margin: 30px auto 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.jps-cat-sidebar {
    flex: 0 0 240px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    position: sticky;
    top: 20px;
}
.jps-cat-title {
    font-size: 1rem;
    font-weight: 800;
    color: #011627;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #011627;
}
.jps-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.jps-cat-list li { margin: 0; }
.jps-cat-item {
    display: block;
    padding: 10px 14px;
    color: #011627;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s;
}
.jps-cat-item:hover {
    background: #f5f5f5;
    color: #ff6b35;
}
.jps-cat-item.active {
    background: #1e40af;
    color: #fff;
    font-weight: 600;
}
.jps-listing-main {
    flex: 1;
    min-width: 0;
}

/* ===== Products header (title + result count + ordering) ===== */
.woocommerce-products-header {
    max-width: 100%;
    margin: 0 0 20px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 16px;
}
.woocommerce-products-header h1.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: #011627;
    margin: 0;
}
.woocommerce .woocommerce-result-count {
    color: #999;
    font-size: 0.85rem;
    margin: 0 0 12px 0 !important;
    float: left !important;
}
.woocommerce .woocommerce-ordering {
    margin: 0 0 12px 0 !important;
    float: right !important;
}
.woocommerce .woocommerce-ordering select {
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #fff;
    color: #333;
}

/* Clearfix for result count + ordering float rows */
.ast-woocommerce-container::after {
    content: "";
    display: table;
    clear: both;
}

/* ===== Brand Quick Nav buttons (4-grid) ===== */
.jps-brand-quick-nav {
    max-width: 100%;
    margin: 0 0 24px 0;
    padding: 0;
}
.jps-nav-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.jps-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #011627;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1px;
    transition: all 0.25s ease;
}
.jps-nav-btn:hover {
    color: #ff6b35;
    border-color: #ff6b35;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,107,53,0.12);
}
.jps-nav-btn.active {
    background: #ff6b35;
    border-color: #ff6b35;
    color: #fff;
}

/* ===== Brand Category Banner (compact) ===== */
.jps-brand-banner {
    background: linear-gradient(135deg, #011627, #0a2540);
    padding: 22px 30px;
    margin-bottom: 20px;
    text-align: center;
    border-radius: 8px;
}
.jps-brand-banner-inner { max-width: 100%; margin: 0; }
.jps-brand-badge {
    display: inline-block;
    background: rgba(255,107,53,0.15);
    color: #ff6b35;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    padding: 3px 10px;
    border-radius: 3px;
    margin-bottom: 8px;
}
.jps-brand-title {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: 1.5px;
}
.jps-brand-desc {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 100%;
    margin: 0 0 10px;
}
.jps-brand-count {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 20px;
    border-radius: 20px;
}

/* ===== Product Cards ===== */
.woocommerce ul.products li.product {
    text-align: center;
}
.woocommerce ul.products li.product .button { margin: 0 auto; }

.jps-product-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0 8px;
}
.jps-product-brand {
    background: #011627;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}
.jps-product-code { color: #999; font-size: 0.78rem; }

.jps-quote-btn {
    background: #ff6b35 !important;
    color: #fff !important;
    padding: 8px 20px !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border: none !important;
    margin-top: 6px !important;
    transition: all 0.2s;
}
.jps-quote-btn:hover {
    background: #e55a2b !important;
    transform: translateY(-1px);
    color: #fff !important;
}

/* ===== Mobile ===== */
@media (max-width: 767px) {
    .jps-listing-wrap { flex-direction: column; gap: 20px; }
    .jps-cat-sidebar { flex: 0 0 auto; position: relative; top: 0; width: 100%; }
    .jps-nav-buttons { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .jps-nav-btn { padding: 40px 16px; font-size: 1.1rem; }
    .jps-brand-banner { padding: 32px 16px; }
    .jps-brand-title { font-size: 1.6rem; }
    .jps-brand-desc { font-size: 0.9rem; }
    .woocommerce-products-header h1.page-title { font-size: 1.5rem; }
    .woocommerce .woocommerce-ordering { display: none; }
}
