/*
Theme Name: Green Space Creations
Theme URI: https://www.greenspacecreations.co.uk/
Author: Green Space Creations
Description: Custom theme for Green Space Creations - garden buildings, summerhouses and sheds.
Version: 2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: greenspacecreations
Tags: green, custom, woocommerce, garden
*/

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green-dark:   #1a7a6e;   /* deep teal - headers, nav bg, footer */
    --green-mid:    #88AA6B;   /* medium teal - buttons, links        */
    --green-light:  #73d9c9;   /* logo mint  - accents, icons         */
    --green-pale:   #e4f8f5;   /* very light mint - section bgs       */
    --gold:         #e8a020;
    --gold-hover:   #cf8c18;
    --text-dark:    #1e1e1e;
    --text-mid:     #444;
    --text-light:   #777;
    --white:        #ffffff;
    --off-white:    #f5fdfb;
    --border:       #c8ece7;
    --shadow:       0 2px 16px rgba(26,122,110,0.10);
    --shadow-lg:    0 6px 32px rgba(26,122,110,0.15);
    --radius:       6px;
    --radius-lg:    12px;
    --max-width:    1200px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--off-white);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-mid); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green-dark); }
ul { list-style: none; }

h1, h2, h3, h4, h5 {
    font-family: 'Raleway', 'Georgia', serif;
    line-height: 1.25;
    color: var(--green-dark);
}
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

p { margin-bottom: 1rem; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--green-mid); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: var(--gold-hover); color: var(--white); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-outline:hover { background: var(--white); color: var(--green-dark); }

/* =========================================================
   TOP BAR
   ========================================================= */
.top-bar {
    background: var(--green-dark);
    color: rgba(255,255,255,0.8);
    font-size: 0.82rem;
    padding: 6px 0;
}
.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.top-bar a { color: rgba(255,255,255,0.85); }
.top-bar a:hover { color: var(--white); }
.top-bar-contact { display: flex; gap: 24px; }
.top-bar-contact span { display: flex; align-items: center; gap: 6px; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
    background: #ACEDD9;
    box-shadow: 0 2px 8px rgba(26,122,110,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    max-width: var(--max-width);
    margin: 0 auto;
    gap: 24px;
}
.site-logo img {
    max-height: 70px;
    width: auto;
}
.site-logo-text {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo-text-box .logo-main {
    font-family: 'Raleway', serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--green-dark);
    line-height: 1.1;
    display: block;
}
.logo-text-box .logo-sub {
    font-size: 0.75rem;
    color: var(--green-mid);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: block;
}
.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--green-mid);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.logo-icon svg { fill: white; width: 28px; height: 28px; }

.header-cta { flex-shrink: 0; }

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--green-dark);
    border-radius: 2px;
    transition: .3s;
}

/* =========================================================
   NAVIGATION
   ========================================================= */
.main-nav { background: var(--white); border-top: 1px solid var(--border); }
.main-nav .container { max-width: var(--max-width); }
.main-nav > .container > ul,
.main-nav ul.menu {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    list-style: none;
}
.main-nav ul li { position: relative; }
.main-nav ul li a {
    display: block;
    padding: 14px 18px;
    color: var(--green-dark);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background .2s, color .2s;
}
.main-nav ul li a:hover,
.main-nav ul li.current-menu-item > a,
.main-nav ul li.current-page-ancestor > a {
    background: var(--green-pale);
    color: var(--green-dark);
}
/* Hide the Get a Free Quote item from the nav */
.main-nav ul li.menu-item-quote { display: none; }

/* =========================================================
   HERO SECTION
   ========================================================= */
.hero {
    position: relative;
    min-height: 560px;
    background: url('images/hero-bg.jpg') center top/cover no-repeat;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.05) 100%);
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 25%);
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    padding: 60px 24px;
}
.hero-content h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-content p {
    color: rgba(255,255,255,0.9);
    font-size: 1.15rem;
    margin-bottom: 2rem;
}
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

