/*
Theme Name: Ace Auto Theme
Theme URI: https://aceauto.co.za
Author: Ace Auto Style
Author URI: https://aceauto.co.za
Description: Fast, lightweight WordPress theme designed for car parts stores (fitment search, not dealership). Includes cascading Year-Make-Model vehicle search, demo content, Redis object-cache ready AJAX, and mobile-first design optimized for SEO and Core Web Vitals.
Version: 3.3.2
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ace-auto
Tags: e-commerce, woocommerce, custom-menu, featured-images, threaded-comments, translation-ready, blog, one-column, two-columns, right-sidebar, custom-colors, custom-logo, editor-style, theme-options
*/

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f7f7f7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #a61e23; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin-top: 0; line-height: 1.3; color: #111; }

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-content { flex: 1; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 16px;
    position: relative;
}
.site-branding { flex-shrink: 0; }
.site-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: #a61e23;
    text-decoration: none;
}
.site-title:hover { text-decoration: none; color: #8a191d; }

/* Desktop nav – pure CSS dropdowns (no JS library) */
.main-navigation {
    position: relative;
}
.main-navigation > ul,
.main-navigation ul.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px 16px;
    align-items: center;
    flex-wrap: wrap;
}
.main-navigation a {
    color: #333;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 8px 4px;
    text-decoration: none;
    display: block;
}
.main-navigation a:hover,
.main-navigation a:focus {
    color: #a61e23;
}
.main-navigation .menu-item-has-children {
    position: relative;
}
.main-navigation .menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    margin-left: 6px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    vertical-align: middle;
    transform: translateY(2px);
}
.main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.1);
    z-index: 1000;
}
.main-navigation .menu-item-has-children:hover > .sub-menu,
.main-navigation .menu-item-has-children:focus-within > .sub-menu {
    display: block;
}
.main-navigation .sub-menu .menu-item {
    display: block;
    border: 0;
}
.main-navigation .sub-menu a {
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}
.main-navigation .sub-menu a:hover {
    background: #f7f7f7;
    color: #a61e23;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cart-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}
.cart-count {
    background: #a61e23;
    color: #fff;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
}
.menu-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    border-radius: 1px;
    transition: transform 0.25s, opacity 0.25s;
}
.menu-toggle.is-active .menu-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle.is-active .menu-toggle-bar:nth-child(2) { opacity: 0; }
.menu-toggle.is-active .menu-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
@media (max-width: 767px) {
    .menu-toggle { display: flex; }
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #e5e5e5;
        box-shadow: 0 8px 16px rgba(0,0,0,0.08);
        padding: 12px 16px 20px;
        z-index: 999;
    }
    .main-navigation.is-open { display: block; }
    .main-navigation > ul,
    .main-navigation ul.menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .main-navigation li { border-bottom: 1px solid #f0f0f0; }
    .main-navigation a {
        display: block;
        padding: 12px 4px;
        font-size: 1rem;
    }
    /* Submenus open inline on mobile (no hover dependency) */
    .main-navigation .sub-menu {
        display: block;
        position: static;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        padding: 0 0 8px 12px;
        min-width: 0;
        background: transparent;
    }
    .main-navigation .menu-item-has-children > a::after {
        display: none;
    }
    .main-navigation .sub-menu a {
        padding: 8px 4px;
        font-size: 0.92rem;
        font-weight: 500;
        color: #555;
    }
}

/* ==========================================================================
   Trust Bar
   ========================================================================== */
.trust-bar {
    background: #1a1a1a;
    color: #fff;
    font-size: 0.8rem;
    padding: 6px 0;
}
.trust-bar-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
    text-align: center;
}
.trust-item { display: flex; align-items: center; gap: 5px; }

/* ==========================================================================
   Vehicle Search
   ========================================================================== */
/* ========== VEHICLE SEARCH – Ace Auto competitor style ==========
   Centered title + subtitle
   Full-size dropdowns in one centered row
   NOT shrunk, NOT left-aligned
   ============================================================== */
