/*
 Theme Name:   JD Uniforms Pro
 Description:  Premium Standalone Theme for JD Uniforms
 Author:       Antigravity
 Version:      2.0.0
*/

:root {
    --jd-teal: #00798C;
    --jd-teal-dark: #005f6e;
    --jd-dark: #1e293b;
    --jd-slate: #64748b;
    --jd-light: #f1f5f9;
    --jd-white: #ffffff;
    --jd-border: #e2e8f0;
    --max-width: 1200px;
    --max-width: 1200px;
    --header-height: 80px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--jd-dark);
    line-height: 1.6;
    background-color: var(--jd-white);
    padding-top: var(--header-height);
    /* Compensation for fixed header */
}

/* Offset anchor targets for fixed header */
[id] {
    scroll-margin-top: calc(var(--header-height) + 20px);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

img {
    max-width: 100%;
    height: auto;
}

/* Utilities */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background-color: var(--jd-teal);
    color: white;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn:hover {
    background-color: var(--jd-teal-dark);
    transform: translateY(-1px);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}


h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* Hero Section */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--jd-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    position: relative;
    padding: 0 30px;
}

/* Logo - left side */
.site-branding {
    flex-shrink: 0;
    z-index: 2;
}

.site-branding img,
.custom-logo {
    max-height: 50px;
    width: auto;
}

/* Navigation - absolutely centered on page */
.main-navigation {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    height: 100%;
}

.main-navigation>ul {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.main-navigation>ul>li {
    position: static;
    height: 100%;
    display: flex;
    align-items: center;
}

.main-navigation>ul>li>a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--jd-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.main-navigation>ul>li>a:hover {
    color: var(--jd-teal);
}

/* Actions - fits to content */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    flex-shrink: 0;
}

.header-icon {
    font-size: 1.1rem;
    color: var(--jd-dark);
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    position: relative;
}

.header-icon:hover {
    color: var(--jd-teal);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--jd-teal);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--jd-dark);
    cursor: pointer;
}

@media (max-width: 768px) {
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        padding: 20px;
    }

    .main-navigation.toggled {
        display: flex;
    }

    .main-navigation>ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .main-navigation>ul>li {
        width: 100%;
        height: auto;
    }

    .main-navigation>ul>li>a {
        padding: 15px 0;
        border-bottom: 1px solid var(--jd-border);
        width: 100%;
    }

    .menu-toggle {
        display: block;
    }
}

/* Hero Banner */
.jd-hero {
    background: url('images/hero-banner.png') center/cover no-repeat;
    color: var(--jd-dark);
    /* Changed to Dark text for light background */
    padding: 30px 20px 50px 20px;
    /* Reduced bottom padding since button is pushed down */
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    /* Align to top */
    justify-content: center;
}

.jd-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    /* Increased to allow text to fit on one line */
    margin: 0 auto;
    text-align: center;
    opacity: 0;
    animation: flowIn 1.5s ease-out forwards;
}

@keyframes flowIn {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.jd-hero h2 {
    font-size: 2.2rem;
    /* Reduced from 3.5rem to fit better */
    margin-bottom: 5px;
    /* Tiny gap between lines */
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--jd-dark);
    /* Soft white glow */
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.jd-hero p {
    font-size: 1.5rem;
    margin-bottom: 320px;
    /* Reduced gap to shorten banner height */
    /* Space before button */
    opacity: 1;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    margin-top: 0;
}

.jd-btn {
    display: inline-block;
    background: var(--jd-teal);
    /* Teal button pops better on photo */
    color: white;
    padding: 15px 35px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 121, 140, 0.3);
}

.jd-btn:hover {
    background: var(--jd-teal-dark);
    color: white;
    transform: translateY(-2px);
}

/* Features Section */
.jd-features {
    padding: 80px 20px;
    background: white;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.jd-feature-icon {
    font-size: 2.5rem;
    color: var(--jd-teal);
    margin-bottom: 20px;
}

/* Products Section */
.jd-products-section {
    padding: 80px 20px;
    background: var(--jd-light);
}

.jd-section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--jd-dark);
}

.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    padding: 0 !important;
    /* Remove browser default padding */
    margin: 0 auto !important;
    justify-content: center;
}

.woocommerce ul.products li.product {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;

    /* Content Alignment */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;

    /* Fix for Grid Conflict */
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    box-sizing: border-box;
}