/* =========================================================
   FEATURES STRIP
   ========================================================= */
.features-strip {
    background: var(--white);
    border-bottom: 3px solid var(--green-pale);
    padding: 32px 0;
}
.features-strip .container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--green-dark);
}
.feature-item .feat-icon {
    width: 44px;
    height: 44px;
    background: var(--green-pale);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feature-item .feat-icon svg { fill: var(--green-mid); width: 22px; height: 22px; }

/* =========================================================
   SECTION COMMON
   ========================================================= */
.section { padding: 72px 0; }
.section-alt { background: var(--green-pale); }
.section-title {
    text-align: center;
    margin-bottom: 48px;
}
.section-title h2 { margin-bottom: 12px; }
.section-title p { color: var(--text-light); max-width: 560px; margin: 0 auto; }
.section-title .title-line {
    display: block;
    width: 56px;
    height: 4px;
    background: var(--gold);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* =========================================================
   PRODUCT CARDS / CATEGORY CARDS
   ========================================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card-img { aspect-ratio: 4/3; overflow: hidden; background: var(--green-pale); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 24px; }
.card-body h3 { margin-bottom: 8px; font-size: 1.2rem; }
.card-body p { font-size: 0.9rem; margin-bottom: 16px; }
.card-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--green-pale);
    color: var(--green-dark);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* =========================================================
   CTA BANNER
   ========================================================= */
.cta-banner {
    background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
    color: var(--white);
    padding: 72px 0;
    text-align: center;
}

.cta-banner h2 { color: var(--white); margin-bottom: 16px; font-size: 2.2rem; }
.cta-banner p { color: rgba(255,255,255,0.85); font-size: 1.1rem; margin-bottom: 32px; }

/* =========================================================
   TESTIMONIALS
   ========================================================= */
.testimonials { padding: 72px 0; background: var(--white); }
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.testimonial-card {
    background: var(--green-pale);
    border-radius: var(--radius-lg);
    padding: 28px;
    border-left: 4px solid var(--green-mid);
}
.testimonial-card p { font-style: italic; margin-bottom: 16px; font-size: 0.95rem; }
.testimonial-author { font-weight: 700; color: var(--green-dark); font-size: 0.9rem; }
.stars { color: var(--gold); letter-spacing: 2px; margin-bottom: 10px; font-size: 1.1rem; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--green-dark); color: rgba(255,255,255,0.85); }
.footer-main { padding: 56px 0 40px; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}
.footer-col h4 {
    color: var(--white);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--green-mid);
}
.footer-col p { color: rgba(255,255,255,0.75); font-size: 0.9rem; line-height: 1.8; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    transition: color .2s;
}
.footer-col ul li a:hover { color: var(--white); padding-left: 4px; }
.footer-logo-text .logo-main { color: var(--white); font-size: 1.4rem; }
.footer-logo-text .logo-sub { color: rgba(255,255,255,0.6); }
.footer-contact-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}
.footer-contact-item a { color: rgba(255,255,255,0.8); }
.footer-contact-item a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
}
.footer-bottom a { color: rgba(255,255,255,0.6); }

/* =========================================================
   WOOCOMMERCE - SHOP
   ========================================================= */
.woocommerce-page main,
.woocommerce main { padding: 48px 0; }

.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-page ul.products,
.woocommerce ul.products,
body.tax-product_cat .woocommerce ul.products,
body.tax-product_cat .woocommerce-page ul.products {
    grid-template-columns: repeat(5, 20%) !important;
    justify-content: space-between;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
body.tax-product_cat .woocommerce ul.products li.product,
body.tax-product_cat .woocommerce-page ul.products li.product {
    width: auto !important;
    max-width: none !important;
}
.woocommerce ul.products li.product {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .25s, transform .25s;
    position: relative;
}
.woocommerce ul.products li.product:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.woocommerce ul.products li.product a img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: 'Raleway', serif;
    font-size: 1.1rem;
    color: var(--green-dark);
    padding: 16px 20px 4px;
    font-weight: 700;
}
.woocommerce ul.products li.product .price {
    padding: 0 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green-mid);
}
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button {
    display: block;
    margin: 12px 20px 20px;
    background: var(--green-mid);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.88rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background .2s;
    border: none;
    cursor: pointer;
    width: calc(100% - 40px);
}
.woocommerce ul.products li.product .button:hover { background: var(--green-dark); }

