/* ============================================================
   SLV WooCommerce Layout — FINAL CLEAN + STABLE + FIXED
   Grid: 5 desktop / 3 tablet / 2 mobile
   Container: 1200px
   Card background: #f2f2f2
   Version: FINAL
=========================================================== */


/* ============================================================
   GLOBAL WRAPPER
=========================================================== */
.lsm-woo-wrapper,
body.woocommerce .lsm-main,
body.tax-product_cat .lsm-main,
body.tax-product_tag .lsm-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 2rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Smart Slider — flush against nav */
.woocommerce-shop .n2-section-smartslider,
.woocommerce-product-category .n2-section-smartslider,
body.woocommerce .n2-section-smartslider {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
}

/* Remove top gap above slider */
body.woocommerce-shop .lsm-main,
body.tax-product_cat .lsm-main,
body.tax-product_tag .lsm-main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}


/* ============================================================
   PRODUCT GRID — CLEAN + UNIFIED
=========================================================== */

.woocommerce ul.products,
ul.products {
    display: grid !important;
    gap: 20px !important;
    margin: 20px auto !important;
    padding: 0 !important;
    max-width: 1200px !important;
}

/* Desktop — 5 columns */
@media (min-width: 1025px) {
    .woocommerce ul.products,
    ul.products {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* Tablet — 3 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .woocommerce ul.products,
    ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Mobile — 2 columns */
@media (max-width: 768px) {
    .woocommerce ul.products,
    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }

    ul.products li.product,
    ul.products li.lsm-product-card {
        width: auto !important;
        float: none !important;
    }
}


/* ============================================================
   PRODUCT CARD — VISUALS PRESERVED + BACKGROUND FIXED
=========================================================== */

.lsm-product-card,
.woocommerce ul.products li.product {
    background: #f2f2f2 !important; /* FIX: !important stops theme white override */
    border: 1px solid #d0d0d0 !important;
    border-radius: 10px !important;
    padding: 10px !important;
    margin: 0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    transition: border-color .2s ease, box-shadow .2s ease;
    display: flex !important;
    flex-direction: column !important;
}

/* Hover */
.lsm-product-card:hover,
.woocommerce ul.products li.product:hover {
    border-color: var(--slv-button-grad-end) !important;
    box-shadow: 0 10px 25px rgba(15,23,42,0.12) !important;
    transform: translateY(-2px);
}

/* FIX: Scope max-width to LOOP pages only — NOT single product page */
body:not(.single-product) .woocommerce ul.products li.product,
body:not(.single-product) .woocommerce-page ul.products li.product {
    max-width: 260px !important;
    margin: 0 auto !important;
}

/* Product image */
.woocommerce ul.products li.product a img {
    border-radius: 6px !important;
    margin-bottom: 6px !important;
    height: auto !important;
    max-height: 260px !important;
    object-fit: contain !important;
}

/* Title */
ul.products li.lsm-product-card h2,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    margin: 0.55rem 0 0.35rem !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--slv-primary) !important;
    text-align: center !important;
    line-height: 1.25 !important;
}

/* Price */
ul.products li.lsm-product-card .price,
.woocommerce ul.products li.product .price {
    display: block !important;
    text-align: center !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--slv-primary) !important;
    margin: 0.25rem 0 0.15rem !important;
}

/* FIX: Restore .lsm-stock class — was missing entirely */
ul.products li.lsm-product-card .lsm-stock,
.woocommerce ul.products li.product .lsm-stock {
    display: inline-block !important;
    text-align: center !important;
    font-size: 0.78rem !important; /* FIX: locks stock text to small size */
    font-weight: 600 !important;
    color: #2e7d32 !important;
    background: rgba(46,125,50,0.12) !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    margin-bottom: 0.25rem !important;
}

/* WooCommerce default stock text — also lock to small size */
.woocommerce ul.products li.product .stock {
    font-size: 0.78rem !important;
    margin-bottom: 8px !important;
    text-align: center !important;
}

/* Price + stock wrapper */
.lsm-price-stock {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
    margin-bottom: 0.35rem !important;
}


/* ============================================================
   ACTION ROW — LOCKED SIZING
=========================================================== */

.lsm-card-footer {
    margin-top: auto !important;
    padding-top: 6px !important;
}

.lsm-actions-flex,
ul.products li.lsm-product-card .lsm-actions-flex {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 28px !important;
    margin-top: auto !important;
    justify-content: space-between !important;
}

