/*
Theme Name: JackaroKW WoodMart Child
Description: JackaroKW design customizations, developed on protected staging.
Template: woodmart
Version: 1.0.1
Text Domain: kw-woodmart-child
*/

/* Readable information pages without a page builder or additional scripts. */
.kw-information-page {
    color: #333;
    font-size: 16px;
}
.kw-information-page h2 {
    font-size: clamp(21px, 2.4vw, 27px);
    line-height: 1.5;
    margin-block: 28px 14px;
}
.kw-information-page a {
    color: #006cae;
    text-decoration: underline;
    text-underline-offset: .15em;
}
/* All existing footer widgets occupy one area; avoid empty theme columns. */
@media (min-width: 769px) {
    .wd-footer .footer-column-1 {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 30px;
        align-items: start;
    }
}

/* Keep payment artwork readable and compact without altering the marks. */
.kw-payment-widget, .kw-wallet-marks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}
.kw-payment-widget > :not(.kw-wallet-marks) {
    flex: 0 0 auto;
    width: auto !important;
    margin: 0;
}
.kw-payment-widget img {
    display: block;
    height: 64px !important;
    width: auto !important;
    max-width: 100%;
    object-fit: contain;
}
.kw-wallet-marks img { height: 32px !important; }
/* Google artwork includes substantial clear space around the acceptance mark. */
.kw-wallet-marks img[alt="Google Pay"] { height: 59px !important; }
.kw-payment-widget { align-self: start; }

/* Keep the popup's selected name above the swatches, including on mobile. */
body :is(.quick-shop-wrapper, .product-quick-view) table.variations,
body :is(.quick-shop-wrapper, .product-quick-view) table.variations tbody,
body :is(.quick-shop-wrapper, .product-quick-view) table.variations tr {
    display: block;
    width: 100%;
}
body :is(.quick-shop-wrapper, .product-quick-view) table.variations .cell {
    display: block;
    width: 100%;
    position: static;
    padding-inline: 0;
}
body :is(.quick-shop-wrapper, .product-quick-view) table.variations .label {
    margin-bottom: 8px;
    padding-bottom: 0;
}
body :is(.quick-shop-wrapper, .product-quick-view) table.variations .wd-attr-selected {
    display: block;
    position: static;
    margin: 4px 0 0;
    max-width: 100%;
    font-size: 14px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
}
body :is(.quick-shop-wrapper, .product-quick-view) table.variations .wd-attr-selected:empty {
    display: none;
}

/* Keep product image swatches and text-only fallback options in separate boxes. */
body :is(.wd-swatches-product, .wd-swatches-grid, .wd-swatches-single) {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
    padding-block: 5px;
}
body :is(.wd-swatches-product, .wd-swatches-grid, .wd-swatches-single) .wd-swatch {
    flex: 0 0 auto;
    min-width: 32px;
    min-height: 32px;
}
body :is(.wd-swatches-product, .wd-swatches-grid, .wd-swatches-single) .wd-swatch:not(.wd-bg):not(:has(> .wd-swatch-bg)) {
    width: auto;
    height: auto;
    padding: 6px 10px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
}
body :is(.wd-swatches-product, .wd-swatches-grid, .wd-swatches-single) .wd-swatch:has(> .wd-swatch-bg) > .wd-swatch-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
body :is(.wd-swatches-product, .wd-swatches-grid, .wd-swatches-single) .wd-swatch:not(.wd-bg):not(:has(> .wd-swatch-bg)) > .wd-swatch-text {
    font-size: 14px;
    line-height: 1.4;
}
body :is(.wd-swatches-product, .wd-swatches-grid, .wd-swatches-single) .wd-swatch.wd-active:not(.wd-bg):not(:has(> .wd-swatch-bg)) {
    border-color: #007abb;
    background: #eef6fc;
}

/* Phone presentation only: preserve names, values, validation and submission. */
body.woocommerce-checkout #billing_phone_field .iti {
    display: block;
    width: 100%;
    direction: ltr;
    unicode-bidi: isolate;
}
body.woocommerce-checkout #billing_phone_field .iti input#billing_phone {
    width: 100%;
    min-height: 48px;
    padding-left: 116px !important;
    padding-right: 36px !important;
    direction: ltr;
    text-align: left;
    font-size: 16px;
    color: #222;
}
body.woocommerce-checkout #billing_phone_field .iti .iti__flag-container {
    left: 1px;
    right: auto;
    padding: 0;
    direction: ltr;
}
body.woocommerce-checkout #billing_phone_field .iti .iti__selected-flag {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 104px;
    padding: 0 10px;
    border-right: 1px solid #ddd;
    background: #f6f7f8;
    color: #222;
    direction: ltr;
    font-size: 15px;
}
body.woocommerce-checkout #billing_phone_field .iti .iti__selected-dial-code {
    margin: 0;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}
body.woocommerce-checkout #billing_phone_field .iti .iti__arrow {
    margin: 0;
    flex: 0 0 auto;
}
body.woocommerce-checkout #billing_phone_field .iti .iti__flag {
    flex: 0 0 auto;
    filter: none;
}
/* Render Kuwait's default flag as a local vector at its native 2:1 ratio. */
body.woocommerce-checkout #billing_phone_field .iti .iti__flag.iti__kw {
    width: 24px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12'%3E%3Cpath fill='%23007a3d' d='M0 0h24v4H0z'/%3E%3Cpath fill='%23fff' d='M0 4h24v4H0z'/%3E%3Cpath fill='%23ce1126' d='M0 8h24v4H0z'/%3E%3Cpath fill='%23000' d='M0 0l6 4v4l-6 4z'/%3E%3C/svg%3E");
    background-position: 0 0;
    background-size: 24px 12px;
}
body.woocommerce-checkout #billing_phone_field .iti .iti__country-list {
    z-index: 100;
    max-height: 260px;
    max-width: min(360px, calc(100vw - 32px));
    border-radius: 6px;
    direction: ltr;
    font-size: 14px;
    line-height: 1.5;
    white-space: normal;
}
body.woocommerce-checkout #billing_phone_field .iti .iti__country-name {
    margin-right: 6px;
    margin-left: 0;
}
body.woocommerce-checkout #billing_phone_field .iti .iti__flag-box {
    margin-right: 6px;
    margin-left: 0;
}

/* Keep product purchase text readable on the existing blue button. */
.single-product form.cart .single_add_to_cart_button {
    --btn-accented-color: #fff;
    --btn-accented-color-hover: #fff;
    color: #fff;
}
.single-product form.cart .single_add_to_cart_button:hover,
.single-product form.cart .single_add_to_cart_button:focus-visible {
    color: #fff;
}
