/* =============================================================
   Kuratedwall — Product Variation Styling
   Two attributes: Frame (image swatches) + Size (buttons)
   Flatsome theme + Variation Swatches for WooCommerce
   ============================================================= */

/* ------------------------------------------------------------------
   1. VARIATIONS TABLE — layout and label typography
   ------------------------------------------------------------------ */

.variations_form .variations {
    border: none !important;
    margin-bottom: 0 !important;
}

.variations_form .variations tr {
    display: block;
    margin-bottom: 20px;
}

.variations_form .variations .label {
    display: block;
    width: 100% !important;
    padding: 0 0 8px 0 !important;
}

.variations_form .variations .label label {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #1E2D4A !important;
}

.variations_form .variations .label label .selected-value {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #666;
}

.variations_form .variations .value {
    display: block;
    width: 100% !important;
    padding: 0 !important;
}

/* ------------------------------------------------------------------
   2. FRAME — image swatches (No Frame, Black, Natural, White)
   ------------------------------------------------------------------ */

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: center;
}

/* Each swatch: the frame picture in a bordered square, its name underneath
   (the name is added by product-page.js). WooCommerce's tooltip is not
   needed with the name showing. */
.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: auto !important;
    height: auto !important;
    min-width: 56px;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    cursor: pointer;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item .variable-item-contents {
    width: 56px;
    height: 56px;
    border: 2px solid #e8e5e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item:hover .variable-item-contents {
    border-color: #1E2D4A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item.selected .variable-item-contents {
    border-color: #1E2D4A;
    box-shadow: 0 0 0 3px rgba(30,45,74,0.18);
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .kw-swatch-name {
    font-size: 0.75rem;
    line-height: 1.2;
    color: #1E2D4A;
    white-space: nowrap;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item.selected .kw-swatch-name {
    font-weight: 600;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item.out-of-stock {
    opacity: 0.3;
    pointer-events: none;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item[data-wvstooltip]::before,
.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item[data-wvstooltip]::after {
    display: none !important;
}

/* ------------------------------------------------------------------
   3. SIZE — button swatches
   ------------------------------------------------------------------ */

/* Three to a row, each with its name and, under it, its price (added by product-page.js). */
.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .variable-item {
    min-width: 0;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 8px 6px !important;
    border: 1.5px solid #d8d4cd !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #1E2D4A !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em;
    text-align: center;
    cursor: pointer;
    transition: all 0.16s ease;
    line-height: 1.3 !important;
    white-space: nowrap;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .variable-item:hover {
    border-color: #1E2D4A !important;
    background: #f7f5f2 !important;
    color: #1E2D4A !important;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .variable-item.selected {
    border-color: #1E2D4A !important;
    background: #1E2D4A !important;
    color: #fff !important;
    font-weight: 600 !important;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .variable-item.out-of-stock {
    opacity: 0.35;
    pointer-events: none;
    text-decoration: line-through;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .variable-item-contents {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* The button already shows the size's name, so no tooltip. */
.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .variable-item[data-wvstooltip]::before,
.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .variable-item[data-wvstooltip]::after {
    display: none !important;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .kw-size-price {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.8;
}

/* A size or frame that doesn't come with the other choice. It stays on show
   without the swatch plugin's cross, and tapping it changes the other choice
   to suit (product-page.js). */
.variations_form .variable-items-wrapper .variable-item.kw-swap {
    pointer-events: auto !important;
    cursor: pointer;
}

.variations_form .variable-items-wrapper .variable-item.kw-swap .variable-item-contents::before {
    display: none !important;
}

.variations_form .variable-items-wrapper .variable-item.kw-swap img,
.variations_form .variable-items-wrapper .variable-item.kw-swap span {
    opacity: 1 !important;
    filter: none !important;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .variable-item.kw-swap {
    border-style: dashed !important;
    color: #6b6f78 !important;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .variable-item.kw-swap .kw-size-price {
    font-style: italic;
}

.variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item.kw-swap .variable-item-contents {
    opacity: 0.55;
}

.variations_form .kw-size-note {
    margin: 10px 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #4a5263;
}

/* ------------------------------------------------------------------
   4. VARIATION PRICE + ADD TO CART
   ------------------------------------------------------------------ */

.variations_form .woocommerce-variation.single_variation {
    margin-bottom: 16px;
}

.variations_form .woocommerce-variation-price .price {
    font-size: 1.3rem !important;
    font-weight: 600 !important;
    color: #1E2D4A !important;
    letter-spacing: -0.01em;
}

.variations_form .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.variations_form .quantity .qty {
    width: 52px !important;
    height: 48px !important;
    text-align: center;
    border: 1.5px solid #d8d4cd !important;
    border-radius: 6px !important;
    font-size: 1rem !important;
    font-weight: 600;
}

/* ------------------------------------------------------------------
   5. CLEAR LINK
   ------------------------------------------------------------------ */

.variations_form a.reset_variations {
    font-size: 0.72rem !important;
    color: #888 !important;
    text-decoration: none !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 4px;
}

.variations_form a.reset_variations:hover {
    color: #1E2D4A !important;
}

/* ------------------------------------------------------------------
   6. PRODUCT GALLERY IMAGE — consistent display
   ------------------------------------------------------------------ */

.woocommerce-product-gallery__image img {
    background: #F2E8D5;
    padding: 16px;
    box-sizing: border-box;
}

/* Room photos are photographs: edge to edge, no cream border. */
.woocommerce-product-gallery__image img.kw-room-photo {
    background: none;
    padding: 0;
}

/* ------------------------------------------------------------------
   7. MOBILE
   ------------------------------------------------------------------ */

@media (max-width: 640px) {
    .variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_frame-colour"] .variable-item .variable-item-contents {
        width: 48px;
        height: 48px;
    }

    .variations_form .variable-items-wrapper[data-attribute_name="attribute_pa_size"] .variable-item {
        min-width: 80px;
        font-size: 0.75rem !important;
        padding: 8px 10px !important;
    }
}

/* ------------------------------------------------------------------
   [kw_product_promises] and [kw_product_details]: the product page
   facts used in the custom product layout (UX Builder)
   ------------------------------------------------------------------ */

.kw-promises {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    list-style: none;
    margin: 4px 0 6px;
    padding: 14px 0;
    border-top: 1px solid rgba(30, 45, 74, 0.12);
    border-bottom: 1px solid rgba(30, 45, 74, 0.12);
}
.kw-promises li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.3;
    letter-spacing: 0.04em;
    color: #1E2D4A;
}
.kw-promises__icon { color: #B5562A; }
.kw-details-list { margin: 0.4em 0 0.8em 1.1em; }
.kw-details-list li { margin-bottom: 0.35em; }
.kw-details-links a { color: #B5562A; text-decoration: underline; text-underline-offset: 2px; }

/* Under Add to basket: arrival dates, Christmas, ways to pay, the studio line */
.kw-buy-note { margin: 14px 0 6px; font-size: 0.9rem; line-height: 1.45; color: #1E2D4A; }
.kw-buy-note p { margin: 0 0 8px; }
.kw-buy-note__when { display: flex; gap: 8px; align-items: flex-start; }
.kw-buy-note__icon { flex: 0 0 auto; color: #B5562A; margin-top: 1px; }
.kw-buy-note__xmas { padding: 8px 12px; background: #F5F0E8; border-left: 3px solid #B5562A; }
.kw-buy-note__pay { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 8px; color: #4a566d; font-size: 0.82rem; }
.kw-buy-note__pay .payment-icons { margin: 0; }
.kw-buy-note__pay .payment-icon { margin: 0 4px 0 0; opacity: 1; }
.kw-buy-note__studio { color: #4a566d; font-size: 0.85rem; }

/* The slim Add to basket bar on phones (buy-bar.js): at the foot of the
   screen while the real button is out of view. */
.kw-buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 990; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid rgba(30, 45, 74, 0.15); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08); }
.kw-buybar[hidden] { display: none; }
.kw-buybar__words { min-width: 0; margin: 0; display: flex; flex-direction: column; font-size: 0.85rem; line-height: 1.3; color: #1E2D4A; }
.kw-buybar__price { font-weight: 700; font-size: 0.95rem; }
.kw-buybar__pick { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #4a566d; }
.kw-buybar__go { flex: 0 0 auto; margin: 0; min-height: 44px; padding: 0 18px; border: 0; border-radius: 3px; background: #1E2D4A; color: #fff; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.kw-buybar__go:hover, .kw-buybar__go:focus { background: #2B3D61; color: #fff; }
/* Room at the foot of the page so the bar never covers the footer's last line. */
body.kw-buybar-on { padding-bottom: 64px; }
@media (min-width: 850px) { .kw-buybar { display: none; } }

/* "Shown in a white frame" on the room photo while the page's own choice is another frame (product-page.js); bottom right, clear of the zoom button. */
.woocommerce-product-gallery__image { position: relative; }
.kw-frame-note { position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 5px 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.92); color: #1E2D4A; font-size: 0.78rem; font-weight: 600; line-height: 1.3; letter-spacing: 0.02em; pointer-events: none; }