/* Quantity box */
ul.products li.lsm-product-card .quantity input.qty,
.lsm-actions-flex .quantity input.qty {
    width: 32px !important;
    height: 28px !important;
    line-height: 28px !important;
    font-size: 0.72rem !important;
    padding: 0 !important;
    text-align: center !important;
    border-radius: 4px !important;
    border: 1px solid rgba(0,0,0,0.25) !important;
}

/* Add to Cart button */
ul.products li.lsm-product-card .button,
.lsm-actions-flex .button,
.woocommerce ul.products li.product .button {
    flex: 1 !important;
    height: 28px !important;
    font-size: 0.72rem !important;
    padding: 0 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    border-radius: 4px !important;
    background: linear-gradient(
        to bottom,
        var(--slv-button-grad-start),
        var(--slv-button-grad-end)
    ) !important;
    color: #ffffff !important;
    text-transform: none !important;
}

.woocommerce ul.products li.product .button:hover {
    opacity: .85;
}


/* ============================================================
   FEATURED + RELATED + UPSELL GRIDS
=========================================================== */

@media (max-width: 768px) {

    .lsm-featured-grid,
    .related.products ul.products,
    .upsells.products ul.products,
    .cross-sells ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .lsm-featured-grid .lsm-product-card,
    .related.products .lsm-product-card,
    .upsells.products .lsm-product-card {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }

    .lsm-featured-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
        width: 100% !important;
    }
}

@media (max-width: 479px) {
    .lsm-featured-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }

    .lsm-featured-grid .lsm-product-card {
        width: auto !important;
        float: none !important;
    }
}


/* ============================================================
   SINGLE PRODUCT PAGE — DESCRIPTION + ADDITIONAL INFO FIX
=========================================================== */

.single-product .woocommerce-tabs {
    clear: both !important;
    margin-top: 3rem !important;
    display: block !important;
    border-top: 1px solid rgba(0,0,0,0.12) !important;
    padding-top: 1.5rem !important;
    max-width: 100% !important; /* FIX: stops 260px bleeding in */
    width: 100% !important;
}

.single-product .woocommerce-tabs ul.tabs {
    display: flex !important;
    gap: 1rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 1rem !important;
    border-bottom: 1px solid rgba(0,0,0,0.15) !important;
}

.single-product .woocommerce-tabs ul.tabs li a {
    padding: 0.5rem 1rem !important;
    display: inline-block !important;
    font-weight: 600 !important;
    color: var(--slv-primary) !important;
    border-radius: 4px 4px 0 0 !important;
}

.single-product .woocommerce-tabs ul.tabs li.active a {
    background: var(--slv-phone-bg) !important;
    border-bottom: 2px solid var(--slv-primary) !important;
}

.single-product .woocommerce-tabs-panel,
.single-product #tab-description,
.single-product #tab-additional_information {
    padding: 1rem 0 !important;
    line-height: 1.6 !important;
    max-width: 100% !important; /* FIX: stops shift */
    width: 100% !important;
}

/* Single product add to cart */
.single-product form.cart {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 1.25rem 0 !important;
    flex-wrap: wrap !important;
}

.single-product form.cart .quantity input.qty {
    width: 55px !important;
    height: 38px !important;
    font-size: 1rem !important;
    text-align: center !important;
    padding: 0 !important;
}

.single-product form.cart button.single_add_to_cart_button {
    height: 38px !important;
    padding: 0 18px !important;
    font-size: 0.95rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

/* GPay / Express checkout */
.single-product .wc-stripe-payment-request-wrapper {
    display: block !important;
    width: 100% !important;
    margin-top: 1.25rem !important;
    clear: both !important;
    padding: 0.5rem 0 !important;
}

.single-product form.cart .gpay-button-fill {
    flex: 0 0 100% !important;
    order: 999 !important;
    margin-top: 1.25rem !important;
    display: block !important;
}

.single-product form.cart .gpay-button {
    width: 100% !important;
    display: block !important;
}


/* ============================================================
   CATEGORY PAGE — VISUALS PRESERVED
=========================================================== */

body.tax-product_cat h1.page-title {
    display: none !important;
}

body.tax-product_cat .lsm-nav {
    margin-bottom: 0 !important;
}

body.tax-product_cat .woocommerce-products-header {
    display: flex !important;
    justify-content: center !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.tax-product_cat .woocommerce-products-header img,
.woocommerce-product-category .woocommerce-products-header img {
    width: 100% !important;
    max-width: 1200px !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    object-fit: cover !important;
}

body.tax-product_cat .term-description img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
}

body.tax-product_cat .lsm-main {
    max-width: 1200px !important;
    margin: 0 auto !important;
    overflow-x: hidden !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box !important;
}

/* Space above/below sorting bar */
.woocommerce-shop .woocommerce-ordering,
.woocommerce-product-category .woocommerce-ordering {
    margin-top: 10px !important;
    margin-bottom: 20px !important;
}

/* Space above product grid */
.woocommerce-shop ul.products,
.woocommerce-product-category ul.products {
    margin-top: 20px !important;
}


/* ============================================================
   HEADER + NAV — VISUALS PRESERVED
=========================================================== */

body.woocommerce .lsm-nav .lsm-container,
body.tax-product_cat .lsm-nav .lsm-container,
body.tax-product_tag .lsm-nav .lsm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 0;
    padding-bottom: 0;
}