/* =========================================================
   WOOCOMMERCE - SINGLE PRODUCT
   ========================================================= */
.single-product .woocommerce-product-gallery__wrapper img {
    border-radius: var(--radius-lg);
}
.woocommerce div.product .product_title {
    color: var(--green-dark);
    font-size: 2rem;
    margin-bottom: 8px;
}
.woocommerce div.product .price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--green-mid);
    margin: 16px 0;
}
.woocommerce div.product .woocommerce-product-details__short-description {
    margin-bottom: 24px;
    line-height: 1.8;
    color: var(--text-mid);
}

/* Variations table */
.woocommerce div.product .variations {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.woocommerce div.product .variations td,
.woocommerce div.product .variations th {
    padding: 10px 0;
    vertical-align: middle;
}
.woocommerce div.product .variations label {
    font-weight: 700;
    color: var(--green-dark);
    font-size: 0.95rem;
}
.woocommerce div.product .variations select,
.gsc-size-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--white);
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231a5c2e' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    transition: border-color .2s;
}
.woocommerce div.product .variations select:focus,
.gsc-size-select:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(42,125,66,0.15);
}

/* Single product add to cart */
.woocommerce div.product .single_add_to_cart_button,
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    background: var(--green-mid);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background .2s, transform .15s;
}
.woocommerce div.product .single_add_to_cart_button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
}

/* =========================================================
   SIZE & PRICE TABLE (custom)
   ========================================================= */
.gsc-size-price-section {
    background: var(--green-pale);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin: 24px 0;
}
.gsc-size-price-section h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--green-dark);
}
.gsc-price-display {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border: 2px solid var(--green-pale);
}
.gsc-price-display .price-label { font-size: 0.9rem; color: var(--text-mid); }
.gsc-price-display .price-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--green-mid);
    font-family: 'Raleway', serif;
}

/* =========================================================
   SIZE TABLE (all sizes reference)
   ========================================================= */
.size-table-wrap { overflow-x: auto; margin: 24px 0; }
.size-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.size-table th {
    background: var(--green-dark);
    color: var(--white);
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.8rem;
}
.size-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-mid);
}
.size-table tr:nth-child(even) td { background: var(--green-pale); }
.size-table tr:hover td { background: #d5eeda; }
.size-table .price-col { font-weight: 700; color: var(--green-mid); font-size: 1rem; }

/* =========================================================
   PAGE CONTENT
   ========================================================= */
.page-hero {
    background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
    padding: 60px 0 48px;
    text-align: center;
}
.page-hero h1 { color: var(--white); margin-bottom: 8px; }
.page-hero p { color: rgba(255,255,255,0.8); font-size: 1.05rem; }
.breadcrumb { font-size: 0.82rem; color: rgba(255,255,255,0.65); margin-top: 12px; }
.breadcrumb a { color: rgba(255,255,255,0.75); }

.page-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 56px 24px;
}
.page-content h2 { margin: 32px 0 16px; }
.page-content p { margin-bottom: 1.2rem; }
.page-content ul { list-style: disc; padding-left: 24px; margin-bottom: 1.2rem; }
.page-content ul li { margin-bottom: 8px; color: var(--text-mid); }

/* =========================================================
   MAIN CONTENT AREA
   ========================================================= */
.site-main { min-height: 60vh; }
.content-wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 24px;
}

/* =========================================================
   BREADCRUMBS (WooCommerce)
   ========================================================= */
.woocommerce .woocommerce-breadcrumb {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 24px;
}
.woocommerce .woocommerce-breadcrumb a { color: var(--green-mid); }

