/*
 Theme Name:   STK Performance
 Theme URI:    https://stk.ormsy.co.za
 Description:  Astra child theme for STK Performance - motorsport parts store
 Author:       OpenRoad Media
 Template:     astra
 Version:      1.1.4
 Text Domain:  stk-performance
*/

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    --stk-dark: #0a0a0a;
    --stk-dark-alt: #111111;
    --stk-blue: #243673;
    --stk-blue-accent: #1e73be;
    --stk-blue-light: #3197d6;
    --stk-white: #ffffff;
    --stk-gray-light: #f5f7f9;
    --stk-gray: #575757;
    --stk-gray-dark: #333333;
    --stk-red: #e74c3c;
    --stk-green: #5BBA67;
    --stk-font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --stk-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --stk-radius: 4px;
    --stk-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Global Typography
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

body {
    font-family: var(--stk-font-body);
    color: var(--stk-gray-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--stk-font-heading);
    font-weight: 700;
}

/* ==========================================================================
   Header
   ========================================================================== */

.ast-primary-header-bar,
.ast-above-header-bar,
.ast-below-header-bar {
    background-color: var(--stk-dark) !important;
}

.ast-primary-header-bar .ast-builder-menu .menu-item > .menu-link,
.ast-header-break-point .ast-builder-menu .menu-item > .menu-link {
    color: var(--stk-white) !important;
    font-family: var(--stk-font-heading);
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ast-primary-header-bar .ast-builder-menu .menu-item:hover > .menu-link,
.ast-primary-header-bar .ast-builder-menu .menu-item.current-menu-item > .menu-link {
    color: var(--stk-blue-light) !important;
}

.ast-site-identity .site-title a,
.ast-site-identity .site-title {
    color: var(--stk-white) !important;
}

/* Cart icon in header */
.ast-header-woo-cart .ast-cart-menu-wrap,
.ast-site-header-cart .ast-addon-cart-wrap {
    color: var(--stk-white) !important;
}

/* ==========================================================================
   Hero Section (used on homepage)
   ========================================================================== */

.stk-hero {
    color: var(--stk-white);
}

.stk-hero .wp-block-button__link,
.stk-btn {
    display: inline-block;
    background: var(--stk-blue-accent) !important;
    color: var(--stk-white) !important;
    padding: 14px 36px;
    border-radius: var(--stk-radius);
    font-family: var(--stk-font-heading);
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
}

.stk-hero .wp-block-button__link:hover,
.stk-btn:hover {
    background: var(--stk-blue) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 115, 190, 0.4);
}

/* ==========================================================================
   Section Styles
   ========================================================================== */

.stk-section {
    padding: 80px 0;
}

.stk-section-dark {
    background-color: var(--stk-dark);
    color: var(--stk-white);
}

.stk-section-light {
    background-color: var(--stk-white);
}

.stk-section-gray {
    background-color: var(--stk-gray-light);
}

.stk-section-title {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-bottom: 50px;
    position: relative;
}

.stk-section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--stk-blue-accent);
    margin: 15px auto 0;
}

/* ==========================================================================
   Feature Boxes (Who We Are section)
   ========================================================================== */

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

.stk-feature-box {
    padding: 35px 30px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stk-feature-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(30, 115, 190, 0.3);
}

.stk-feature-box h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--stk-blue-light);
}

.stk-feature-box p {
    font-size: 0.95rem;
    line-height: 1.7;
    opacity: 0.8;
    margin: 0;
}

/* ==========================================================================
   WooCommerce Product Cards
   ========================================================================== */

.woocommerce ul.products li.product {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--stk-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--stk-white);
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--stk-font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 15px 4px;
}

.woocommerce ul.products li.product .price {
    padding: 0 15px;
    font-weight: 700;
    color: var(--stk-gray-dark);
}