/* Desktop Grid: 4 Columns */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
}

/* Clear floats that might interfere */
.woocommerce ul.products:before,
.woocommerce ul.products:after {
    content: none !important;
    display: none !important;
}

.woocommerce ul.products li.product img {
    margin: 0 auto 15px;
    /* Ensure images are centered */
    display: block;
}

.woocommerce ul.products li.product .button {
    margin-top: auto;
    /* Push button to bottom */
}

/* Header */
.site-header {
    height: var(--header-height);
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo */
.site-branding {
    display: flex;
    align-items: center;
}

.custom-logo-link img,
.site-branding img {
    max-height: 60px;
    width: auto;
    mix-blend-mode: multiply;
    /* Simulate transparency */
}

.text-logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--jd-teal);
    letter-spacing: -0.5px;
}

.main-navigation {
    display: block;
    /* Ensure visible on desktop */
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-navigation a {
    font-weight: 600;
    font-size: 1.09rem;
    color: var(--jd-dark);
}

.main-navigation a:hover {
    color: var(--jd-teal);
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-icon {
    font-size: 1.425rem;
    color: var(--jd-dark);
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--jd-teal);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Footer */
.site-footer {
    background: var(--jd-dark);
    color: var(--jd-slate);
    padding: 80px 0 30px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.footer-heading {
    color: white;
    margin-bottom: 25px;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.footer-links,
.footer-contact {
    list-style: none;
}

.footer-links li,
.footer-contact li {
    margin-bottom: 12px;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--jd-teal);
}

.site-info {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    font-size: 0.9rem;
}

/* WooCommerce Overrides */
.woocommerce ul.products li.product .price {
    color: var(--jd-teal);
    font-weight: bold;
    font-size: 1.1rem;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce #respond input#submit.alt {
    background-color: var(--jd-teal);
    color: white;
}

.woocommerce a.button.alt:hover,
/* Page Layouts */
.main-content-area {
    min-height: 60vh;
}

.entry-header {
    margin-bottom: 40px;
    text-align: center;
}

.entry-title {
    font-size: 2.5rem;
    color: var(--jd-dark);
}

.entry-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* WooCommerce Wrapper Styling */
.jd-woocommerce-container {
    padding: 60px 20px;
}

/* WC Messages */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    background-color: var(--jd-light);
    border-top: 3px solid var(--jd-teal);
    color: var(--jd-dark);
}

/* WC Buttons */
.single_add_to_cart_button {
    background-color: var(--jd-teal) !important;
    color: white !important;
    padding: 15px 30px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
}

.price {
    color: var(--jd-teal-dark) !important;
    font-size: 1.5rem !important;
    font-weight: bold;
}

/* --- Mobile Responsiveness --- */

/* Mobile Toggle - Hidden on Desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--jd-dark);
}

@media (max-width: 768px) {

    /* Header Adjustments */
    .site-header {
        height: auto;
        padding: 15px 0;
    }

    .header-inner {
        flex-wrap: wrap;
        /* Allow wrapping */
        padding-bottom: 10px;
    }

    .site-branding {
        order: 1;
        flex: 1;
    }

    .header-actions {
        order: 2;
    }

    .menu-toggle {
        display: block;
        order: 3;
        margin-left: 20px;
    }

    /* Mobile Menu - Hidden by default, shown when toggled */
    .main-navigation {
        display: none;
        width: 100%;
        order: 4;
        margin-top: 15px;
        border-top: 1px solid var(--jd-border);
    }

    .main-navigation.toggled {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 20px 0;
    }

    /* Hero Text Sizing */
    .jd-hero h1 {
        font-size: 2.2rem;
        /* Smaller on mobile */
    }

    .jd-hero {
        padding: 80px 20px;
    }

    /* Fix Grid Gaps */
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        /* Force 2 columns on mobile */
        gap: 15px !important;
    }

    .container {
        padding: 0 15px;
    }


    .entry-title {
        font-size: 1.8rem;
    }
}

/* Brand Carousel */
.brand-slide {
    text-align: center;
    transition: transform 0.3s ease;
}

.brand-slide:hover {
    transform: translateY(-5px);
}