.vehicle-search-section {
    position: relative;
    background: #f7f8fa;
    background-image:
        linear-gradient(180deg, #ffffff 0%, #f4f5f7 100%);
    padding: 20px 0 22px;
    border-bottom: 1px solid #e8e8e8;
    text-align: center;
}
/* Soft parts motif behind (centered, non-dominant) */
.vehicle-search-section::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='160' viewBox='0 0 400 160'%3E%3Cg fill='none' stroke='%23a61e23' stroke-width='3'%3E%3Ccircle cx='80' cy='80' r='40'/%3E%3Ccircle cx='80' cy='80' r='22'/%3E%3Ccircle cx='200' cy='80' r='36'/%3E%3Ccircle cx='200' cy='80' r='18'/%3E%3Ccircle cx='320' cy='80' r='40'/%3E%3Ccircle cx='320' cy='80' r='22'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center 20%;
    background-size: min(900px, 90%) auto;
}
.vehicle-search-section .container {
    position: relative;
    z-index: 1;
}
.ace-hero-bg { display: none !important; }

.ace-vs-wrapper {
    max-width: 920px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
}
.ace-vs-heading {
    display: block;
    text-align: center;
    margin: 0 0 18px;
}
.ace-vs-title {
    margin: 0 0 6px;
    font-size: 1.65rem;
    font-weight: 700;
    color: #111;
    line-height: 1.25;
    text-align: center;
    text-shadow: none;
}
.ace-vs-subtitle {
    margin: 0;
    font-size: 1rem;
    color: #666;
    text-align: center;
}
.ace-vs-notice {
    margin: 0 auto 14px;
    max-width: 920px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: left;
}
.ace-vs-notice--warning { background: #fff8e6; border: 1px solid #f0d78c; color: #7a5b00; }
.ace-vs-notice--error { background: #fdecea; border: 1px solid #f5c6cb; color: #721c24; }
.ace-vs-notice--info { background: #e8f4fd; border: 1px solid #b8daff; color: #004085; }

/* Search form – full size, centered row like Ace Auto */
.ace-vs-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 920px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    text-align: left;
}
.ace-vs-field {
    width: 100%;
    flex: 1 1 auto;
}
.ace-vs-select {
    width: 100%;
    height: 52px;
    padding: 0 40px 0 16px;
    font-size: 1rem;
    color: #333;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M1.41 0L6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    appearance: none;
    cursor: pointer;
    box-sizing: border-box;
}
.ace-vs-select:focus {
    outline: none;
    border-color: #a61e23;
    box-shadow: 0 0 0 3px rgba(166,30,35,0.18);
}
.ace-vs-select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}
.ace-vs-button {
    width: 100%;
    height: 52px;
    padding: 0 28px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: #a61e23;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
}
.ace-vs-button:hover:not(:disabled) { background: #8a191d; }
.ace-vs-button:disabled {
    background: #c5c5c5;
    cursor: not-allowed;
}

/* Desktop: one centered horizontal row – equal dropdowns + search */
@media (min-width: 768px) {
    .vehicle-search-section {
        padding: 32px 0 36px;
    }
    .ace-vs-title {
        font-size: 1.85rem;
    }
    .ace-vs-subtitle {
        font-size: 1.05rem;
        margin-bottom: 0;
    }
    .ace-vs-heading {
        margin-bottom: 22px;
    }
    .ace-vs-form {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: center;
        gap: 12px;
        max-width: 920px;
    }
    .ace-vs-field {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
    }
    .ace-vs-submit-wrap {
        flex: 0 0 auto;
        width: auto;
        min-width: 150px;
    }
    .ace-vs-select {
        height: 52px;
        font-size: 1rem;
    }
    .ace-vs-button {
        width: 100%;
        min-width: 150px;
        height: 52px;
        font-size: 1.1rem;
    }
}

@media (min-width: 992px) {
    .ace-vs-form {
        max-width: 980px;
    }
    .ace-vs-submit-wrap {
        min-width: 160px;
    }
}

.offers-banner {
    background: #a61e23;
    color: #fff;
    text-align: center;
    padding: 20px 16px;
}
.offers-banner h2 { margin: 0 0 8px; color: #fff; font-size: 1.35rem; }
.countdown {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 12px 0;
    font-size: 1.25rem;
    font-weight: 700;
}
.countdown span {
    background: rgba(0,0,0,0.25);
    padding: 6px 10px;
    border-radius: 4px;
    min-width: 56px;
}
.btn-white {
    display: inline-block;
    margin-top: 6px;
    padding: 10px 22px;
    background: #fff;
    color: #a61e23;
    font-weight: 700;
    border-radius: 4px;
}
.btn-white:hover { background: #f0f0f0; text-decoration: none; }

/* ==========================================================================
   Sections & Product Cards
   ========================================================================== */
.section { padding: 28px 0; }
.section-alt { background: #fff; }
.section-title { text-align: center; margin-bottom: 8px; font-size: 1.5rem; }
.section-subtitle { text-align: center; color: #666; margin: 0 0 16px; font-size: 0.95rem; }

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (min-width: 600px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .products-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    border-color: #a61e23;
}
.badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #a61e23;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    z-index: 2;
}
.product-placeholder {
    height: 130px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-placeholder svg { opacity: 0.9; }
.product-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-title {
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    flex: 1;
}
.price {
    font-weight: 700;
    color: #a61e23;
    font-size: 1.05rem;
    margin-bottom: 8px;
}
.price del {
    color: #999;
    font-weight: 400;
    font-size: 0.85rem;
    margin-right: 4px;
}
.price ins { text-decoration: none; }
.btn-view-product {
    display: inline-block;
    text-align: center;
    padding: 7px 12px;
    background: #f5f5f5;
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
}
.btn-view-product:hover {
    background: #a61e23;
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #1a1a1a;
    color: #ccc;
    padding: 36px 0 18px;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    margin-bottom: 28px;
}
@media (min-width: 600px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
}
.site-footer h4 { color: #fff; margin-bottom: 10px; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 5px; }
.site-footer a { color: #ccc; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 14px;
    text-align: center;
    font-size: 0.85rem;
}

/* WooCommerce basic */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (min-width: 768px) {
    .woocommerce ul.products { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .woocommerce ul.products { grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   AJAX Results Section (Homepage + Shop)
   ========================================================================== */
.ace-ajax-results-section {
    background: #fff;
    border-top: 3px solid #a61e23;
    padding: 36px 0 48px;
}
.ace-results-header {
    text-align: center;
    margin-bottom: 24px;
}
.ace-results-meta {
    color: #666;
    margin: 4px 0 8px;
    font-size: 0.95rem;
}
.ace-clear-link {
    font-size: 0.9rem;
    font-weight: 600;
}
.ace-ajax-results .products-grid {
    margin-top: 8px;
}
.ace-loading {
    text-align: center;
    padding: 40px 20px;
    color: #a61e23;
    font-weight: 600;
}
.ace-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #f0f0f0;
    border-top-color: #a61e23;
    border-radius: 50%;
    animation: ace-spin 0.7s linear infinite;
}
@keyframes ace-spin {
    to { transform: rotate(360deg); }
}
.ace-no-results {
    text-align: center;
    padding: 32px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
}
.product-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}
.product-card-image img,
.product-card-image .ace-product-img,
.product-card-image .attachment-woocommerce_thumbnail {
    width: 100%;
    height: 100%;
    max-height: 180px;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: 0;
    padding: 8px;
    box-sizing: border-box;
}
.product-card-image .product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-title a {
    color: inherit;
    text-decoration: none;
}
.product-title a:hover {
    color: #a61e23;
}

/* ==========================================================================
   Load More button
   ========================================================================== */
.ace-load-more-wrap {
    text-align: center;
    margin-top: 28px;
}
.ace-load-more-btn {
    display: inline-block;
    min-width: 200px;
    height: 48px;
    padding: 0 28px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: #a61e23;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.ace-load-more-btn:hover:not(:disabled) {
    background: #8a191d;
}
.ace-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ==========================================================================
   Sticky “Change vehicle” bar
   ========================================================================== */
.ace-sticky-vehicle {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    color: #fff;
    padding: 10px 0;
    z-index: 1100;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.ace-sticky-vehicle.is-visible {
    transform: translateY(0);
}
.ace-sticky-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.ace-sticky-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}
.ace-sticky-icon {
    font-size: 1.2rem;
}
.ace-sticky-actions {
    display: flex;
    gap: 8px;
}
.ace-sticky-btn {
    height: 36px;
    padding: 0 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background: #a61e23;
    color: #fff;
}
.ace-sticky-btn:hover {
    background: #8a191d;
}
.ace-sticky-btn--ghost {
    background: transparent;
    border: 1px solid #666;
    color: #ccc;
}
.ace-sticky-btn--ghost:hover {
    border-color: #fff;
    color: #fff;
    background: transparent;
}

/* Add bottom padding when sticky bar is visible so content isn't hidden */
body:has(.ace-sticky-vehicle.is-visible) {
    padding-bottom: 60px;
}
@supports not selector(:has(*)) {
    .ace-sticky-vehicle.is-visible ~ * {
        /* fallback not critical */
    }
}

@media (max-width: 480px) {
    .ace-sticky-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .ace-sticky-label {
        justify-content: center;
    }
    .ace-sticky-actions {
        justify-content: center;
    }
}

/* ==========================================================================
   Parts categories grid
   ========================================================================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (min-width: 600px) {
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .categories-grid { grid-template-columns: repeat(4, 1fr); }
}
.category-card {
    background: #fff;
    border-radius: 6px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: none;
    border: 1px solid #e8e8e8;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}
.category-card:hover {
    border-color: #a61e23;
    text-decoration: none;
    color: inherit;
}
.category-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}
.category-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: #111;
}
.category-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

/* Why buy from us */
.why-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 8px;
}
@media (min-width: 600px) {
    .why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .why-grid { grid-template-columns: repeat(4, 1fr); }
}
.why-item {
    background: #fff;
    border-radius: 6px;
    padding: 18px 14px;
    text-align: center;
    box-shadow: none;
    border: 1px solid #e8e8e8;
}
.why-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}
.why-item h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}
.why-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* Ace-style product meta */
.product-sku {
    font-size: 0.75rem;
    color: #888;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}
.badge-cond {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    z-index: 2;
}
.badge-cond--new {
    background: #1a7f37;
    color: #fff;
}
.badge-cond--used {
    background: #555;
    color: #fff;
}
.offers-sub {
    margin: 0 0 8px;
    opacity: 0.9;
    font-size: 0.95rem;
}
.countdown span {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}
.countdown small {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.85;
    margin-top: 2px;
}


/* ==========================================================================
   AutoZone-style homepage wireframe
   ========================================================================== */
.az-vehicle-block {
    background: #f5f6f8;
    background-image: linear-gradient(180deg, #fff 0%, #f0f2f5 100%);
    padding: 20px 0 18px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}
.az-vehicle-intro {
    max-width: 720px;
    margin: 0 auto 14px;
}
.az-vehicle-title {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 800;
    color: #111;
    line-height: 1.2;
}
.az-vehicle-sub {
    margin: 0;
    font-size: 1.05rem;
    color: #555;
}
.az-vehicle-hint {
    margin: 14px 0 0;
    font-size: 0.9rem;
    color: #666;
}
.az-vehicle-hint a {
    font-weight: 600;
    color: #a61e23;
}

/* Inside AZ block: search form full size, centered */
.az-vehicle-block .ace-vs-wrapper {
    max-width: 980px;
    margin: 0 auto;
}
.az-vehicle-block .ace-vs-form {
    max-width: 980px;
    margin: 0 auto;
}
.az-vehicle-block .ace-vs-select,
.az-vehicle-block .ace-vs-button {
    height: 52px;
}

/* Promo strip layout */
.az-promo-strip .az-promo-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}
.az-promo-badge {
    display: inline-block;
    background: #fff;
    color: #a61e23;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 3px;
    margin-bottom: 6px;
}
.az-promo-text h2 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 1.4rem;
}
@media (min-width: 768px) {
    .az-vehicle-title { font-size: 2rem; }
    .az-promo-strip .az-promo-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        flex-wrap: wrap;
    }
    .az-promo-text { flex: 1 1 200px; }
}

/* Section heads with View all */
.az-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.az-section-head .section-title {
    margin: 0;
    text-align: left;
}
.az-section-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: #a61e23;
    white-space: nowrap;
}
.az-section-link:hover {
    text-decoration: underline;
}

/* Categories a bit more AutoZone-like */
.az-categories .category-card {
    border: 1px solid #eee;
}
.az-categories .category-card:hover {
    border-color: #a61e23;
}

.az-services-grid .why-item {
    border-top: 3px solid #a61e23;
}


/* ==========================================================================
   WooCommerce Shop – alignment & layout fixes
   ========================================================================== */
.woocommerce-page-wrap,
.woocommerce-page .site-content {
    padding: 24px 0 48px;
    background: #f7f8fa;
}
.shop-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}
.shop-page-header {
    margin-bottom: 20px;
    text-align: left;
}
.shop-page-header .page-title {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 800;
    color: #111;
}

/* Reset WC default floats – use CSS grid */
.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 0 0 24px !important;
    padding: 0 !important;
    list-style: none !important;
    clear: both;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after {
    display: none !important;
    content: none !important;
}
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
    border: 1px solid #e8e8e8;
    position: relative;
    box-sizing: border-box;
}
@media (min-width: 600px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 992px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Product card internals – featured images visible & sharp */
.woocommerce ul.products li.product .product-card-image,
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 180px;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
}
.woocommerce ul.products li.product .product-card-image img,
.woocommerce ul.products li.product img.attachment-woocommerce_thumbnail,
.woocommerce ul.products li.product img.ace-product-img,
.woocommerce ul.products li.product img {
    width: 100% !important;
    height: 100% !important;
    max-height: 180px !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 !important;
    padding: 8px;
    box-sizing: border-box;
    display: block !important;
}
.woocommerce ul.products li.product .product-card-body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .product-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
    color: #111;
}
.woocommerce ul.products li.product .price {
    margin: 4px 0;
    font-size: 1rem;
    font-weight: 700;
    color: #a61e23;
}
.woocommerce ul.products li.product .price del {
    color: #999;
    font-weight: 500;
    margin-right: 6px;
}
.woocommerce ul.products li.product .price ins {
    text-decoration: none;
    color: #a61e23;
}
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .btn-view-product {
    margin-top: auto;
    display: inline-block;
    text-align: center;
    padding: 8px 12px;
    background: #a61e23;
    color: #fff !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    text-decoration: none;
}
.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .btn-view-product:hover {
    background: #8a191d;
    color: #fff !important;
}

