.gharza-select-enhanced {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.gharza-header-search {
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-inline: 12px;
    padding: 0;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    background: #fff;
    color: #222;
    cursor: pointer;
    box-shadow: none;
}

.gharza-header-search:hover,
.gharza-header-search:focus-visible {
    border-color: #583735;
    color: #583735;
    outline: none;
}

.gharza-header-search svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.gharza-search-dialog[hidden] { display: none !important; }
.gharza-search-dialog { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: start center; padding: 90px 16px 16px; }
.gharza-search-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: rgba(0,0,0,.48); }
.gharza-search-panel { position: relative; z-index: 1; width: min(620px, 100%); padding: 28px 24px 24px; border-radius: 16px; background: #fff; box-shadow: 0 18px 55px rgba(0,0,0,.25); direction: rtl; }
.gharza-search-panel label { display: block; margin-bottom: 12px; color: #222; font-size: 20px; font-weight: 700; }
.gharza-search-field-row { display: flex; gap: 10px; }
.gharza-search-field-row input[type="search"] { flex: 1 1 auto; min-width: 0; height: 50px; margin: 0; padding: 0 16px; border: 1px solid #ddd; border-radius: 10px; background: #fff; color: #222; }
.gharza-search-field-row button { flex: 0 0 auto; height: 50px; margin: 0; padding: 0 24px; border: 0; border-radius: 10px; background: #583735; color: #fff; font-weight: 700; }
.gharza-search-close { position: absolute; top: 8px; left: 12px; width: 38px; height: 38px; padding: 0; border: 0; background: transparent; color: #555; font-size: 32px; line-height: 1; }
body.gharza-search-open { overflow: hidden; }

@media (max-width: 991px) {
    .gharza-header-search { margin-inline: 8px; }
}

@media (max-width: 480px) {
    .gharza-header-search { flex-basis: 40px; width: 40px; height: 40px; margin-inline: 5px; }
    .gharza-search-dialog { padding-top: 70px; }
    .gharza-search-panel { padding: 26px 16px 18px; }
    .gharza-search-field-row button { padding-inline: 18px; }
}

/* Keep only our product images for the design choice and retain the normal size dropdown. */
form.variations_form .gharza-image-choice-cell > .select2,
form.variations_form .gharza-image-choice-cell > .variable-items-wrapper,
form.variations_form td.value:not(.gharza-image-choice-cell) > .variable-items-wrapper {
    display: none !important;
}

form.variations_form td.value:not(.gharza-image-choice-cell) > .select2 {
    display: block !important;
    width: 100% !important;
}

.gharza-image-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 10px;
}

.gharza-image-swatch {
    position: relative;
    width: 72px;
    height: 88px;
    padding: 3px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.gharza-swatch-check {
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .22);
    opacity: 0;
    transform: scale(.75);
    transition: opacity .15s ease, transform .15s ease;
}

.gharza-image-swatch:hover,
.gharza-image-swatch:focus-visible {
    border-color: #777;
    outline: none;
    transform: translateY(-1px);
}

.gharza-image-swatch.is-selected {
    border-color: #583735;
    box-shadow: 0 0 0 1px #583735;
}

/* One clear, full-size purchase action on every product template. */
body.single-product form.cart .single_add_to_cart_button,
body.single-product .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 190px !important;
    width: auto !important;
    min-width: 190px !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 0 24px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: #583735 !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    box-shadow: none !important;
}

body.single-product form.cart .single_add_to_cart_button:hover,
body.single-product form.cart .single_add_to_cart_button:focus-visible {
    background: #422826 !important;
}

body.single-product form.cart,
body.single-product .woocommerce-variation-add-to-cart {
    display: flex !important;
    align-items: stretch !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

/* Burgundy is the brand action colour; green remains only for stock/success states. */
body .woocommerce a.button:not(.wc-forward),
body .woocommerce button.button,
body .woocommerce input.button,
body .woocommerce #respond input#submit {
    background-color: #583735;
    color: #fff;
}

.gharza-image-swatch.is-selected .gharza-swatch-check {
    opacity: 1;
    transform: scale(1);
}

.gharza-image-swatch img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

@media (max-width: 480px) {
    .gharza-image-swatch {
        width: 62px;
        height: 76px;
    }

    /* Keep Nest's sticky purchase bar fully inside narrow mobile screens. */
    body.single-product .sticky_sigle_add_to_cart {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 10px 12px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.single-product .sticky_sigle_add_to_cart .product-title-price,
    body.single-product .sticky_sigle_add_to_cart .sticky-add-to-cart-container,
    body.single-product .sticky_sigle_add_to_cart form.cart {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    body.single-product .sticky_sigle_add_to_cart form.cart {
        position: static !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    body.single-product .sticky_sigle_add_to_cart form.cart .quantity {
        flex: 0 0 88px !important;
        min-width: 88px !important;
        width: 88px !important;
        max-width: 88px !important;
        margin: 0 !important;
    }

    body.single-product .sticky_sigle_add_to_cart .single_add_to_cart_button {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-inline: 10px !important;
        white-space: normal !important;
    }
}