.brand-link {
    display: block;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.brand-logo {
    max-height: 80px;
    /* Constrain logo height */
    width: auto !important;
    margin: 0 auto 15px;
    display: block;
    object-fit: contain;
}

/* Product Card Swiper */
.jd-product-card-swiper {
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    /* Keep square-ish */
    overflow: hidden;
    position: relative;
    margin-bottom: 15px;
}

.jd-product-card-swiper .swiper-wrapper {
    width: 100% !important;
}

.jd-product-card-swiper .swiper-slide {
    width: 100% !important;
    flex-shrink: 0;
}

.jd-product-card-swiper-fallback {
    width: 100%;
    min-width: 0;
    height: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    margin-bottom: 15px;
    display: block;
}

.jd-product-card-swiper-fallback img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0 !important;
}

.jd-product-card-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0 !important;
}

/* Hide arrows by default, show on hover */
.jd-product-card-swiper .swiper-button-next,
.jd-product-card-swiper .swiper-button-prev {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: var(--jd-teal);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.jd-product-card-swiper .swiper-button-next:after,
.jd-product-card-swiper .swiper-button-prev:after {
    font-size: 14px;
    font-weight: bold;
}

.jd-product-card-swiper:hover .swiper-button-next,
.jd-product-card-swiper:hover .swiper-button-prev {
    opacity: 1;
}

/* Ensure z-index is correct so clicks work */
.jd-product-card-swiper .swiper-button-next {
    right: 10px;
}


.jd-product-card-swiper .swiper-button-prev {
    left: 10px;
}

/* --- Slide-in Mini Cart --- */
.side-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.side-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-cart {
    position: fixed;
    top: 0;
    right: -400px;
    /* Hidden off screen */
    width: 380px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: right 0.3s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
}

.side-cart.active {
    right: 0;
}

.side-cart-header {
    background: var(--jd-dark);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-cart-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: white;
}

.close-side-cart {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.side-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Customize Widget Cart Styles within Side Cart */
.side-cart .widget_shopping_cart_content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.side-cart .woocommerce-mini-cart__buttons {
    margin-top: auto;
    /* Push buttons to bottom */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-cart .button {
    width: 100% !important;
    text-align: center;
    border-radius: 4px;
    padding: 12px !important;
}

.side-cart .button.checkout {
    background: var(--jd-teal);
    color: white;
}

.side-cart .button:not(.checkout) {
    background: var(--jd-slate);
    color: var(--jd-dark);
}

/* --- Checkout Button Fix --- */
.woocommerce .wc-proceed-to-checkout {
    padding-bottom: 0 !important;
}

.woocommerce .wc-proceed-to-checkout .button.checkout-button {
    display: block !important;
    width: 100% !important;
    margin-bottom: 10px !important;
    font-size: 1.2rem !important;
    padding: 18px !important;
    height: auto !important;
    line-height: normal !important;
    background-color: var(--jd-teal) !important;
    color: white !important;
    text-align: center !important;
}

.woocommerce .wc-proceed-to-checkout .button.checkout-button:hover {
    background-color: var(--jd-teal-dark) !important;
    transform: translateY(-2px);
}



.brand-name {
    display: block;
    font-weight: 700;
    color: var(--jd-dark);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.swiper-pagination-bullet-active {
    background: var(--jd-teal) !important;
}

.swiper-button-next,
.swiper-button-prev {
    color: var(--jd-teal) !important;
}

/* --- Custom Product Layout --- */
.product_layout_wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .product_layout_wrapper {
        grid-template-columns: 1fr;
    }
}

/* Custom Add to Cart Form */
.variations {
    margin-bottom: 20px;
}

.variations select {
    padding: 10px;
    border: 1px solid var(--jd-border);
    border-radius: 4px;
    width: 100%;
    max-width: 300px;
}

.quantity .input-text {
    padding: 10px;
    border: 1px solid var(--jd-border);
    width: 60px;
    text-align: center;
    border-radius: 4px;
    margin-right: 10px;
}

/* Ensure quantity selector shows on single product */
.single-product .quantity {
    display: inline-flex !important;
    align-items: center;
    margin-right: 15px;
}

.single-product form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.single-product form.cart .quantity {
    width: auto;
    margin-bottom: 0;
}

.single-product form.cart .quantity .qty {
    width: 70px;
    height: 45px;
    padding: 10px;
    border: 1px solid var(--jd-border);
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

.single-product form.cart .single_add_to_cart_button {
    height: 45px;
    padding: 0 30px;
}

/* Variable product variation add to cart */
.single-product .woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.single-product .woocommerce-variation-add-to-cart .quantity {
    display: inline-flex !important;
}

.single-product .woocommerce-variation-add-to-cart .quantity .qty {
    width: 70px;
    height: 45px;
    padding: 10px;
    border: 1px solid var(--jd-border);
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}


/* Fix Horizontal Scroll */
body,
html {
    overflow-x: hidden;
    width: 100%;
}

.jd-home-container {
    overflow: hidden;
    width: 100%;
}


/* --- Advanced UI Features --- */

/* 1. Product Card Hover (Image Swap) */
.product-image-wrapper {
    position: relative;
    width: 100%;
    /* Aspect ratio hack or fixed height if needed, depends on container */
    padding-bottom: 100%;
    /* Square */
    overflow: hidden;
    margin-bottom: 15px;
}

.product-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
}

.product-image-wrapper .hover-image {
    opacity: 0;
    z-index: 2;
}

.product-card-link:hover .hover-image {
    opacity: 1;
}

.product-card-link:hover .main-image {
    opacity: 0;
    /* Optional: fade out main image slightly */
}

/* 2. Color Swatches on Card */
.jd-color-swatches {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 14px;
    /* Maintain height to avoid jump */
}

.swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.swatch:hover {
    transform: scale(1.3);
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 3. Mega Menu (Full Width) - Professional Vertical Design */
.header-inner {
    position: relative;
}

.main-navigation>ul>li {
    position: relative;
}

/* Dropdown Container - Centered under each item */
.main-navigation>ul>li>ul.sub-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    min-width: 220px;
    width: auto;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 15px 0;
    display: none;
    flex-direction: column;
    border-top: 3px solid var(--jd-teal);
    border-radius: 0 0 8px 8px;
    z-index: 1002;
    margin-top: 0;
    opacity: 0;
}

/* Show on Hover */
.main-navigation>ul>li:hover>ul.sub-menu {
    display: flex;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Each Sub-menu Item */
.main-navigation>ul>li>ul.sub-menu>li {
    width: 100%;
    padding: 0;
    border: none;
    transition: background-color 0.15s ease;
}

.main-navigation>ul>li>ul.sub-menu>li:hover {
    background-color: rgba(0, 121, 140, 0.06);
}

/* Dropdown Item Links */
.main-navigation>ul>li>ul.sub-menu>li>a {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--jd-dark);
    padding: 12px 25px;
    margin: 0;
    border: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.main-navigation>ul>li>ul.sub-menu>li>a:hover {
    color: var(--jd-teal);
    background-color: rgba(0, 121, 140, 0.06);
}

/* Nested Sub-menus (Level 3) - Hidden by default since we have flat structure */
.main-navigation>ul>li>ul.sub-menu>li>ul.sub-menu {
    position: static;
    box-shadow: none;
    padding: 15px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: transparent;
    border: none;
    min-width: 0;
}

.main-navigation>ul>li>ul.sub-menu>li>ul.sub-menu>li {
    width: 100%;
    padding: 0;
    border: none;
}

.main-navigation>ul>li>ul.sub-menu>li>ul.sub-menu>li>a {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--jd-slate);
    padding: 8px 0;
    border: none;
    position: relative;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.main-navigation>ul>li>ul.sub-menu>li>ul.sub-menu>li>a::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--jd-teal);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease, left 0.2s ease;
}

.main-navigation>ul>li>ul.sub-menu>li>ul.sub-menu>li>a:hover {
    color: var(--jd-teal);
    padding-left: 15px;
}

.main-navigation>ul>li>ul.sub-menu>li>ul.sub-menu>li>a:hover::before {
    opacity: 1;
    left: 0;
}

/* Animation - opacity only to avoid alignment issues */
@keyframes megaMenuFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 4. Layout Fixes */
.woocommerce ul.products li.product {
    /* Ensure card height includes new elements */
    min-height: 480px;
}



/* --- Hotfix for 'Big Tiles' (Resolution) --- */
.jd-products-section .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 30px !important;
}

.jd-products-section .woocommerce ul.products li.product {
    width: auto !important;
    /* Override force-width */
    max-width: 100% !important;
    margin: 0 !important;
}

@media (max-width: 1024px) {
    .jd-products-section .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .jd-products-section .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}



/* --- Critical Fix for Product Image Size --- */
.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 280px !important;
    /* Fixed height instead of padding-bottom */
    padding-bottom: 0 !important;
    /* Override previous 100% */
    overflow: hidden;
    margin-bottom: 15px;
}