body.woocommerce .lsm-header-main,
body.tax-product_cat .lsm-header-main,
body.tax-product_tag .lsm-header-main {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body.woocommerce .lsm-header-main .lsm-container,
body.tax-product_cat .lsm-header-main .lsm-container,
body.tax-product_tag .lsm-header-main .lsm-container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Hide shop title */
.lsm-shop-header,
.lsm-shop-subtitle,
.lsm-shop-title {
    display: none !important;
}

/* Add to Cart button text color */
.lsm-featured-wrapper .add_to_cart_button,
.add_to_cart_button,
.button.product_type_simple.add_to_cart_button {
    color: #ffffff !important;
}


/* ============================================================
   BREADCRUMBS — VISUALS PRESERVED
=========================================================== */

.woocommerce-breadcrumb {
    font-size: 14px;
    color: #555;
    padding: 6px 0;
    margin-bottom: 18px;
    letter-spacing: 0.3px;
}

.woocommerce-breadcrumb a {
    color: #333;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.woocommerce-breadcrumb a:hover {
    color: #172d2c;
    border-bottom-color: #254949;
}


/* ============================================================
   PAGINATION — VISUALS PRESERVED
=========================================================== */

.woocommerce-pagination {
    margin-top: 3rem;
    text-align: center;
    width: 100%;
    display: block;
}

.woocommerce-pagination ul.page-numbers {
    display: inline-flex;
    gap: 6px;
    padding: 4px 8px;
    margin: 0;
    font-size: 0.75rem;
    list-style: none;
}

.woocommerce-pagination a,
.woocommerce-pagination span {
    padding: 6px 10px;
    border: 1px solid rgba(0,0,0,0.25);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--slv-primary);
    background: var(--slv-phone-bg);
}

.woocommerce-pagination .current {
    background: var(--slv-primary);
    color: #fff;
    border-color: var(--slv-primary);
}

/* ============================================================
   HOMEPAGE FEATURED GRID — COLUMNS ONLY
   Dark card styling preserved — no color overrides
=========================================================== */

/* Desktop — 5 columns */
@media (min-width: 1025px) {
    .lsm-featured-grid,
    .home ul.products,
    .page-template-default ul.products,
    .lsm-featured-wrapper ul.products {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 20px !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }
}

/* Tablet — 3 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .lsm-featured-grid,
    .home ul.products,
    .page-template-default ul.products,
    .lsm-featured-wrapper ul.products {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }
}

/* Mobile — 2 columns */
@media (max-width: 768px) {
    .lsm-featured-grid,
    .home ul.products,
    .page-template-default ul.products,
    .lsm-featured-wrapper ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .lsm-featured-grid li.product,
    .lsm-featured-grid .lsm-product-card,
    .home ul.products li.product {
        float: none !important;
        width: auto !important;
        margin: 0 !important;
    }
}

/* Prevent featured wrapper from constraining to 1 column */
.lsm-featured-wrapper,
.lsm-featured-section {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

/* Remove theme-injected category banner */
.wa-category-image {
    display: none !important;
}

/* Center the custom banner image */
.page-banner {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.page-banner img {
    display: block !important;
    margin: 0 auto !important;
    object-fit: cover !important;
}


/* REMOVE FIXED HEIGHT ON PRODUCT CARDS */
/* Prevent header from exceeding viewport width */
/* Make shop page container match category container */
.lsm-woo-wrapper {
    max-width: 1200px !important; /* match your theme’s main container */
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box !important;
}
