
/**
* -------------------------------------------
* SINGLE PRODUCT PAGE (PDP)
* -------------------------------------------
*/

/* Single Product Page - Full width container padding adjustment
---------------------------------------*/
body.single-product .ct-container-full {
    padding-top:48px;
}

/* Hero Section - Full width dashed line
---------------------------------------*/
body.single-product .hero-section {
    margin-bottom:64px;
}
body.single-product .hero-section::after {
    content:"";
    display:block;
    width:100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    border-bottom:dashed 1px var(--theme-palette-color-10, #e7e7e7);
    margin-top:20px;
}

/* Product Gallery - Lightbox image background 
---------------------------------------*/
img.pswp__img {
    background:white;
}


/* Product Entry Wrapper Styles (gallery and summary wrapper)
---------------------------------------*/
.product-entry-wrapper {
    padding-bottom:64px;
}
    @media (max-width: 481px) {
        .product-entry-wrapper {
            padding-bottom:32px;
        }
    }

/* @ big screens */
@media (min-width: 1025px) {
	.product-entry-wrapper.is-width-constrained {
		max-width:1440px;
		margin-bottom:90px;
		/*gap:90px;*/
		gap:clamp(64px, 5vw, 112px);
	}
	.woocommerce-product-gallery {
		width:52%!important;
	}
	body .entry-summary-items {
		width:48%!important;
		margin-inline-start:0!important;
	}
}
.woocommerce-product-gallery .flexy-view,
.woocommerce-product-gallery .flexy-pills .ct-media-container {
	border:solid 1px #D9D9D9;
}
body div.woocommerce-product-gallery li.active .ct-media-container:after {
	border:solid 1px #5C5C5C;
}

/* DELIMITERS - Product summary - spacing adjustments
---------------------------------------*/
.summary p.price::after,
/*.summary .ct-product-add-to-cart::before,*/
.summary .woocommerce-variation-add-to-cart::before,
.summary .sf-accessory-summary::after {
    content: '';
    height: 1px;
    background: #ccc;
    width: 100%;
    display: block;
    margin-top: 30px;
}
/*.summary .ct-product-add-to-cart::before,*/
.summary .woocommerce-variation-add-to-cart::before,
.summary .ct-cart-actions::before {
    margin-bottom: 30px;
}

.entry-summary-items > .price {
    --product-element-spacing: 22px;
}


/* PRICE FORMATTING STYLES
---------------------------------------*/

/* reset stuff */
form.variations_form .single_variation :is(p,.price) {
    margin: 0!important;
    padding: 0!important;
    line-height:100%!important;
}

/* price spacing */
.summary p.price,
.woocommerce-variation-price {
    margin-bottom: var(--product-element-spacing, 32px)!important;
}

/* price tax suffix */
.sf-price-suffix {
    display:block;
    font-size: 14px;
    color: #777;
    margin-top: 4px;
}


/* QTY + ADD TO CARD + BUY NOW - BUTTONS LAYOUT
---------------------------------------*/


body .ct-cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;   /* buttons will always be equal */
    gap: 16px;
    align-items: stretch;
    margin-top:0px;
}
@media screen and (max-width: 481px) {
    body .ct-cart-actions {
        grid-template-columns: 1fr;   /* on mobile, stack vertically */
        row-gap: 12px;
    }
}

/* hide the default "View Cart" link that appears after adding to cart */
body .ct-cart-actions .added_to_cart.wc-forward {
    display:none!important;
}

/* quantity in its own row, does not affect button width */
body .ct-cart-actions .quantity{
    grid-column: 1 / -1;             /* occupies the full width of the wrapper */
    justify-self: start;             /* stays left */
    width: auto !important;          /* natural width */
    max-width:25%!important;
    flex: unset !important;

    @media screen and (max-width: 481px) {
        max-width: 100% !important;   /* on mobile, quantity can take full width */
    }
}
/* quantity input styles */
body .ct-cart-actions .quantity input[type=number] {
    border-width: 1px 0px;
    border-color:#E7E7E7;
    padding-block: 0px;
    padding-inline: calc(var(--quantity-height, 55px) / 1.8 + 9%);
    font-size:22px!important;
    font-family: var(--theme-font-family)!important;

    @media screen and (max-width: 481px) {
        border-width: 0px;
    }

}
body .ct-cart-actions .quantity .ct-increase,
body .ct-cart-actions .quantity .ct-decrease {
    border: solid 1px #E7E7E7;
    border-radius:999px;
    background:none;
    top: calc(50% - var(--quantity-height, 55px) / 2.85);
    width: calc(var(--quantity-height, 55px) / 1.4);
    height: calc(var(--quantity-height, 55px) / 1.4);
}
body .ct-cart-actions .quantity .ct-increase { inset-inline-end: 0%; }
body .ct-cart-actions .quantity .ct-decrease { inset-inline-start: 0%; }