.woocommerce ul.products li.product {
    min-height: auto !important;
    /* Remove 480px constraint */
}

.woocommerce-loop-product__title {
    font-size: 0.95rem !important;
    margin: 10px 0 5px 0 !important;
    line-height: 1.3 !important;
}



/* --- CRITICAL FIX: Correct Selectors for Product Grid --- */
ul.products.columns-4 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 30px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

ul.products.columns-4 li.product {
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

ul.products.columns-4 li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

@media (max-width: 1024px) {
    ul.products.columns-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    ul.products.columns-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 15px !important;
    }
}



/* --- Announcement Bar --- */
.announcement-bar {
    background: #19135B;
    /* Navy blue matching scrubs4u.ca */
    color: white;
    text-align: center;
    padding: 8px 0;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    position: relative;
    z-index: 1001;
    display: none;
    /* Controlled by JS */
    height: 36px;
    overflow: hidden;
}

.announcement-bar .container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.announcement-messages {
    position: relative;
    width: 100%;
    height: 20px;
}

.announcement-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.3px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}

.announcement-message.active {
    opacity: 1;
    visibility: visible;
}

.announcement-bar a {
    color: white;
    font-weight: 600;
    margin-left: 5px;
    text-decoration: underline;
}

.announcement-bar a:hover {
    opacity: 0.8;
}