/* Sale badge alignment */
.woocommerce span.onsale,
.woocommerce ul.products li.product .badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: #a61e23;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    min-height: 0;
    line-height: 1.2;
    margin: 0;
}

/* Toolbar / result count / ordering – aligned row */
.woocommerce .woocommerce-result-count,
.woocommerce-page .woocommerce-result-count {
    float: none;
    margin: 0;
}
.woocommerce .woocommerce-ordering,
.woocommerce-page .woocommerce-ordering {
    float: none;
    margin: 0;
}
.woocommerce .woocommerce-products-header,
.shop-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
/* Force toolbar items in one row when both present */
.woocommerce .woocommerce-notices-wrapper + .woocommerce-result-count,
.woocommerce .woocommerce-result-count {
    display: inline-block;
}
.woocommerce .woocommerce-ordering {
    display: inline-block;
}
body.woocommerce ul.products::before { content: none !important; }

/* Pagination centered */
.woocommerce nav.woocommerce-pagination {
    text-align: center;
    margin: 24px 0 0;
}
.woocommerce nav.woocommerce-pagination ul {
    display: inline-flex;
    gap: 6px;
    border: 0;
    margin: 0;
    padding: 0;
}
.woocommerce nav.woocommerce-pagination ul li {
    border: 0;
    margin: 0;
}
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: block;
    min-width: 40px;
    height: 40px;
    line-height: 40px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