/* =========================================================
   MESSAGES / NOTICES
   ========================================================= */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.woocommerce-message { background: #e6f4ea; border-left: 4px solid var(--green-mid); color: var(--green-dark); }
.woocommerce-info { background: #e8f4fd; border-left: 4px solid #2196f3; color: #1565c0; }
.woocommerce-error { background: #fdecea; border-left: 4px solid #e53935; color: #b71c1c; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    .hero-content h1 { font-size: 2.2rem; }

    .header-inner { padding: 12px 16px; }
    .header-cta { display: none; }

    .nav-toggle { display: flex; }

    .main-nav { display: none; }
    .main-nav.nav-open { display: block; }
    .main-nav > .container > ul,
    .main-nav ul.menu {
        flex-direction: column;
        align-items: stretch;
    }
    .main-nav ul li a { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .main-nav ul li.menu-item-quote > a { margin: 8px 16px; text-align: center; }

    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .features-strip .container { gap: 20px; }
    .hero { min-height: 380px; }
    .section { padding: 48px 0; }
    .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .top-bar .container { justify-content: center; }
    .top-bar-contact { flex-direction: column; gap: 4px; text-align: center; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { text-align: center; }
}
ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* 1. Hide the sub-menu by default */
.menu ul {
    display: none;
    position: absolute;
    background: #fff; /* Give it a background so it's not invisible */
    list-style: none;
    padding: 10px;
    margin: 0;
    z-index: 999;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
}

/* 2. Show the sub-menu when hovering over the parent list item */
.menu li:hover > ul {
    display: block;
}

/* 3. Ensure parent items stay in a line (optional based on your design) */
.menu > li {
    display: inline-block;
    position: relative; /* This keeps the dropdown attached to the parent */
    margin-right: 20px;
}

/* 1. Ensure the sub-menu is solid and on top of everything */
.menu ul, 
.sub-menu {
    display: none;
    position: absolute;
    background-color: #ffffff !important; /* Forces solid white background */
    opacity: 1 !important;               /* Fixes transparency */
    list-style: none;
    padding: 15px;
    margin: 0;
    min-width: 200px;
    z-index: 9999 !important;            /* Forces it above the homepage image */
    box-shadow: 0px 8px 16px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

/* 2. Show the sub-menu on hover */
.menu li:hover > ul,
.menu li:hover > .sub-menu {
    display: block;
}

/* 3. Helper: Ensure the parent item is the anchor for the dropdown */
.menu li {
    position: relative;
}

/* 4. Fix for links inside the dropdown */
.menu ul li a {
    color: #333 !important;             /* Ensures text is visible against white */
    padding: 8px 0;
    display: block;
    text-decoration: none;
}

/* Ensure the products fit into 4 columns (25% each) */
.woocommerce ul.products li.product, 
.woocommerce-page ul.products li.product {
    width: 22% !important; /* Slightly less than 25% to allow for margins */
    margin-right: 4% !important;
    float: left;
    clear: none !important;
}

/* Remove margin on every 4th item to keep the row straight */
.woocommerce ul.products li.product:nth-child(4n),
.woocommerce-page ul.products li.product:nth-child(4n) {
    margin-right: 0 !important;
}

/* Reset clearing for the new row */
.woocommerce ul.products li.product:nth-child(4n+1),
.woocommerce-page ul.products li.product:nth-child(4n+1) {
    clear: both !important;
}
/* Force 4 columns on the shop page */
.woocommerce ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important; /* Space between products */
}

.woocommerce ul.products li.product, 
.woocommerce-page ul.products li.product {
    /* (100% / 4) minus the gaps */
    width: calc(25% - 15px) !important; 
    margin: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
}

/* Responsive fix: 2 columns on mobile */
@media (max-width: 768px) {
    .woocommerce ul.products li.product {
        width: calc(50% - 10px) !important;
    }
}

/* Remove the forced 'clear' that WooCommerce adds to the first product of the old row */
.woocommerce ul.products li.first, 
.woocommerce-page ul.products li.first {
    clear: none !important;
}