#close-announcement {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 10;
}

#close-announcement:hover {
    opacity: 1;
}

/* --- Search Overlay --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 800px;
    position: relative;
    padding: 20px;
}

.search-form {
    display: flex;
    border-bottom: 2px solid var(--jd-dark);
}

.search-field {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 2rem;
    padding: 15px 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--jd-dark);
}

.search-field:focus {
    outline: none;
}

.search-submit {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--jd-dark);
    cursor: pointer;
}

.close-search {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    font-size: 3rem;
    color: var(--jd-dark);
    cursor: pointer;
}

.search-icon {
    background: none;
    border: none;
    cursor: pointer;
}


/* 5. Product Detail Enhancements */
/* Sezzle */
.sezzle-promo {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--jd-slate);
}

.sezzle-promo strong {
    color: var(--jd-dark);
}

.sezzle-logo {
    background: #000;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-left: 3px;
}

/* Swatches */
.size-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.swatch-btn {
    border: 1px solid var(--jd-border);
    background: white;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--jd-slate);
    transition: all 0.2s;
    min-width: 50px;
    text-align: center;
}

.swatch-btn:hover {
    border-color: var(--jd-teal);
    color: var(--jd-teal);
}

.swatch-btn.active {
    border-color: var(--jd-teal);
    background: #e6fffa;
    /* Light teal tint */
    color: var(--jd-teal);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--jd-teal);
}

/* Embroidery Section */
.embroidery-section {
    border-top: 1px solid var(--jd-border);
    padding-top: 20px;
    margin-bottom: 25px;
}

.embroidery-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--jd-dark);
    user-select: none;
}

.embroidery-toggle input[type='checkbox'] {
    width: 18px;
    height: 18px;
    accent-color: var(--jd-teal);
}