.woocommerce ul.products li.product .price ins {
    color: var(--stk-blue-accent);
    font-weight: 700;
}

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .added_to_cart {
    background-color: var(--stk-blue-accent) !important;
    color: var(--stk-white) !important;
    border-radius: var(--stk-radius);
    font-family: var(--stk-font-heading);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 10px 15px 15px;
    padding: 10px 20px;
    transition: background 0.3s ease;
}

.woocommerce ul.products li.product .button:hover {
    background-color: var(--stk-blue) !important;
}

/* Sale Badge */
.woocommerce span.onsale {
    background: var(--stk-red);
    color: var(--stk-white);
    font-family: var(--stk-font-heading);
    font-weight: 700;
    font-size: 12px;
    border-radius: var(--stk-radius);
    padding: 5px 12px;
    min-height: auto;
    min-width: auto;
    line-height: 1.5;
}

/* Coming Soon Badge */
.stk-coming-soon-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--stk-red);
    color: var(--stk-white);
    font-family: var(--stk-font-heading);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--stk-radius);
    z-index: 5;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   WooCommerce Shop Sidebar
   ========================================================================== */

.woocommerce-shop .widget-area,
.woocommerce-page .widget-area {
    background: var(--stk-gray-light);
    padding: 25px;
    border-radius: 6px;
}

.widget-area .widget-title {
    font-family: var(--stk-font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--stk-blue-accent);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* ==========================================================================
   Single Product Page
   ========================================================================== */

.woocommerce div.product .product_title {
    font-family: var(--stk-font-heading);
    font-weight: 700;
}

.woocommerce div.product .price {
    color: var(--stk-blue-accent);
    font-family: var(--stk-font-heading);
    font-weight: 700;
    font-size: 1.5rem;
}

.woocommerce div.product .single_add_to_cart_button {
    background-color: var(--stk-blue-accent) !important;
    color: var(--stk-white) !important;
    font-family: var(--stk-font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 36px;
    border-radius: var(--stk-radius);
    transition: all 0.3s ease;
}

.woocommerce div.product .single_add_to_cart_button:hover {
    background-color: var(--stk-blue) !important;
    transform: translateY(-1px);
}

/* ==========================================================================
   Cart & Checkout
   ========================================================================== */

.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce .checkout-button {
    background-color: var(--stk-blue-accent) !important;
    color: var(--stk-white) !important;
    font-family: var(--stk-font-heading);
    font-weight: 600;
    border-radius: var(--stk-radius);
    transition: background 0.3s ease;
}

.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background-color: var(--stk-blue) !important;
    color: var(--stk-white) !important;
}

/* ==========================================================================
   Blog / Post Cards
   ========================================================================== */

.stk-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.stk-blog-card {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--stk-shadow);
    background: var(--stk-white);
    transition: transform 0.3s ease;
}

.stk-blog-card:hover {
    transform: translateY(-4px);
}

.stk-blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.stk-blog-card .stk-blog-card-content {
    padding: 20px;
}

.stk-blog-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.stk-blog-card h3 a {
    color: var(--stk-gray-dark);
    text-decoration: none;
}

.stk-blog-card h3 a:hover {
    color: var(--stk-blue-accent);
}

/* ==========================================================================
   Contact Page Styles
   ========================================================================== */

.stk-business-hours {
    max-width: 500px;
}

.stk-business-hours table {
    width: 100%;
    border-collapse: collapse;
}

.stk-business-hours td {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
}

.stk-business-hours td:last-child {
    text-align: right;
}

.stk-contact-info a {
    color: var(--stk-blue-light);
    text-decoration: none;
}

.stk-contact-info a:hover {
    text-decoration: underline;
}

/* FAQ Accordion */
.stk-faq details {
    border: 1px solid #e2e2e2;
    border-radius: var(--stk-radius);
    margin-bottom: 10px;
    overflow: hidden;
}

.stk-faq details summary {
    padding: 16px 20px;
    font-family: var(--stk-font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    background: var(--stk-gray-light);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stk-faq details summary::-webkit-details-marker {
    display: none;
}

.stk-faq details summary::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--stk-blue-accent);
    transition: transform 0.3s ease;
}