/* Empty / coming soon override look */
.shop-empty-state {
    text-align: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 48px 24px;
    margin: 24px 0;
}
.shop-empty-state h2 {
    margin: 0 0 8px;
}
.shop-empty-state .button {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 20px;
    background: #a61e23;
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
}

/* Single product basic alignment */
.single-product-layout .product {
    display: grid;
    gap: 24px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}
@media (min-width: 768px) {
    .single-product-layout .product {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}
.single-product div.product .woocommerce-product-gallery {
    margin: 0;
}
.single-product div.product .summary {
    margin: 0;
    float: none;
    width: 100%;
}
.single-product .quantity .qty {
    width: 80px;
    height: 44px;
    padding: 0 10px;
}
.single-product .single_add_to_cart_button {
    height: 44px;
    padding: 0 24px;
    background: #a61e23 !important;
    border: none !important;
    font-weight: 700;
}

/* Breadcrumbs */
.woocommerce .woocommerce-breadcrumb {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: #666;
}

/* Hide broken coming-soon giant empty if WC outputs nothing */
.woocommerce-info {
    border-top-color: #a61e23;
}

/* ==========================================================================
   Shop sidebar filters
   ========================================================================== */
.shop-with-sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}
@media (min-width: 900px) {
    .shop-with-sidebar {
        grid-template-columns: 260px 1fr;
        gap: 28px;
    }
}
.shop-sidebar-col {
    position: relative;
}
.ace-filter-toggle {
    display: block;
    width: 100%;
    height: 44px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-weight: 700;
    color: #111;
    cursor: pointer;
}
@media (min-width: 900px) {
    .ace-filter-toggle { display: none; }
}
.shop-sidebar-inner {
    display: none;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.shop-sidebar-inner.is-open {
    display: block;
}
@media (min-width: 900px) {
    .shop-sidebar-inner {
        display: block;
        position: sticky;
        top: 16px;
    }
}
.ace-shop-filters .shop-widget {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.ace-shop-filters .shop-widget:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}
.shop-widget-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111;
}
.ace-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ace-filter-list li {
    margin: 0 0 8px;
}
.ace-filter-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}
.ace-filter-count {
    color: #999;
    font-size: 0.8rem;
}
.ace-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ace-price-row input {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}
.ace-filter-select {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 0.9rem;
}
.ace-filter-submit {
    width: 100%;
    height: 44px;
    background: #a61e23;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 8px;
}
.ace-filter-submit:hover { background: #8a191d; }
.ace-filter-reset,
.ace-filter-clear {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a61e23;
}
.ace-filter-vehicle-label {
    margin: 0 0 8px;
    font-weight: 600;
    color: #111;
}
.shop-products-col {
    min-width: 0;
}
/* 3 cols next to sidebar on desktop */
@media (min-width: 900px) {
    .shop-with-sidebar .woocommerce ul.products,
    .shop-with-sidebar.woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (min-width: 1200px) {
    .shop-with-sidebar .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}


/* AJAX shop filter loading + spinner */
.shop-products-col {
    position: relative;
}
.shop-products-col.is-filtering ul.products {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.ace-shop-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #eee;
    border-radius: 8px;
    color: #a61e23;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.ace-shop-loading .ace-spinner {
    width: 36px;
    height: 36px;
    margin: 0;
    border: 3px solid #f0f0f0;
    border-top-color: #a61e23;
    border-radius: 50%;
    animation: ace-spin 0.65s linear infinite;
}
.ace-shop-loading p {
    margin: 0;
}

/* Shared spinner (homepage AJAX + shop) */
.ace-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #f0f0f0;
    border-top-color: #a61e23;
    border-radius: 50%;
    animation: ace-spin 0.7s linear infinite;
    box-sizing: border-box;
}
.ace-spinner--sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
    margin: 0;
}
.ace-spinner--lg {
    width: 56px;
    height: 56px;
    border-width: 4px;
}
@keyframes ace-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Overlay spinner option (centered over grid) */
.shop-products-col.is-filtering::after {
    content: "";
    position: absolute;
    top: 80px;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    border: 3px solid #f0f0f0;
    border-top-color: #a61e23;
    border-radius: 50%;
    animation: ace-spin 0.7s linear infinite;
    z-index: 5;
    pointer-events: none;
}


