/* Shop loop category badges — matches the related-products block styling */
.product-loop-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 12px 0 4px;
    width: 100%;
}

.product-loop-badge {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    padding: 3px 15px;
    border: 2px solid #ccc;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.single-product .product-loop-badge{
    padding: 7px 15px;
}

.product-loop-badge:hover {
    opacity: 0.75;
}

.product-loop-badge img {
    width: 28px !important;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    margin-bottom: 0 !important;
    padding-right: 8px;
}

/* Per-category colours – mirrors the related-products block. Add slugs as needed. */
.product-loop-badge.cat-clothing-cleaning      { border-color: #f8be14; color: #184183; }
.product-loop-badge.equipment                  { border-color: #e100ff; color: #e100ff; }
.product-loop-badge.cat-deodorising            { border-color: #0078ba; color: #0078ba; }
.product-loop-badge.cat-footwear-deodorising   { border-color: #ff9900; color: #ff9900; }
.product-loop-badge.cat-footwear-cleaning      { border-color: #52389f; color: #52389f; }
.product-loop-badge.cat-cleaning               { border-color: #007e40; color: #007e40; }
.product-loop-badge.cat-waterproofing          { border-color: #4d2f79; color: #4d2f79; }
.product-loop-badge.cat-uv-protection          { border-color: #ea560d; color: #ea560d; }
.product-loop-badge.cat-impraegnieren          { border-color: #4d2f79; color: #4d2f79; }

/* SINGLE PRODUCT PAGE */

.single-product *:focus{
    outline: none;
}

.single-product .product{
    display: flex;
    flex-wrap: wrap;
    width: 100% !important;
}

.single-product .product .product__container {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-left: 50px;
    z-index: 0;
}

.single-product .product__sticky-details {
    position: sticky;
    top: 20px;
    align-self: flex-start;
    width: 100%;
}

.single-product .product .woocommerce-product-gallery{
    width: 60% !important;
    display: block;
    margin: 0 !important;
    order: -1;
}

.single-product .product .summary{
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0; /* let wide content (e.g. a long icon row) shrink instead of wrapping .summary below the gallery */
    padding-left: 50px;
    z-index: 0;
}

.single-product .product .product_title{
    font-size: 1.875rem !important;
    color: var(--nikwax-blue);
}

.single-product .product .product_title:not(:first-of-type){
    display: none;
}

.single-product.woocommerce .product p.price{
    font-weight: 900;
    color: var(--nikwax-blue);
    font-size: 2.25em;
}

.woocommerce.single-product .product .woocommerce-product-details__short-description h5{
    color: var(--nikwax-green);
    margin-bottom: 1.25rem;
    margin-top: 0;
}

.single-product .product .variations .variation-radios label{
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100px;
    height: 55px;
    border-radius: 0;
    border: 2px solid var(--nikwax-blue);
    color: var(--nikwax-blue);
    text-align: center !important;
}

.single-product .product .variations .variation-radios label.active{
    background-color: var(--nikwax-blue);
    color: var(--brand-white);
}

.single-product.woocommerce .single_add_to_cart_button{
    flex-grow: 1;
    background-color: var(--nikwax-green) !important;
    padding: 15px 23px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    position: relative;
    text-transform: uppercase;
}

/* Basket icon before the label (tinted to the button's text colour) */
.single-product.woocommerce .single_add_to_cart_button::before{
    content: "";
    flex-shrink: 0;
    width: 30px;
    height: 29px;
    background-color: #fff;
    -webkit-mask: url("../../icons/basket-icon.svg") no-repeat center / contain;
            mask: url("../../icons/basket-icon.svg") no-repeat center / contain;
}

/* Yellow arrow pinned to the right edge */
.single-product.woocommerce .single_add_to_cart_button::after{
    content: "";
    position: absolute;
    right: 23px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #f8be14;
}

.single-product a.woocommerce-product-gallery__trigger {
    background: #f2f2f2 !important;
    width: 115px !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center;
    gap: 5px;
    left: 10px;
    right: auto !important;
    z-index: 8 !important;
    top: auto !important;
}

.single-product.woocommerce div.product div.images .woocommerce-product-gallery__trigger::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 100%;
    background: url(data:image/svg+xml,%3Csvg%20id%3D%22Layer_2%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2027.55%2027.55%22%3E%3Cg%20id%3D%22Layer_1-2%22%3E%3Cpolygon%20points%3D%2227.55%208.04%2027.55%200%2019.52%200%2019.52%202.3%2023.63%202.3%2013.78%2012.15%203.92%202.3%208.04%202.3%208.04%200%200%200%200%208.04%202.3%208.04%202.3%203.92%2012.15%2013.78%202.3%2023.63%202.3%2019.52%200%2019.52%200%2027.55%208.04%2027.55%208.04%2025.26%203.92%2025.26%2013.78%2015.4%2023.63%2025.26%2019.52%2025.26%2019.52%2027.55%2027.55%2027.55%2027.55%2019.52%2025.26%2019.52%2025.26%2023.63%2015.4%2013.78%2025.26%203.92%2025.26%208.04%2027.55%208.04%22/%3E%3C/g%3E%3C/svg%3E) no-repeat center center;
    background-size: 15px;
    flex-shrink: 0;
    transform: none !important;
    border: 0;
    left: 9px;
    top: 7px;
    position: absolute;
    box-sizing: content-box;
}

.single-product.woocommerce div.product div.images .woocommerce-product-gallery__trigger::after {
    content: 'Full screen';
    font-size: 12px;
    background: transparent !important;
    text-indent: 0;
    display: inline-block;
    flex-grow: 1;
    height: auto;
    line-height: 1;
    transform: none !important;
    width: auto;
    /* padding-left: 15px; */
    top: 1px;
    position: relative;
    left: 38px;
    box-sizing: content-box;
}

.single-product .thumbs-scroll {
    flex-wrap: wrap !important;
    width: 80px;
    min-width: 50px;
    position: absolute;
    right: 20px;
    top: 0;
    overflow: auto;
    align-content: flex-start;
    display: flex;
    /* flex-direction: column; */
    align-items: center;
    height: calc(90% - 400px);
    /* align-content: center; */
}

.single-product .thumbs-scroll__button {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    margin: auto;
    height: 30px;
    bottom: auto;
    position: absolute;
    z-index: 1;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.single-product button.thumbs-scroll__button.thumbs-scroll__button--next {
    top: auto;
    bottom: 0;
}

.single-product button.thumbs-scroll__button.thumbs-scroll__button--next img{
    rotate: 180deg;
}

.single-product .thumbs-scroll__button:focus{
    outline: none;
}

/* Greyed out + unclickable once there's nothing left to scroll to in that
   direction (state is set in woo.js via the `disabled` attribute). */
.single-product .thumbs-scroll__button:disabled,
.single-product .thumbs-scroll__button.is-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.single-product img.thumbs-scroll__icon {
    width: 15px !important;
    padding: 0 !important;
}

.single-product .thumbs-scroll__container{
    overflow-y: auto;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    /* padding: 20px 0; */
    /* max-height: 600px; */
    height: calc(100% - 70px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    margin-top: 35px;
}

.single-product .flex-control-thumbs{
    overflow: hidden;
    zoom: 1;
    margin: 0;
    padding: 0;
}

.single-product .flex-control-thumbs li{
    flex-basis: 80px !important;
    list-style-type: none !important;
    width: 80px !important;
    height: 80px;
    border: 1px solid #f3f3f3;
    margin: 5px 0 !important;
    display: flex;
    align-items: center;
    float: left;
    list-style: none;
}

.single-product .woocommerce-product-gallery li {
    flex-basis: 80px !important;
    list-style-type: none !important;
    width: 80px !important;
    height: 80px;
    border: 1px solid #f3f3f3;
    margin: 5px 0 !important;
    display: flex;
    align-items: center;
}

.woocommerce div.product div.images .woocommerce-product-gallery__image a{
    height: 100%;
}

.single-product.woocommerce #page div.product .woocommerce-product-gallery .flex-control-nav img {
    width: auto !important;
    padding: 0;
    max-height: 100%;
    margin: 0 auto !important;
    height: 100%;
    object-fit: cover !important;
    opacity: 1 !important;
}

.single-product .woocommerce-product-gallery__image{
    height: 600px;
}

.single-product .woocommerce-product-gallery__image.flex-active-slide{
    display: flex !important;
    justify-content: center;
    height: 600px;
}

.single-product .woocommerce-product-gallery__image.flex-active-slide a{
    align-items: center;
}

.single-product.woocommerce #page div.product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper img {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    padding: 0;
    max-height: 800px;
}

.single-product .woocommerce-product-gallery:has(.thumbs-scroll) {
    padding-right: 120px;
    box-sizing: border-box;
}

.single-product .qty-wrap{
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ddd;
    overflow: hidden;
    width: 100%;
}

.single-product .qty-btn{
    border: 0;
    background: transparent;
    padding: 5px;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    border-radius: 0 !important;
    color: #000;
}

.single-product .quantity .qty.text{
    margin: 0;
    width: inherit;
    flex: 1;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    height: 100%;
    font-weight: 600;
    font-size: 18px;
    padding: 10px;
}

.single-product input[type=number]::-webkit-inner-spin-button,
.single-product input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.single-product input[type=number] { -moz-appearance: textfield; }

.single-product .quantity .quantity-button, .quantity .quantity-nav{
    display: none;
}

.single-product .woocommerce-variation-add-to-cart,
.single-product .quantity, 
.single-product .single_variation_wrap{
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;

}

.single-product .woocommerce-variation-add-to-cart{
    flex: none;
    flex-basis: 100%;
    padding-top: 15px !important;
}

.single-product div.product form.cart .quantity {
    flex-basis: 95px;
    background: #e5e5e5;
    margin-right: 5px;
    margin-bottom: 0;
}

.single-product .woocommerce-tabs.wc-tabs-wrapper{
    background: transparent;
    margin: 0;
    padding: 5px 0 0px;
    opacity: 0;
}

.single-product .accordion-toggle{
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 9px;
    font-weight: bold;
    border-bottom: 1px solid #000;
    cursor: pointer;
    text-align: left;
    transition: background 0.3s ease;
    font-size: 1.125rem;
}

.single-product .accordion-label{
    flex: 1;
}

.single-product .accordion-icon{
    width: 20px;
    height: auto;
    margin-left: 1em;
    transition: transform 0.3s ease;
    max-width: 100%;
}

.single-product .woocommerce-Tabs-panel{
    margin-bottom: 0 !important;
    padding: 0 15px !important;
    display: none;
}

.single-product .woocommerce-Tabs-panel.open{
    display: block;
}

.single-product.woocommerce .woocommerce-tabs .panel{
    width: 100%;
}

.single-product.woocommerce .whyuse-description{
    padding: 0;
    padding-top: 20px;
}

.single-product .woocommerce-tabs .panel h2:first-of-type{
    font-size: 20px;
}

.single-product .woocommerce-tabs .panel *{
    color: #000;
}

.single-product .woocommerce-tabs .panel h3{
    color: #000 !important;
    font-size: 18px;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

.single-product a.reset_variations{
    display: none;
}

.single-product .woocommerce-product-details__short-description h2{
    font-size: 1.125rem;
    margin-bottom: 0.625rem;
    margin-top: 0;
}

.single-product a.reset_variations {
    display: none !important;
}

.woocommerce.single-product .variations_form .single_variation_wrap .woocommerce-variation .woocommerce-variation-price{
    display: none;
}

.woocommerce.single-product div.product p.stock{
    display: none;
}

.woocommerce:where(body:not(.woocommerce-uses-block-theme)) div.product p.price, 
.woocommerce:where(body:not(.woocommerce-uses-block-theme)) div.product span.price {
    color:var(--nikwax-blue);;
}

/* BREADCRUMBS */

#page .storefront-breadcrumb{
    background: none;
    background-color: var(--nikwax-green);
}

@media screen and (min-width: 960px) {
    #page .storefront-breadcrumb .woocommerce-breadcrumb {
        margin-left: 220px;
    }
}

@media (min-width: 768px) {
	.single-product .breadcrumbs{
		margin-bottom: 3.750rem;
	}   
}

@media screen and (max-width: 1000px) {

    .single-product .product .woocommerce-product-gallery{
        display: block !important;
        min-height: 0;
        min-width: 0;
        margin-right: 0 !important;
        position: relative;
        width: 100% !important;
        flex-basis: 100%;
        margin-bottom: 50px !important;
    }

    .single-product .woocommerce-product-gallery:has(.thumbs-scroll) {
        padding-right: 0;
    }

    .single-product .woocommerce-product-gallery__image.flex-active-slide{
        height: 100%;
        max-height: 350px;
    }

    .single-product .product .summary{
        flex-basis: 100%; /* stack under the full-width gallery; flex: 1 alone fits beside it at 0px wide */
        padding-left: 0;
    }
    
    .single-product .thumbs-scroll {
        margin-top: 20px;
        padding: 0 50px;
        position: relative;
        width: 100%;
        justify-content: center;
        height: inherit;
        top: 0;
        transform: none;
        height: initial;
        bottom: 0;
        position-area: center;
        left: 50%;
        -webkit-transform: translateX(-50%);
        transform: translateX(-50%);
    }

    .single-product .thumbs-scroll__button {
        left: 10px;
        top: 50%;
        transform: translate(0px, -50%) rotate(-90deg);
    }

    .single-product button.thumbs-scroll__button.thumbs-scroll__button--next{
        left: auto;
        right: 10px;
        top: 50% !important;
        bottom: auto !important;
    }

    .single-product .thumbs-scroll__container{
        height: auto;
        display: flex;
        flex-direction: column;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        margin-top: 0 !important;
    }

    .woocommerce-product-gallery .thumbs-scroll .thumbs-scroll__container .flex-control-thumbs{
        width: 100%;
        display: flex !important;
        background: none;
        gap: 10px;
        flex-direction: row;
        height: auto !important;
        overflow: initial !important;
        padding-top: 0 !important;
    }

}

/* ============================================================
   Mobile: pin the price + size + quantity + add-to-cart to the
   bottom of the screen (matches the app-style buy bar design).
   The price + form are wrapped in .product__buy-bar (see
   class-woocommerce-template-functions.php). Only on mobile.
   Breakpoint matches the single-column product layout (1000px, see above) so
   the bar is pinned whenever the product is stacked — otherwise there's a
   768–1000px gap where the layout is mobile but the bar sits in normal flow.
   ============================================================ */
@media screen and (max-width: 1000px) {    

    /* Leave room so page content isn't hidden behind the fixed bar. */
    body.single-product {
        padding-bottom: 130px;
    }

    /* .summary is a flex child of .product with z-index:0, which makes it a
       stacking context. That would trap the fixed buy-bar inside .summary, so
       the later .product-gutenberg-blocks sibling paints over it as you scroll.
       Reset to auto on mobile so the fixed bar lives in the root stacking
       context and stays above all page content. */
    .single-product .product .summary {
        z-index: auto;
    }

    .single-product .product__buy-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 200;
        margin: 0;
        padding: 10px 14px calc(8px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid #d9dde3;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
        box-sizing: border-box;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "price size"
            "qty   cart";
        column-gap: 6px;
        row-gap: 5px;
        align-items: center;
        padding-left: 80px;
    }

    /* Flatten the nested add-to-cart form so its controls join the bar grid */
    .single-product .product__buy-bar form.cart,
    .single-product .product__buy-bar .single_variation_wrap,
    .single-product .product__buy-bar .woocommerce-variation,
    .single-product .product__buy-bar .woocommerce-variation-add-to-cart {
        display: contents;
    }

    /* ---- Price (top-left) ---- */
    .single-product .product__buy-bar > p.price,
    .single-product .product__buy-bar .woocommerce-variation-price {
        grid-area: price;
        display: block !important;
        margin: 0;
        align-self: center;
    }
    .single-product.woocommerce .product__buy-bar p.price,
    .single-product .product__buy-bar .woocommerce-variation-price .price {
        font-size: 1.5rem;
        line-height: 1;
        white-space: nowrap;
        margin: 0 !important;
        padding: 0;
    }

    /* ---- Size selector (top-right): small label above compact buttons ---- */
    .single-product .product__buy-bar .variations {
        grid-area: size;
        margin: 0 !important;
    }
    .single-product .product__buy-bar .variations tbody,
    .single-product .product__buy-bar .variations tr,
    .single-product .product__buy-bar .variations th,
    .single-product .product__buy-bar .variations td {
        display: block;
        padding: 0;
        width: 100%;
    }
    .single-product .product__buy-bar .variations th.label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .single-product .product .product__buy-bar .variations .variation-radios {
        display: flex;
        gap: 4px;
    }
    .single-product .product .product__buy-bar .variations .variation-radios label {
        width: auto;
        flex: 1;
        min-width: 0;
        height: 32px;
        font-size: 12px;
        padding: 0 2px;
    }

    /* ---- Quantity (bottom-left) ---- */
    .single-product .product__buy-bar .quantity,
    .single-product div.product .product__buy-bar form.cart .quantity {
        grid-area: qty;
        margin: 0;
        flex-basis: auto;
        width: auto;
    }
    .single-product .product__buy-bar .qty-wrap {
        height: 34px;
        width: 80px;
    }
    .single-product .product__buy-bar .qty-btn {
        padding: 0 10px;
        font-size: 14px;
    }
    .single-product .product__buy-bar .quantity .qty.text {
        font-size: 13px;
        padding: 0 4px;
        width: 20px;
    }

    /* ---- Add to cart (bottom-right, fills) ---- */
    .single-product.woocommerce .product__buy-bar .single_add_to_cart_button {
        grid-area: cart;
        width: 100%;
        height: 34px;
        padding: 0 16px;
        gap: 8px;
    }
    .single-product.woocommerce .product__buy-bar .single_add_to_cart_button::before {
        width: 18px;
        height: 17px;
    }
    .single-product.woocommerce .product__buy-bar .single_add_to_cart_button::after {
        right: 14px;
        border-top-width: 6px;
        border-bottom-width: 6px;
        border-left-width: 9px;
        position: relative;
        top: 5px;
        right: -3px;
    }

    .single-product .woocommerce-product-gallery__image{
        height: auto;
    }    

    /* Hide the bits we don't want inside the compact bar */
    .single-product .product__buy-bar .woocommerce-variation-description,
    .single-product .product__buy-bar .woocommerce-variation-availability,
    .single-product .product__buy-bar .reset_variations_alert,
    .single-product .product__buy-bar .quantity > label.screen-reader-text {
        display: none !important;
    }

    .single-product .woocommerce-product-gallery li {
        flex-basis: 100px !important;
        width: 100px !important;
        min-width: 100px !important;
    }

    .single-product.woocommerce #page div.product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper img {
        object-fit: contain !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        padding: 0;
        max-height: 300px;
    }    

}

@media screen and (max-width: 768px) {
    .single-product .breadcrumbs {
        margin-top: 100px !important;
        margin-bottom: 30px !important;
    }

    .single-product .breadcrumbs #breadcrumbs {
        text-align: right;
    }

    .single-product .product .product__buy-bar .variations .variation-radios label {
        flex-basis: calc(20% - 12px);
        font-size: 9px;
        margin-right: 0.1rem;
        margin-bottom: 0.1rem;
    }    

    .single-product .product-loop-badges {
        margin-top:20px;
    }
}

@media screen and (max-width: 550px) {
    .single-product .woocommerce-product-gallery li {
        flex-basis: 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        height: 40px;
    }

    .single-product.woocommerce .product__buy-bar .single_add_to_cart_button::after {
        border-top-width: 4px;
        border-bottom-width: 4px;
        border-left-width: 7px;
    }
    
    .single-product.woocommerce .product__buy-bar .single_add_to_cart_button::before {
        width: 12px;
        height: 12px;
    }    

    .single-product.woocommerce .product__buy-bar .single_add_to_cart_button {
        font-size: 0.8rem;
    }    

    .single-product.woocommerce .product__buy-bar p.price, .single-product .product__buy-bar .woocommerce-variation-price .price {
        font-size: 1.2rem;
    }

    .single-product .product__buy-bar .qty-wrap,
    .single-product.woocommerce .product__buy-bar .single_add_to_cart_button  {
        height: 30px;
    }
}