.embroidery-fields {
    margin-top: 15px;
    background: #f8fafc;
    border: 1px solid var(--jd-border);
    border-radius: 4px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.embroidery-fields .form-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.embroidery-fields label {
    font-size: 0.9rem;
    color: var(--jd-slate);
    font-weight: 500;
}

.embroidery-fields input,
.embroidery-fields select {
    padding: 10px;
    border: 1px solid var(--jd-border);
    border-radius: 4px;
    width: 100%;
    font-size: 0.95rem;
}

.embroidery-fields input:focus,
.embroidery-fields select:focus {
    border-color: var(--jd-teal);
    outline: none;
}

/* Refined Product Card (Left Aligned like Reference) */
.woocommerce ul.products li.product {
    text-align: left !important;
    align-items: flex-start !important;
}

.woocommerce ul.products li.product .price {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem !important;
    color: var(--jd-dark) !important;
}

.woocommerce-loop-product__title {
    text-align: left !important;
    font-size: 1rem !important;
    margin-bottom: 5px !important;
}

.jd-color-swatches {
    justify-content: flex-start !important;
    gap: 6px !important;
    margin-top: 5px;
    margin-bottom: 5px;
    padding-left: 2px;
}

.swatch {
    width: 14px !important;
    height: 14px !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
    /* Subtle ring */
}

/* Ensure Button is full width or left aligned? */
.woocommerce ul.products li.product .button {
    width: 100%;
    text-align: center;
    margin-top: 10px;
}


/* Color Selection (Single Product) */
.product-color-swatches {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.color-swatch-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    outline: none;
    position: relative;
    background-clip: padding-box;
}

.color-swatch-btn:hover {
    transform: scale(1.15);
}

.color-swatch-btn.active {
    box-shadow: 0 0 0 3px white, 0 0 0 5px var(--jd-dark);
    /* Double ring */
    transform: scale(1.05);
    z-index: 1;
}

/* Image-based swatch buttons (vendor swatch image from jdpm_swatch_url) */
.color-swatch-btn.has-swatch-img { background: none; overflow: hidden; }
.color-swatch-btn.has-swatch-img img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.jd-color-swatches .swatch.swatch-img { padding: 0; overflow: hidden; background: none !important; }
.jd-color-swatches .swatch.swatch-img img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

/* Label Update Highlight */
#selected-color-label {
    transition: color 0.3s;
}


/* Mega Menu Fix */
.main-navigation,
.main-navigation>ul,
.main-navigation>ul>li {
    height: 100%;
}

.main-navigation>ul {
    align-items: center;
}

.main-navigation>ul>li {
    display: flex;
    align-items: center;
}

.main-navigation a {
    display: flex;
    /* Ensures hit area */
    align-items: center;
    height: 100%;
}

/* Side Cart CSS */
.mini-cart-qty {
    transition: border-color 0.2s;
}

.mini-cart-qty:focus {
    border-color: var(--jd-teal) !important;
    outline: none;
}


/* Mega Menu Bridge Fix */
.main-navigation>ul>li>ul.sub-menu::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 30px;
    background: transparent;
}


/* Quantity Selector with +/- Buttons */
.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--jd-border);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-selector .qty-btn {
    background: white;
    border: none;
    width: 36px;
    height: 36px;
    font-size: 18px;
    color: var(--jd-dark);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-selector .qty-btn:hover {
    background-color: var(--jd-light);
}

.quantity-selector .qty-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--jd-border);
    border-right: 1px solid var(--jd-border);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    -moz-appearance: textfield;
}

.quantity-selector .qty-input::-webkit-outer-spin-button,
.quantity-selector .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Mini Cart Quantity Selector */
.quantity-selector-mini {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--jd-border);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-selector-mini .qty-btn-mini {
    background: white;
    border: none;
    width: 28px;
    height: 28px;
    font-size: 14px;
    color: var(--jd-dark);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-selector-mini .qty-btn-mini:hover {
    background-color: var(--jd-light);
}

.quantity-selector-mini .mini-cart-qty {
    width: 40px;
    height: 28px;
    border: none;
    border-left: 1px solid var(--jd-border);
    border-right: 1px solid var(--jd-border);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    -moz-appearance: textfield;
}

.quantity-selector-mini .mini-cart-qty::-webkit-outer-spin-button,
.quantity-selector-mini .mini-cart-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* Hover bridge to prevent menu from disappearing */
.main-navigation>ul>li:hover::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 10px;
    background: transparent;
}

/* ------------------------------------------------------------------------- *
 *  Side Cart - Premium Design
 * ------------------------------------------------------------------------- */
.side-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.side-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-cart {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.side-cart.active {
    right: 0;
}

/* Header */
.side-cart-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    flex-shrink: 0;
}

.side-cart-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #222;
}

.close-side-cart {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-side-cart:hover {
    background: #f5f5f5;
    color: #333;
}

/* Content Area */
.side-cart-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Free Shipping Progress Bar */
.free-shipping-bar {
    padding: 15px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.free-shipping-bar .shipping-message {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #333;
    text-align: center;
}

.free-shipping-bar .shipping-message strong {
    color: var(--jd-teal);
}

.free-shipping-bar .shipping-message.success {
    color: #28a745;
    font-weight: 600;
}

.free-shipping-bar .shipping-message.success i {
    margin-right: 5px;
}

.shipping-progress {
    height: 8px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
}

.shipping-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--jd-teal), #00a896);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Empty Cart */
.side-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    text-align: center;
    height: 100%;
}

