/*
 Theme Name:   AAM Performance
 Theme URI:    https://aam.ormsy.co.za
 Description:  Astra child theme for All American Muscle.
 Author:       OpenRoad Media
 Template:     astra
 Version:      3.2.0
 Text Domain:  aam-performance
*/

:root {
    --aam-red: #E83236;
    --aam-red-hover: #c82a2e;
    --aam-bg: #3c3535;
    --aam-bg-deep: #2a2424;
    --aam-text: #ffffff;
    --aam-text-soft: #fffff8;
    --aam-cream: #f1f0dd;
}

/* ==========================================================================
   Header — red border accent
   ========================================================================== */

.site-header {
    border-bottom: 3px solid var(--aam-red);
}

.custom-logo-link img {
    max-height: 80px;
    width: auto;
}

/* ==========================================================================
   Astra container backgrounds — match dark theme
   ========================================================================== */

.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post,
.ast-separate-container .ast-woocommerce-container {
    background-color: var(--aam-bg);
}

/* ==========================================================================
   Cover blocks
   ========================================================================== */

.wp-block-cover {
    border-bottom: 6px solid var(--aam-red);
}

.wp-block-cover h1,
.wp-block-cover h2 {
    color: #ffffff !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* ==========================================================================
   Light background sections — dark text override
   ========================================================================== */

.wp-block-group.has-background[style*="background-color:#f5f5f5"],
.wp-block-group.has-background[style*="background-color: #f5f5f5"] {
    color: #333333;
}

.wp-block-group.has-background[style*="background-color:#f5f5f5"] p,
.wp-block-group.has-background[style*="background-color:#f5f5f5"] li,
.wp-block-group.has-background[style*="background-color:#f5f5f5"] td,
.wp-block-group.has-background[style*="background-color:#f5f5f5"] th,
.wp-block-group.has-background[style*="background-color: #f5f5f5"] p,
.wp-block-group.has-background[style*="background-color: #f5f5f5"] li,
.wp-block-group.has-background[style*="background-color: #f5f5f5"] td,
.wp-block-group.has-background[style*="background-color: #f5f5f5"] th {
    color: #333333 !important;
}

.wp-block-group.has-background[style*="background-color:#f5f5f5"] h2,
.wp-block-group.has-background[style*="background-color:#f5f5f5"] h3,
.wp-block-group.has-background[style*="background-color: #f5f5f5"] h2,
.wp-block-group.has-background[style*="background-color: #f5f5f5"] h3 {
    color: var(--aam-red) !important;
}

.wp-block-group.has-background[style*="background-color:#f5f5f5"] a,
.wp-block-group.has-background[style*="background-color: #f5f5f5"] a {
    color: var(--aam-red);
}

/* FAQ accordion on light bg */
.wp-block-group.has-background[style*="background-color:#f5f5f5"] .resto-faq-question,
.wp-block-group.has-background[style*="background-color:#f5f5f5"] .resto-faq-answer,
.wp-block-group.has-background[style*="background-color:#f5f5f5"] .resto-faq-answer p {
    color: #333333 !important;
}

/* ==========================================================================
   Striped tables — dark theme fix
   ========================================================================== */

.is-style-stripes tbody tr:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

.is-style-stripes tbody tr:nth-child(even) {
    background-color: transparent !important;
}

.is-style-stripes thead {
    border-bottom: 2px solid var(--aam-red);
}

.is-style-stripes thead th {
    color: var(--aam-red) !important;
}

.is-style-stripes td,
.is-style-stripes th {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Striped tables inside light bg */
.wp-block-group.has-background[style*="background-color:#f5f5f5"] .is-style-stripes tbody tr:nth-child(odd),
.wp-block-group.has-background[style*="background-color: #f5f5f5"] .is-style-stripes tbody tr:nth-child(odd) {
    background-color: #e8e8e8 !important;
}

.wp-block-group.has-background[style*="background-color:#f5f5f5"] .is-style-stripes td,
.wp-block-group.has-background[style*="background-color:#f5f5f5"] .is-style-stripes th,
.wp-block-group.has-background[style*="background-color: #f5f5f5"] .is-style-stripes td,
.wp-block-group.has-background[style*="background-color: #f5f5f5"] .is-style-stripes th {
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #333 !important;
}

/* ==========================================================================
   Stats bar
   ========================================================================== */

.resto-stats-bar {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   WooCommerce — dark theme additions
   ========================================================================== */

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    background: var(--aam-bg-deep);
    padding: 15px;
    border: 1px solid #4a4242;
    transition: border-color 0.2s, transform 0.2s;
}

.woocommerce ul.products li.product:hover {
    border-color: var(--aam-red);
    transform: translateY(-3px);
}

.woocommerce ul.products li.product a img {
    background: #fff;
    padding: 8px;
    margin-bottom: 12px;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px;
    text-transform: none;
}

.woocommerce span.onsale {
    background: var(--aam-red) !important;
    border-radius: 0 !important;
}

.woocommerce-product-gallery__image img {
    background: #fff;
    border: 1px solid #4a4242;
}

/* Product tabs — Description / Reviews / etc */
.woocommerce-tabs ul.tabs.wc-tabs {
    margin: 0 0 0 0 !important;
    padding: 0 !important;
    border-bottom: 2px solid var(--aam-red) !important;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.woocommerce-tabs ul.tabs.wc-tabs::before {
    display: none !important;
}

.woocommerce-tabs ul.tabs li {
    background: var(--aam-bg-deep) !important;
    border: 1px solid #4a4242 !important;
    border-bottom: none !important;
    border-radius: 6px 6px 0 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: background 0.15s ease;
}

.woocommerce-tabs ul.tabs li::before,
.woocommerce-tabs ul.tabs li::after {
    display: none !important;
}

.woocommerce-tabs ul.tabs li a {
    display: inline-block;
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--aam-text) !important;
    text-decoration: none !important;
}

.woocommerce-tabs ul.tabs li:hover {
    background: var(--aam-bg) !important;
    border-color: #6a6060 !important;
}

.woocommerce-tabs ul.tabs li.active {
    background: var(--aam-red) !important;
    border-color: var(--aam-red) !important;
}

.woocommerce-tabs ul.tabs li.active a {
    color: #fff !important;
}

.woocommerce-tabs .panel,
.woocommerce-tabs .woocommerce-Tabs-panel {
    background: var(--aam-bg-deep);
    padding: 24px 28px !important;
    margin: 0 !important;
    border: 1px solid #4a4242;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.woocommerce-tabs .panel h2:first-child,
.woocommerce-tabs .woocommerce-Tabs-panel h2:first-child {
    display: none;
}

.woocommerce table.shop_table {
    background: var(--aam-bg-deep);
    border: 1px solid #4a4242;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    border-color: #4a4242;
}

.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
    background: var(--aam-bg-deep) !important;
    border-top-color: var(--aam-red) !important;
}

.woocommerce .quantity input.qty {
    background: var(--aam-bg-deep);
    border: 1px solid #fff;
}

/* Sidebar / Widgets */
.widget,
.widget-area,
.sidebar,
#secondary,
.ast-woo-sidebar,
.widget_product_categories,
.widget_layered_nav,
.woocommerce-widget-layered-nav {
    color: #fff;
}

.widget-title,
.widget h2,
.widget h3,
.widget h4 {
    color: var(--aam-red) !important;
}

.widget a,
.widget li,
.widget label,
.widget .count,
.wc-block-product-categories-list-item a,
.wc-block-checkbox-list label {
    color: #fff !important;
}

.widget a:hover {
    color: var(--aam-red) !important;
}

/* Pagination */
.page-numbers,
nav.woocommerce-pagination ul li a,
nav.woocommerce-pagination ul li span {
    background: var(--aam-bg-deep) !important;
    border-color: #4a4242 !important;
}

.page-numbers.current,
nav.woocommerce-pagination ul li span.current {
    background: var(--aam-red) !important;
    color: #fff !important;
}

/* ==========================================================================
   Service cards
   ========================================================================== */

.aam-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.aam-service {
    background: var(--aam-bg-deep);
    border: 1px solid #4a4242;
    border-top: 4px solid var(--aam-red);
    padding: 40px 30px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.aam-service:hover {
    transform: translateY(-4px);
    border-color: var(--aam-red);
}

/* ==========================================================================
   Hide Astra default footer
   ========================================================================== */

footer#colophon.site-footer {
    display: none !important;
}

/* ==========================================================================
   Custom Footer
   ========================================================================== */

.aam-footer {
    background: var(--aam-bg-deep);
    color: var(--aam-cream);
}

.aam-footer-top {
    padding: 50px 20px 40px;
}

.aam-footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.2fr;
    gap: 40px;
    align-items: start;
}

.aam-footer h4 {
    color: var(--aam-red) !important;
    font-family: "Montserrat", sans-serif !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 18px;
    padding: 0;
    border: none;
    display: block;
}

.aam-footer p { color: var(--aam-cream); }
.aam-footer a { color: var(--aam-cream); text-decoration: none; transition: color 0.2s; }
.aam-footer a:hover { color: var(--aam-red); }

.aam-footer-logo-col { display: block; }
.aam-footer-logo-col > a:first-child { display: inline-block; margin-bottom: 16px; }
.aam-footer-logo { max-width: 200px; height: auto; }
.aam-footer-site-title { font-family: "Montserrat", sans-serif; font-size: 22px; font-weight: 900; color: #fff !important; display: block; }

.aam-footer-links { list-style: none; margin: 0; padding: 0; }
.aam-footer-links li { padding: 0; margin: 0 0 6px; }
.aam-footer-links li a { display: block; padding: 3px 0; font-size: 14px; color: var(--aam-cream); }
.aam-footer-links li a:hover { color: var(--aam-red); }

.aam-contact-list { display: flex; flex-direction: column; gap: 10px; }
.aam-contact-list a { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--aam-cream); }
.aam-contact-list a:hover { color: var(--aam-red); }
.aam-contact-list .material-symbols-outlined { font-size: 20px; color: var(--aam-red); flex-shrink: 0; }

.aam-footer-tagline { font-size: 14px; line-height: 1.6; color: var(--aam-cream); margin: 0 0 18px; max-width: 340px; }

.aam-footer-bottom {
    max-width: 100%;
    margin: 0;
    padding: 18px 20px;
    border-top: 1px solid #4a4242;
    text-align: center;
    font-size: 13px;
    color: #999;
    background: var(--aam-bg-deep);
}

@media (max-width: 900px) {
    .aam-footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 600px) {
    .aam-footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .aam-footer-logo-col { justify-content: center; }
}

/* ==========================================================================
   Social Icons
   ========================================================================== */

.aam-social-icons { display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-start; }
.aam-social-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: #ffffff; background: rgba(255,255,255,0.08); border-radius: 50%; transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease; text-decoration: none; }
.aam-social-icon:hover { background: #E83236; color: #ffffff; transform: translateY(-3px); }
.aam-social-icon svg { width: 20px; height: 20px; fill: currentColor; }

/* ==========================================================================
   Misc
   ========================================================================== */

.post_info_author,
.post_info_item.post_info_posted_by {
    display: none;
}

#stk-wa-float-btn,
#rf-wa-float-btn,
#aam-wa-float-btn {
    border: 3px solid #fff;
}

/* ==========================================================================
   WooCommerce account / login / checkout — readable on dark theme
   ========================================================================== */
.woocommerce form label,
.woocommerce-account .woocommerce label,
.woocommerce .woocommerce-form-login label,
.woocommerce .woocommerce-form-register label,
.woocommerce form .form-row label,
.woocommerce-account .woocommerce-MyAccount-content label { color: var(--aam-cream) !important; }
.woocommerce-account .woocommerce form.login,
.woocommerce-account .woocommerce form.register { border: 1px solid #4a4242; border-radius: 8px; padding: 26px 28px; background: rgba(0,0,0,0.15); }
.woocommerce-account .col2-set .col-1,
.woocommerce-account .col2-set .col-2 { width: 48%; }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row input[type="password"] { padding: 10px 12px; border-radius: 6px; }
.woocommerce-account h2 { color: var(--aam-red); }

/* ==========================================================================
   Mobile menu + account responsiveness
   ========================================================================== */
@media (max-width: 921px) {
    .ast-header-break-point .main-header-menu { background: #ffffff !important; }
    .ast-header-break-point .main-header-menu .menu-link,
    .ast-header-break-point .main-header-menu .menu-item > a { color: #1d2327 !important; }
    .ast-header-break-point .main-header-menu .menu-link:hover,
    .ast-header-break-point .main-header-menu .menu-item > a:hover { color: #E83236 !important; }
    .ast-header-break-point .main-header-menu .aam-cart-link,
    .ast-header-break-point .main-header-menu .aam-cart-link * { color: #ffffff !important; }
    .ast-header-break-point .main-header-menu .menu-item { border-bottom: 1px solid #ededed; }
    .ast-header-break-point .aam-cart-menu-item { padding: 8px 20px; }
}
@media (max-width: 768px) {
    .woocommerce-account .col2-set .col-1,
    .woocommerce-account .col2-set .col-2 { width: 100% !important; float: none; margin: 0 0 22px; }
    .woocommerce-account .woocommerce form.login,
    .woocommerce-account .woocommerce form.register { padding: 20px; }
}

/* ==========================================================================
   Readability sweep — dropdowns, legends & helper text on dark theme
   ========================================================================== */
.woocommerce-ordering select,
.woocommerce select.orderby,
.woocommerce form .form-row select,
.woocommerce-page select,
.woocommerce .quantity input.qty { background-color: #ffffff !important; color: #1d2327 !important; border: 1px solid #cccccc; border-radius: 6px; padding: 9px 30px 9px 12px; }
.woocommerce .quantity input.qty { padding: 9px 8px; }
.woocommerce fieldset legend,
.woocommerce-account fieldset legend,
.woocommerce-EditAccountForm legend,
.woocommerce form fieldset legend { color: var(--aam-cream) !important; font-size: 1.05em; font-weight: 700; border-bottom: 1px solid #4a4242; padding-bottom: 8px; width: 100%; }
.woocommerce-result-count,
.woocommerce form .form-row .description,
.woocommerce form .form-row span.description,
.woocommerce .woocommerce-input-wrapper span.description { color: var(--aam-cream) !important; }
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-account .woocommerce-MyAccount-content p { color: var(--aam-cream); }

/* Homepage category buttons — uniform, centered grid */
.aam-cat-grid.wp-block-buttons { display:flex; flex-wrap:wrap; justify-content:center; gap:12px; max-width:1040px; margin-left:auto; margin-right:auto; }
.aam-cat-grid .wp-block-button { flex:1 1 200px; max-width:240px; margin:0; }
.aam-cat-grid .wp-block-button__link { display:flex; align-items:center; justify-content:center; width:100%; min-height:52px; padding:10px 14px; text-align:center; line-height:1.25; }
@media (max-width:600px){ .aam-cat-grid .wp-block-button { flex-basis:46%; max-width:none; } }

/* ==========================================================================
   v3.1 Homepage polish — buttons, header, nav search, category icons, trust
   ========================================================================== */

/* --- Header: tighten logo whitespace (#15) --- */
.ast-primary-header-bar .main-header-bar,
.main-header-bar { padding-top: 10px; padding-bottom: 10px; }
.custom-logo-link img { max-height: 70px; margin: 0; }
.site-header .site-branding { padding: 0; }

/* --- Button standardisation (#14): primary = solid red, secondary = outline red --- */
.entry-content .wp-block-button:not(.is-style-outline) > .wp-block-button__link {
    background-color: var(--aam-red);
    color: #fff;
    border: 2px solid var(--aam-red);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    padding: 12px 26px;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.entry-content .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover {
    background-color: var(--aam-red-hover);
    border-color: var(--aam-red-hover);
    color: #fff;
}
.entry-content .wp-block-button.is-style-outline > .wp-block-button__link {
    background-color: transparent;
    color: var(--aam-red);
    border: 2px solid var(--aam-red);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    padding: 12px 26px;
    transition: background-color 0.2s, color 0.2s;
}
.entry-content .wp-block-button.is-style-outline > .wp-block-button__link:hover {
    background-color: var(--aam-red);
    color: #fff;
}
/* Outline buttons sitting on dark cover images stay legible (white) */
.wp-block-cover .wp-block-button.is-style-outline > .wp-block-button__link {
    color: #fff;
    border-color: #fff;
}
.wp-block-cover .wp-block-button.is-style-outline > .wp-block-button__link:hover {
    background-color: var(--aam-red);
    border-color: var(--aam-red);
}

/* --- Nav product search (#6) --- */
.aam-search-item { display: flex; align-items: center; position: relative; }
.aam-search-toggle { display: inline-flex; align-items: center; justify-content: center; color: #fff; line-height: 1; padding: 0 6px; }
.aam-search-toggle:hover { color: var(--aam-red); }
.aam-search-toggle .material-symbols-outlined { font-size: 24px; }
.aam-search-panel {
    position: absolute;
    top: 100%;
    right: 0;
    display: none;
    background: var(--aam-bg-deep);
    border: 1px solid #4a4242;
    border-top: 3px solid var(--aam-red);
    padding: 12px;
    z-index: 999;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.aam-search-panel.open { display: block; }
.aam-search-panel form { display: flex; align-items: stretch; gap: 0; }
.aam-search-panel input[type="search"] {
    width: 240px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;
    padding: 9px 12px;
    background: #fff;
    color: #1d2327;
    font-size: 14px;
}
.aam-search-panel button {
    border: none;
    background: var(--aam-red);
    color: #fff;
    padding: 0 14px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.aam-search-panel button:hover { background: var(--aam-red-hover); }
.aam-search-panel button .material-symbols-outlined { font-size: 20px; }
@media (max-width: 921px) {
    .aam-search-panel { right: auto; left: 0; position: static; box-shadow: none; }
    .aam-search-panel input[type="search"] { width: 100%; }
    .aam-search-item { padding: 8px 20px; }
}

/* --- Category grid icons (#7) --- */
.aam-cat-grid .wp-block-button__link::before {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-size: 20px;
    line-height: 1;
    margin-right: 9px;
    flex-shrink: 0;
}
.aam-cat-engines      .wp-block-button__link::before { content: 'settings'; }
.aam-cat-fuel         .wp-block-button__link::before { content: 'local_gas_station'; }
.aam-cat-gaskets      .wp-block-button__link::before { content: 'layers'; }
.aam-cat-ignition     .wp-block-button__link::before { content: 'bolt'; }
.aam-cat-transmission .wp-block-button__link::before { content: 'settings_input_component'; }
.aam-cat-cooling      .wp-block-button__link::before { content: 'ac_unit'; }
.aam-cat-interior     .wp-block-button__link::before { content: 'weekend'; }
.aam-cat-chassis      .wp-block-button__link::before { content: 'directions_car'; }
.aam-cat-brakes       .wp-block-button__link::before { content: 'album'; }
.aam-cat-body         .wp-block-button__link::before { content: 'car_repair'; }
.aam-cat-exhaust      .wp-block-button__link::before { content: 'air'; }
.aam-cat-fasteners    .wp-block-button__link::before { content: 'hardware'; }
.aam-cat-lights       .wp-block-button__link::before { content: 'lightbulb'; }
.aam-cat-gauges       .wp-block-button__link::before { content: 'speed'; }

/* --- Trust band (#12 social proof) --- */
.aam-trust-band .aam-trust-num {
    font-family: "Montserrat", sans-serif;
    font-size: 40px;
    font-weight: 900;
    margin: 0 0 6px;
    line-height: 1;
}
.aam-trust-band p { margin: 0; font-size: 14px; letter-spacing: 0.3px; }
@media (max-width: 600px) {
    .aam-trust-band .wp-block-columns { gap: 26px; }
    .aam-trust-band .aam-trust-num { font-size: 34px; }
}

/* --- Full-bleed hero on the page-builder homepage (#2) --- */
.home .resto-hero { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); width: 100vw; max-width: 100vw; }

/* ==========================================================================
   v3.2 Dream Build cards (homepage + Dream Build page)
   ========================================================================== */
.aam-build-card { border-bottom: 4px solid var(--aam-red); overflow: hidden; }
.aam-build-card .wp-block-cover__inner-container { width: 100%; }
.aam-build-card .wp-block-cover__image-background { transition: transform 0.4s ease; }
.aam-build-card:hover .wp-block-cover__image-background { transform: scale(1.06); }
/* Card titles stay white even inside the light (#f5f5f5) section */
.aam-build-card h3,
.aam-build-card h3 a,
.aam-homebuild .aam-build-card h3,
.aam-homebuild .aam-build-card h3 a {
    color: #fff !important;
    text-decoration: none;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.aam-build-card h3 a:hover { color: var(--aam-red) !important; }
.aam-build-grid .wp-block-column { margin-top: 0; }
@media (max-width: 781px) {
    .aam-build-grid.wp-block-columns { flex-wrap: wrap; }
    .aam-build-grid .wp-block-column { flex-basis: 100% !important; }
}