/* Vehicle compatibility badges */
.ace-fit-badge {
    font-size: 0.75rem;
    color: #555;
    background: #f0f4f8;
    border-radius: 3px;
    padding: 3px 8px;
    margin: 4px 0;
    display: inline-block;
    line-height: 1.3;
}
.ace-fitment-box {
    margin: 16px 0 20px;
    padding: 14px 16px;
    background: #f7f8fa;
    border-left: 4px solid #a61e23;
    border-radius: 4px;
}
.ace-fitment-box h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}
.ace-fitment-box ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.ace-fitment-box li {
    margin: 4px 0;
    font-size: 0.9rem;
    color: #333;
}


/* ==========================================================================
   Tight layout + performance / SEO helpers
   ========================================================================== */
html { scroll-behavior: smooth; }
body {
    text-rendering: optimizeLegibility;
}
img, video, iframe {
    max-width: 100%;
    height: auto;
}
img[loading="lazy"] { content-visibility: auto; }

/* Kill unnecessary vertical gaps */
.site-content > .section:first-child,
.az-home > .az-vehicle-block {
    margin-top: 0;
}
.section { padding: 24px 0; }
.section + .section { border-top: 1px solid transparent; }
.section-title { margin-bottom: 6px; }
.az-section-head { margin-bottom: 12px; }
.products-grid { gap: 14px; }
.categories-grid { gap: 12px; }
.why-grid { gap: 12px; margin-top: 4px; }