body .ct-cart-actions .quantity .ct-increase::before,
body .ct-cart-actions .quantity .ct-decrease::before {
    font-size: calc(var(--quantity-height, 55px) / 4.5);

    @media screen and (max-width: 481px) {
        font-size: calc(var(--quantity-height, 55px) / 3.8);
    }
}

body .ct-cart-actions .quantity .ct-increase:hover,
body .ct-cart-actions .quantity .ct-decrease:hover {
    color: var(--quantity-arrows-hover-color, #fff);
    background: var(--quantity-hover-color, var(--theme-button-background-hover-color));
    border-color:var(--theme-button-background-hover-color);
}

/* buttons 50/50 */
body .ct-cart-actions .single_add_to_cart_button,
body .ct-cart-actions .buy-now-button{
    width: 100%;
}

/* each in its own column */
body .ct-cart-actions .single_add_to_cart_button {
    grid-column: 1;
    background-color: #EED4B2;
    color: var(--theme-palette-color-4);
}
body .ct-cart-actions .single_add_to_cart_button:hover {
    color: var(--theme-palette-color-4);
    background-color: #E1C6A3;
}

body .ct-cart-actions .buy-now-button {
    grid-column: 2;
}
body .ct-cart-actions .buy-now-button,
body .ct-cart-actions .buy-now-button:hover {
    background:none;
    border:inherit;
    color: var(--theme-palette-color-1);
    border: solid 1px var(--theme-palette-color-1);
}
body .ct-cart-actions .buy-now-button:hover {
    background-color:#E9DBC933;
}

/* Add to Cart button icon before text */
body .ct-cart-actions .single_add_to_cart_button::before,
body .ct-cart-actions .buy-now-button::before {
    position:relative;
    z-index:1;
    display:inline-block;
    content:"";
    background-image: url(../assets/icons/icon-cart.svg);
    background-size: contain;
    background-repeat: no-repeat;
    width:16px;
    height:16px;
    margin-right:8px;

    inset-inline: 0px;
    inset-block:0;
    opacity: 1;
    border-radius: inherit;
    transition: opacity .2s ease;
    filter: blur(0);
}
body .ct-cart-actions .buy-now-button::before {
    background-image: url(../assets/icons/icon-clock.svg);
}

    /* MOBILE ADJUSTMENTS
    ---------------------------------------*/
    @media (max-width: 481px) {

        body .ct-cart-actions{
            grid-template-columns: max-content 1fr;
        }

        /* quantity left, natural width */
        body .ct-cart-actions .quantity{
            grid-column: 1;
            justify-self: start;
            width: auto !important;
        }
        /* limit the width of number input */
        body .ct-cart-actions .quantity input[type=number]{
            max-width: 100px !important;
        }

        /* add to cart right, fills the row */
        body .ct-cart-actions .single_add_to_cart_button{
            grid-column: 2;
        }

        /* buy now below, 100% */
        body .ct-cart-actions .buy-now-button{
            grid-column: 1 / -1;
        }
    }


/* Product Gallery Thumbnails - Centered
 * applies to screens 835px and wider
---------------------------------------*/
@media (min-width: 835px) {

    /* Thumbnails track - margins needed to accommodate arrows */
    body .flexy-pills {
        margin:0 90px;
    }

    /* Center the Thumbnails track */
    body .flexy-pills ol,
    body .flex-control-nav:has(img) {
        justify-content: center;
    }

    /* Thumbnail items - set width and cursor */
    body .flexy-pills ol li, 
    body .flex-control-nav:has(img) li {
        flex: 0 0 var(--thumbs-width, 25%);
        width: var(--thumbs-width, 25%);
        cursor: pointer;
    }

    /* Thumbail styles - border, radius, etc. */
    body .woocommerce-product-gallery .flexy-pills .ct-media-container {
        border-radius:4px!important;
        overflow:hidden!important;
        border:solid 1px #DDD;
        padding:12px;
        background:white;
        box-sizing:border-box;
    }
    /* Removed default border on active thumbnail */
    div.woocommerce-product-gallery .flexy-pills li.active .ct-media-container:after {
        display:none;
        border-color:transparent!important;
    }
    /* Active thumbnail border */
    div.woocommerce-product-gallery .flexy-pills li.active .ct-media-container {
        border-color:#BF9C6D!important;
    }

    /* Always show arrows */
    body .flexy-arrow-prev.ct-hidden-sm,
    body .flexy-arrow-next.ct-hidden-sm {
        opacity:1!important;
    }
    /* Position arrows outside the thumbs area */
    body .flexy-arrow-prev { --translate-x: -90px!important; }
    body .flexy-arrow-next { --translate-x: 90px!important; }
}


/* Single product - Delivery time & Showroom info wrapper
-------------------------------------------*/
.product-delivery-showroom-info {
    display:flex;
    flex-direction: column;
    gap:17px;
    padding-bottom:30px;
    padding-top:10px;
    margin-bottom:32px!important;
    border-bottom:solid 1px #ccc;
}

/* Single product - Delivery time
-------------------------------------------*/
.delivery-info-wrap {
	display:flex;
	flex-direction: row;
	gap:15px;
	align-items:center;
	justify-content: space-between;
    margin-top:0px!important;
}
.entry-summary-items .delivery-time {
	display:flex;
	flex-direction:row;
	gap:12px;
	align-items:center;
	align-content:center;
	justify-content:flex-start;
}
.entry-summary-items .delivery-time--icon {
	display:flex;
	flex-direction:row;
	align-items:center;
	align-content:center;
	justify-content:flex-start;
}
.delivery-info-wrap button[data-open-panel="shipping"] {
	white-space:nowrap;
    background:none!important;
    border:none!important;
    cursor:pointer;
    padding:0!important;
    font-weight:600;
}
@media (max-width: 481px) {
    .delivery-info-wrap {
        flex-direction: column;
        gap: 5px;
        align-items: start;
    }
    .delivery-info-wrap .delivery-time--label,
    .delivery-info-wrap button[data-open-panel="shipping"] {
       font-size:14px!important;
    }
    .delivery-info-wrap button[data-open-panel="shipping"] {
        margin-left:28px;
    }
}


/* Product in Showroom notice label
------------------------------------------*/
.sf-showroom-note {
	display:flex;
	flex-direction:row;
	gap:12px;
	align-items:center;
	align-content:center;
	justify-content:flex-start;
}
.sf-showroom-icon {
	display:flex;
	flex-direction:row;
	align-items:center;
	align-content:center;
	justify-content:flex-start;
}
.sf-showroom-note a {
	text-decoration:underline;
	text-decoration-thickness:1px;
	text-underline-offset: 3px;
	text-decoration-color:#999;
}



/* Product Attributes Table
---------------------------------------*/

/* Reset default table styles */
body.single-product table.shop_attributes {
    border:none;
    margin:0;
    width:100%;
}
body.single-product table.shop_attributes tr,
body.single-product table.shop_attributes th,
body.single-product table.shop_attributes td {
    border:none;
    padding:0;
}
body.single-product table.shop_attributes tr:nth-child(even) th,
body.single-product table.shop_attributes tr:nth-child(even) td {
    background:transparent;
}

/* Custom attributes table styles */
body.single-product table.shop_attributes tr {
    border-bottom:solid 1px var(--theme-palette-color-10, #e7e7e7);
}
body.single-product table.shop_attributes th,
body.single-product table.shop_attributes td {
     padding:25px 0!important;
}
body.single-product table.shop_attributes th {
    font-weight:600;
    text-transform: uppercase;
    padding-right:16px!important;
}

/* Custom attributes table font sizes - Mobile */
@media (max-width:481px) {
    body.single-product table.shop_attributes th,
    body.single-product table.shop_attributes td {
        font-size: 14px;
    }
}

/* Variations table styling
-----------------*/
.ct-product-add-to-cart form.variations_form {
    padding-left: 4px;
    margin-left:-4px;
    position:relative;
}
body.single-product table.variations {
    margin-bottom:0!important;
    position:relative;
}
body.single-product form.variations_form table.variations tr {
    margin-bottom:2em;
}
body.single-product form.variations_form table.variations tr:last-child {
    margin-bottom:0;
}
body.single-product .woocommerce-variation-price {
    margin-top:2em;
}
body.single-product table.variations label {
    font-weight:400;
    font-size:1.1em;
    line-height:1.3em;
}

/* Special case for PA Stoffqualität - add top border and spacing before the first variation row
---------------------------------------*/
body.single-product form.variations_form table.variations tr:has(label[for="pa_stoffqualitaet"]) label[for="pa_stoffqualitaet"] {
    border-bottom: 1px solid #878686;
    padding-bottom:12px;
    margin-bottom:12px;
}

/* Related products section title
---------------------------------------*/
body.single-product .sf-related-section-title {
    font-family: Cormorant Garamond;
    font-size: 20px;
    line-height: 120%;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #201c1c;
}
@media (min-width: 481px) {
    body.single-product section.related.products.is-layout-slider .flexy-container {
        padding-inline:64px;
    }
    body.single-product section.related.products.is-layout-slider .flexy-arrow-prev,
    body.single-product section.related.products.is-layout-slider .flexy-arrow-next {
        opacity:1!important;
        border:solid 1px #E7E7E7;
        visibility: visible;
        width:54px;
        height:54px;
    }
}
@media (min-width:481px) and (max-width: 835px) {
    body.single-product section.related.products.is-layout-slider .flexy-arrow-prev {
        left: -70px!important;
        --translate-x: 0!important;
    }
    body.single-product section.related.products.is-layout-slider .flexy-arrow-next {
        right: -70px!important;
        --translate-x: 0!important;
    }
}