.side-cart-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}

.side-cart-empty p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
}

.side-cart-empty .continue-shopping {
    background: var(--jd-teal);
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.side-cart-empty .continue-shopping:hover {
    background: #006570;
}

/* Cart Items */
.side-cart-items {
    flex: 1;
    padding: 0;
}

.side-cart-item {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    transition: background 0.2s ease;
}

.side-cart-item:hover {
    background: #fafafa;
}

.side-cart-item .item-image {
    flex-shrink: 0;
    width: 75px;
    height: 75px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.side-cart-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.side-cart-item .item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.side-cart-item .item-name {
    font-weight: 600;
    color: #222;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.side-cart-item .item-name:hover {
    color: var(--jd-teal);
}

.side-cart-item .item-variation {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 6px;
}

.side-cart-item .item-price-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-cart-item .item-price {
    font-weight: 700;
    color: var(--jd-teal);
    font-size: 0.95rem;
}

.side-cart-item .item-qty {
    color: #888;
    font-size: 0.85rem;
}

.side-cart-item .remove-item {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 8px;
    font-size: 14px;
    transition: color 0.2s ease;
}

.side-cart-item .remove-item:hover {
    color: #e74c3c;
}

/* Cart Footer */
.side-cart-footer {
    padding: 20px 25px 25px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.cart-subtotal span:first-child {
    font-weight: 500;
    color: #555;
}

.cart-subtotal .subtotal-amount {
    font-weight: 700;
    color: #222;
}

.shipping-note {
    font-size: 0.8rem;
    color: #888;
    margin: 0 0 20px 0;
    text-align: center;
}

.cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-buttons .button {
    display: block;
    text-align: center;
    padding: 14px 20px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cart-buttons .checkout-btn {
    background: var(--jd-teal) !important;
    color: white !important;
}

.cart-buttons .checkout-btn:hover {
    background: #006570 !important;
}

/* Quantity Controls in Side Cart - Clean minimal style */
.qty-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-left: 10px;
}

.qty-controls .qty-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.qty-controls .qty-btn:hover {
    color: var(--jd-teal);
}

.qty-controls .qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
}

/* Product Page Quantity Controls */
.qty-wrapper {
    display: inline-flex !important;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.qty-wrapper .qty-btn {
    width: 36px;
    height: 40px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.qty-wrapper .qty-btn:hover {
    color: var(--jd-teal);
    background: #f5f5f5;
}

.qty-wrapper .qty {
    width: 50px !important;
    height: 40px;
    border: none !important;
    border-left: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qty-wrapper .qty::-webkit-outer-spin-button,
.qty-wrapper .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Mobile */
@media (max-width: 480px) {
    .side-cart {
        width: 100%;
        right: -100%;
    }
}
/* ============================================================
   Length Variants pill block (PDP)
   ============================================================ */
.jd-length-variants {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 12px 0 18px;
    font-size: 14px;
    color: #333;
}
.jd-length-variants__label {
    font-weight: 600;
    color: #555;
}
.jd-length-variants__pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}
.jd-length-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 1px solid #d4d4d4;
    border-radius: 999px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
    cursor: pointer;
}
a.jd-length-pill:hover {
    border-color: #111;
    background: #f6f6f6;
    color: #111;
}
.jd-length-pill.is-active {
    border-color: #111;
    background: #111;
    color: #fff;
    cursor: default;
}
.jd-length-pill.is-oos {
    opacity: 0.65;
}
.jd-length-pill__oos {
    font-size: 11px;
    color: #999;
    margin-left: 2px;
}
.jd-length-pill.is-active .jd-length-pill__oos {
    color: #ddd;
}
@media (max-width: 480px) {
    .jd-length-variants { font-size: 13px; gap: 6px 8px; }
    .jd-length-pill { padding: 7px 12px; font-size: 13px; }
}

/* --- Related Products Fix --- */
.related.products,
.upsells.products {
    overflow: hidden;
    width: 100%;
}

.related.products ul.products,
.upsells.products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
}

.related.products ul.products li.product,
.upsells.products ul.products li.product {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    float: none !important;
}

@media (max-width: 1024px) {
    .related.products ul.products,
    .upsells.products ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .related.products ul.products,
    .upsells.products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