.stk-faq details[open] summary::after {
    content: '−';
}

.stk-faq details .stk-faq-answer {
    padding: 16px 20px;
    line-height: 1.7;
    color: var(--stk-gray);
}

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

.ast-footer,
.site-footer,
.ast-primary-footer,
.ast-above-footer,
.ast-below-footer {
    background-color: var(--stk-dark) !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

.ast-footer a,
.site-footer a {
    color: rgba(255, 255, 255, 0.8) !important;
}

.ast-footer a:hover,
.site-footer a:hover {
    color: var(--stk-blue-light) !important;
}

.ast-footer .widget-title,
.site-footer .widget-title {
    color: var(--stk-white) !important;
    font-family: var(--stk-font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 1rem;
}

.ast-small-footer,
.ast-footer-copyright {
    background-color: var(--stk-dark-alt) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Social Icons */
.stk-social-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.stk-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--stk-white) !important;
    text-decoration: none;
    transition: background 0.3s ease;
    font-size: 16px;
}

.stk-social-links a:hover {
    background: var(--stk-blue-accent);
}

/* ==========================================================================
   WhatsApp Floating Button
   ========================================================================== */

.stk-whatsapp-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 56px;
    height: 56px;
    background: var(--stk-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(91, 186, 103, 0.4);
    z-index: 9999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.stk-whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(91, 186, 103, 0.6);
}

.stk-whatsapp-btn svg {
    width: 28px;
    height: 28px;
    fill: var(--stk-white);
}

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

@media (max-width: 921px) {

    .stk-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 544px) {

    .stk-section {
        padding: 50px 0;
    }
}


/* ==========================================================================
   Hero Button & Spacing Fixes
   ========================================================================== */

/* Prevent hero buttons from stretching full width */
.stk-hero .wp-block-buttons {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
}

.stk-hero .wp-block-button {
    display: inline-block;
    width: auto !important;
    max-width: fit-content;
}

.stk-hero .wp-block-button__link {
    width: auto !important;
    display: inline-block !important;
    padding: 14px 36px !important;
    font-size: 15px !important;
}

/* Ensure cover block content is properly constrained */


.stk-hero .wp-block-cover__inner-container h1 {
    margin-top: 0;
}


/* ==========================================================================
   FIX: Product Card Equal Heights & Consistent Images
   ========================================================================== */

/* Fixed image container for consistent product cards */
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product img.attachment-woocommerce_thumbnail {
    height: 220px;
    object-fit: contain;
    background: #f9f9f9;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Product info area */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: 2.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Product category text */
.woocommerce ul.products li.product .ast-woo-product-category,
.woocommerce ul.products li.product .astra-shop-summary-wrap > .ast-woo-product-category {
    font-size: 0.8rem;
    color: var(--stk-gray);
    padding: 0 15px;
    margin-bottom: 4px;
}

/* Price alignment */
.woocommerce ul.products li.product .price {
    margin-top: auto;
}

/* Out of stock badge */
.woocommerce ul.products li.product .ast-shop-product-out-of-stock {
    background: var(--stk-gray-dark);
    color: var(--stk-white);
    font-family: var(--stk-font-heading);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
}

/* ==========================================================================
   FIX: Footer — Clean Layout
   ========================================================================== */

/* Hide empty footer rows */
.ast-above-footer-wrap:empty,
.site-above-footer-wrap:empty {
    display: none !important;
}

/* Primary footer - if it renders empty, collapse it */
.ast-primary-footer {
    padding: 0 !important;
    min-height: 0 !important;
}

.ast-primary-footer .ast-builder-grid-row-container:empty,
.ast-primary-footer .ast-builder-grid-row:not(:has(*)) {
    display: none !important;
}

/* Below footer (the actual visible footer) */
.ast-below-footer,
.site-below-footer-wrap {
    background-color: var(--stk-dark) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ast-below-footer .ast-builder-grid-row {
    align-items: center;
}

/* Footer copyright text */
.ast-footer-copyright {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 14px;
}

.ast-footer-copyright a {
    color: rgba(255, 255, 255, 0.7) !important;
}

.ast-footer-copyright a:hover {
    color: var(--stk-blue-light) !important;
}

/* Footer menu links */
.ast-builder-footer-grid-columns .footer-nav-wrap .menu-item a {
    color: rgba(255, 255, 255, 0.7) !important;
    font-family: var(--stk-font-heading);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ast-builder-footer-grid-columns .footer-nav-wrap .menu-item a:hover {
    color: var(--stk-blue-light) !important;
}

/* Footer social icons override colors for dark bg */
.ast-below-footer .ast-social-inner-wrap .ast-builder-social-element svg {
    fill: rgba(255, 255, 255, 0.7);
    width: 20px;
    height: 20px;
}

.ast-below-footer .ast-social-inner-wrap .ast-builder-social-element:hover svg {
    fill: var(--stk-blue-light);
}

/* ==========================================================================
   FIX: Feature Boxes — Better Contrast
   ========================================================================== */

.stk-feature-box {
    border-color: rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.stk-feature-box:hover {
    border-color: rgba(30, 115, 190, 0.4) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   FIX: Blog Cards — Consistent Image Sizing
   ========================================================================== */

.stk-blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: var(--stk-gray-light);
}

.stk-blog-card .stk-blog-card-content {
    padding: 24px;
}

.stk-blog-card .stk-blog-card-content p {
    margin-bottom: 16px;
}

/* ==========================================================================
   FIX: Shop Page — Category List Styling
   ========================================================================== */

.woocommerce-shop .wp-block-group .wp-block-list,
.woocommerce-shop .entry-content > .wp-block-group .wp-block-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.woocommerce-shop .wp-block-group .wp-block-list li,
.woocommerce-shop .wp-block-group .wp-block-list p {
    margin: 0;
}

.woocommerce-shop .wp-block-group .wp-block-list a,
.woocommerce-shop .wp-block-group .wp-block-list li a {
    display: inline-block;
    padding: 8px 16px;
    background: var(--stk-gray-light);
    border: 1px solid #e2e2e2;
    border-radius: var(--stk-radius);
    color: var(--stk-gray-dark);
    text-decoration: none;
    font-family: var(--stk-font-heading);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.woocommerce-shop .wp-block-group .wp-block-list a:hover,
.woocommerce-shop .wp-block-group .wp-block-list li a:hover {
    background: var(--stk-blue-accent);
    color: var(--stk-white);
    border-color: var(--stk-blue-accent);
}

/* ==========================================================================
   FIX: About Page — Visual Improvements
   ========================================================================== */

/* About hero section */
.page-id-4394 .stk-section-dark:first-child {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content section spacing */
.page-id-4394 .stk-section-light {
    border-bottom: 1px solid var(--stk-gray-light);
}

.page-id-4394 .stk-section-light p {
    max-width: 800px;
    color: var(--stk-gray);
}

/* ==========================================================================
   FIX: General Polish
   ========================================================================== */

/* Breadcrumb styling */
.ast-breadcrumbs-wrapper {
    padding: 12px 0;
    font-size: 0.85rem;
}

.ast-breadcrumbs-wrapper a {
    color: var(--stk-blue-accent);
}

/* WooCommerce pagination */
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span.current {
    font-family: var(--stk-font-heading);
    font-weight: 600;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background: var(--stk-blue-accent) !important;
    color: var(--stk-white) !important;
    border-color: var(--stk-blue-accent) !important;
}

/* WooCommerce ordering dropdown */
.woocommerce-ordering select {
    font-family: var(--stk-font-heading);
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: var(--stk-radius);
    border: 1px solid #e2e2e2;
}

/* Results count */
.woocommerce-result-count {
    font-family: var(--stk-font-heading);
    font-size: 0.85rem;
    color: var(--stk-gray);
}