/* Container: consistent, not oversized empty padding */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

/* Header compact */
.site-header .header-inner { padding-top: 10px; padding-bottom: 10px; }
.trust-bar { padding: 5px 0; }

/* Offers banner tighter */
.offers-banner,
.az-promo-strip {
    padding: 16px;
}
.countdown { margin: 8px 0; }

/* Footer tighter */
.site-footer { padding: 28px 0 16px; }
.site-info { padding: 12px 0; margin-top: 16px; }

/* Shop: less empty air */
.woocommerce-page-wrap { padding: 16px 0 32px; }
.shop-page-header { margin-bottom: 12px; }

/* Prefer content-box sizing everywhere */
*, *::before, *::after { box-sizing: border-box; }

/* Reduce CLS: product image area fixed */
.woocommerce ul.products li.product .product-card-image,
.product-placeholder {
    aspect-ratio: 1 / 0.75;
    height: auto;
    min-height: 140px;
}

/* Print / SEO: visible focus for a11y */
a:focus-visible, button:focus-visible, select:focus-visible {
    outline: 2px solid #a61e23;
    outline-offset: 2px;
}

/* Hide empty paragraphs some builders inject */
p:empty { display: none; }

/* Hero width fix – not full-page wide */
.az-vehicle-block {
    padding: 16px 0 14px !important;
    background: #fff !important;
    border-bottom: 1px solid #e8e8e8;
}
.az-vehicle-block .container {
    max-width: 900px !important;
}
.az-vehicle-title {
    font-size: 1.35rem !important;
}
.az-vehicle-sub {
    font-size: 0.9rem !important;
}
.az-vehicle-block .ace-vs-wrapper,
.az-vehicle-block .ace-vs-form {
    max-width: 100% !important;
}
.vehicle-search-section {
    padding: 16px 0 18px !important;
}
.vehicle-search-section .container,
.ace-vs-wrapper,
.ace-vs-form {
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.ace-vs-form {
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
}

/* ==========================================================================
   Homepage Blog + section heads
   ========================================================================== */
.az-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.az-section-head .section-title { margin-bottom: 0; }
.az-section-link {
    font-weight: 600;
    color: #a61e23;
    text-decoration: none;
    font-size: 0.95rem;
}
.az-section-link:hover { text-decoration: underline; }

.ace-blog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}
@media (max-width: 1024px) {
    .ace-blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .ace-blog-grid { grid-template-columns: 1fr; }
}
.ace-blog-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.ace-blog-card:hover {
    border-color: #d0d0d0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.ace-blog-thumb {
    display: block;
    height: 140px;
    overflow: hidden;
    background: #f0f0f0;
}
.ace-blog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ace-blog-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}
.ace-blog-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #a61e23;
}
.ace-blog-title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.35;
}
.ace-blog-title a {
    color: #1a1a1a;
    text-decoration: none;
}
.ace-blog-title a:hover { color: #a61e23; }
.ace-blog-meta {
    margin: 0;
    font-size: 0.8rem;
    color: #888;
}
.ace-blog-excerpt {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.45;
    flex: 1;
}
.ace-blog-more {
    margin-top: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #a61e23;
    text-decoration: none;
}
.ace-blog-more:hover { text-decoration: underline; }
