/* Force disabled state for add to cart button when color not selected */
button.single_add_to_cart_button.disabled,
button.single_add_to_cart_button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #ccc !important;
}

/* Ensure button stays disabled even when WooCommerce tries to enable it */
.variations_form button.single_add_to_cart_button[disabled],
.variations_form button.single_add_to_cart_button.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Carpet: image tiles inside the picker grid */
.pcfw_color_container .pcfw_farve_bg.pcfw_farve_bg--image {
    background: #f2f2f2;
    overflow: hidden;
}

.pcfw_color_container .pcfw_farve_bg.pcfw_farve_bg--image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* When we set an image preview for selected carpet, keep it tidy */
#kforw-product-page-swatch {
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

/* Carpet mode: hide room mockup slideshow images and show a clean preview area */
#popup-product-content.pcfw-display-carpet .slideshow-container {
    background: #efefef;
    min-height: 600px;
}

#popup-product-content.pcfw-display-carpet .slideshow-container .mySlides {
    min-height: 600px;
}

#popup-product-content.pcfw-display-carpet .slideshow-container .mySlides img {
    display: none !important;
}

#popup-product-content.pcfw-display-carpet .slideshow-container .pcfw_prev,
#popup-product-content.pcfw-display-carpet .slideshow-container .pcfw_next {
    display: none !important;
}

body.pcfw-display-carpet .slideshow-container .mySlides img {
    display: none !important;
}

body.pcfw-display-carpet .slideshow-container .pcfw_prev,
body.pcfw-display-carpet .slideshow-container .pcfw_next {
    display: none !important;
}

/* Absolute mask so slideshow images can never be seen in carpet mode */
body.pcfw-display-carpet .slideshow-container {
    position: relative !important;
    background: #efefef !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Server-rendered fallback class (works even if JS bundle is cached/old) */
.slideshow-container.pcfw-carpet-preview {
    position: relative !important;
    background: #efefef !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
}

.slideshow-container.pcfw-carpet-preview .mySlides img,
.slideshow-container.pcfw-carpet-preview .pcfw_prev,
.slideshow-container.pcfw-carpet-preview .pcfw_next {
    display: none !important;
}

/* Dedicated preview layer for carpet selection */
.slideshow-container .pcfw_carpet_preview_layer {
    display: none;
}

body.pcfw-display-carpet .slideshow-container .pcfw_carpet_preview_layer,
.slideshow-container.pcfw-carpet-preview .pcfw_carpet_preview_layer {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 6;
    background-color: #efefef;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

body.pcfw-display-carpet .slideshow-container,
.slideshow-container.pcfw-carpet-preview {
    min-height: 600px;
}

body.pcfw-display-carpet .slideshow-container .mySlides,
.slideshow-container.pcfw-carpet-preview .mySlides {
    min-height: 600px;
}

/* Carpet mode: square image tiles instead of circles (Furlong-style grid) */
body.pcfw-display-carpet .pcfw_color_container {
    display: flex !important;
    flex-wrap: wrap !important;
    float: none !important;
}

body.pcfw-display-carpet .pcfw_swatches_col_wrap .pcfw_farve {
    float: none !important;
    width: calc(25% - 12px) !important;
    margin: 6px !important;
}

body.pcfw-display-carpet .pcfw_swatches_col_wrap .pcfw_farve .pcfw_farve_bg {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
    border-radius: 8px !important;
    border: 2px solid #e0e0e0 !important;
}

body.pcfw-display-carpet .pcfw_swatches_col_wrap .pcfw_farve .pcfw_farve_bg.pcfw_farve_bg--image img {
    border-radius: 6px;
}

body.pcfw-display-carpet .pcfw_swatches_col_wrap .pcfw_farve:hover .pcfw_farve_bg {
    border-color: #999 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

body.pcfw-display-carpet .pcfw_swatches_col_wrap .pcfw_farve.active .pcfw_farve_bg {
    border-color: #333 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25) !important;
}

body.pcfw-display-carpet .pcfw_swatches_col_wrap .pcfw_farve .pcfw_farve_navn {
    font-size: 12px !important;
    font-weight: 600;
}

body.pcfw-display-carpet .pcfw_swatches_col_wrap .pcfw_farve .pcfw_farve_kort {
    font-size: 10px !important;
}

/* Carpet mode responsive: 3 cols on smaller popups */
@media (max-width: 1100px) {
    body.pcfw-display-carpet .pcfw_swatches_col_wrap .pcfw_farve {
        width: calc(33.333% - 12px) !important;
    }
}

@media (max-width: 768px) {
    body.pcfw-display-carpet .pcfw_swatches_col_wrap .pcfw_farve {
        width: calc(50% - 12px) !important;
    }
}

/* Compact the product-page swatch preview (the "Change Color" box) */
#display_selected_color {
    margin: 8px 0 12px;
}

#kforw-product-page-swatch {
    max-width: 220px;
    padding-top: 100px !important;
    border-radius: 8px;
    position: relative;
}

#kforw-product-page-swatch .button {
    font-size: 11px;
    padding: 4px 10px;
    line-height: 1.4;
}

/* Selected colour name label on product page */
#tns-selected-colour-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 6px 0 12px;
}

/* Product features cloned into the picker popup */
.tns-popup-features {
    padding: 16px 20px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

.tns-popup-features .tns-badges-title {
    font-size: 14px;
    margin-bottom: 10px;
}

.tns-popup-features .tns-badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    justify-content: center;
}

.tns-popup-features .tns-badge-item {
    width: 80px;
    flex: 0 0 auto;
    text-align: center;
}

.tns-popup-features .tns-badge-item img {
    width: 56px;
    height: 56px;
}

.tns-popup-features .tns-badge-item span {
    font-size: 11px;
    display: block;
    word-wrap: break-word;
    line-height: 1.2;
}
