.pofw-product-options-wrapper {margin-top: 0.8em;}
.pofw-product-options-wrapper .field {margin-bottom: 10px;}
.pofw-product-options-wrapper .field > label {font-weight: bold;}
.pofw-product-options-wrapper .field.pofw-required > label > span:first-child:after {
    color: #e32;
    content: ' *';
    display:inline;
}
.pofw-product-options-wrapper .field > label span.pofw-price {font-weight: normal;}

.pofw-product-options-wrapper .field .control select {height:initial; line-height: inherit;}
.pofw-product-options-wrapper .field .control input[type="text"] {width: initial; padding:initial; line-height: inherit;}
.pofw-product-options-wrapper .field .control .options-list {display: flex; flex-direction: row; gap: 10px; align-items: center; }
.pofw-product-options-wrapper .field .control .choice {display: inline-flex; align-items: center; gap: 5px; padding: 10px; }
.pofw-product-options-wrapper .field .control .choice label {display:inline; padding-left: 3px;}
.pofw-product-options-wrapper .field .control .choice input[type="radio"],
.pofw-product-options-wrapper .field .control .choice input[type="checkbox"] {width: auto;}
.pofw-product-options-wrapper .field .control .choice .pofw-image {vertical-align: middle; margin-right: 3px; width: 120px; height: 90px; object-fit: cover; object-position: center; }

@media screen and (max-width: 35em) {
    form.cart:has(.pofw-product-options-wrapper) {
        width: 100%;
    }
    .pofw-product-options-wrapper {
        width: 100%;
    }
    .pofw-product-options-wrapper .field .control .choice {
        width: 100%;
        justify-content: center;
    }
    .pofw-product-options-wrapper .field .control .choice .pofw-image {
        margin-right: 5px;
        margin-left: 5px;        
    }
}

@media screen and (max-width: 30em) {
    .pofw-product-options-wrapper .field .control .choice {
        padding-right: 5%;
        padding-left: 5%;
    }
}

.pofw-product-options-wrapper .field.pofw-required.pofw-not-valid .control input[type="text"],
.pofw-product-options-wrapper .field.pofw-required.pofw-not-valid .control .options-list {border: 1px dotted red;}
.pofw-product-options-wrapper .field.pofw-required.pofw-not-valid .pofw-required-text {color: red; font-style: italic;}

.pofw-product-options-wrapper .pofw-image {display:inline;}
.pofw-product-options-wrapper .pofw-image.pofw-popup {cursor:pointer;}
.pofw-option[type="checkbox"] {
    appearance: none;
    background-color: #fff;
    border: 1px solid 
    color-mix(in srgb, currentColor 48%, transparent);
    border-radius: 4px;
    box-sizing: border-box;
    height: 20px;
    margin: 0;
    min-width: 20px;
    overflow: hidden;
    position: static;
    width: 20px;
}

.pofw-option[type="radio"] {
    /* appearance: none; */
    accent-color: black;
    background-color: #fff;
    border: 1px solid 
    color-mix(in srgb, currentColor 48%, transparent);
    box-sizing: border-box;
    height: 20px;
    margin: 0;
    min-width: 20px;
    overflow: hidden;
    position: static;
    width: 20px;
}

.pofw-option[type="radio"]:checked {
    accent-color: #6d4e2e;
}

.pofw-option[type="checkbox"]:not(:checked) + .pofw-checkbox__mark {
    display: none;
}

.pofw-option[type="checkbox"]:checked + .pofw-checkbox__mark {
    display: block;
    fill: #000;
    height: 15px;
    margin-left: 3px;
    pointer-events: none;
    position: absolute;
    width: 15px;
}

.pofw-checkbox-wrapper {
    display: inline-flex;
    position: relative;
    padding-left: 0;
    padding-right: 0;
    line-height: 1;
}

/* Modal Radio Styles */
.pofw-modal-radio-wrapper {
    position: relative;
}

.pofw-modal-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #6D4E2E;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: "sweet-sans-pro", "Times New Roman", Times, serif;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: background-color 0.2s ease;
}

.pofw-modal-trigger-btn:hover {
    background-color: #5B3813;
}

.pofw-modal-trigger-btn__text {
    font-family: inherit;
}

.pofw-modal-trigger-btn__selected-text {
    font-weight: 400;
    font-family: inherit;
}

.pofw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.pofw-modal-overlay.pofw-modal--open {
    display: flex;
}

.pofw-modal-content {
    background-color: #fff;
    max-width: 90%;
    max-height: 90%;
    width: 400px;
    overflow: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.pofw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    background-color: #6D4E2E;
    color: #fff;
}

.pofw-modal-title {
    font-family: "sweet-sans-pro", "Times New Roman", Times, serif;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pofw-modal-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.pofw-modal-close-btn:hover {
    opacity: 0.8;
}

.pofw-modal-body {
    padding: 1rem;
}

.pofw-modal-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #6D4E2E;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.pofw-modal-option:hover {
    background-color: #f5f5f5;
}

.pofw-modal-radio {
    accent-color: #6D4E2E;
    width: 20px;
    height: 20px;
}

.pofw-modal-option-image {
    width: 60px;
    height: 45px;
    object-fit: cover;
    object-position: center;
}

.pofw-modal-option label {
    cursor: pointer;
    flex: 1;
}

.pofw-modal-option label span {
    font-family: "dante-mt-pro", "Helvetica Neue", Arial, sans-serif;
    font-size: 0.875rem;
}

body.pofw-modal-open {
    overflow: hidden;
}

@media screen and (max-width: 35em) {
    .pofw-modal-content {
        width: 95%;
        max-width: 95%;
    }

    .pofw-modal-option {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pofw-modal-option-image {
        margin-bottom: 0.5rem;
    }
}

/* Cart Modal Styles */
/* Hide the original Add to Cart button when cart_modal mode is active */
.pofw-cart-modal-mode ~ button.single_add_to_cart_button,
.pofw-cart-modal-mode + button.single_add_to_cart_button,
form.cart:has(.pofw-cart-modal-mode) button.single_add_to_cart_button {
    display: none !important;
}

/* Container sits inline with quantity */
.pofw-cart-modal-mode {
    display: inline-block;
}

/* Button matches WooCommerce Add to Cart button styling */
.pofw-cart-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: #6D4E2E;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: "sweet-sans-pro", "Times New Roman", Times, serif;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: background-color 0.2s ease;
    margin-left: 0;
    vertical-align: middle;
}

@media (max-width: 560px) {
    .pofw-cart-modal-btn {
        margin-left: 0;
        width: 100%;
    }
}

.pofw-cart-modal-btn:hover {
    background-color: #5B3813;
    color: #fff;
}

.pofw-cart-modal-btn__text {
    font-family: inherit;
}

.pofw-cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
}

.pofw-cart-modal-overlay.pofw-cart-modal--open {
    display: flex;
}

.pofw-cart-modal-content {
    background-color: #fff;
    max-width: 95%;
    max-height: 90%;
    width: 730px;
    overflow: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.pofw-cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    background-color: #6D4E2E;
    color: #fff;
}

.pofw-cart-modal-title {
    font-family: "sweet-sans-pro", "Times New Roman", Times, serif;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pofw-cart-modal-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.pofw-cart-modal-close-btn:hover {
    opacity: 0.8;
}

.pofw-cart-modal-body {
    padding: 1.5rem;
}

.pofw-cart-modal-options {
    /* Container for all options in the modal */
}

.pofw-cart-modal-options .field {
    margin-bottom: 1rem;
}

.pofw-cart-modal-options .field .control select {
    height: initial;
    line-height: inherit;
}

.pofw-cart-modal-options .field .control input[type="text"] {
    width: initial;
    padding: initial;
    line-height: inherit;
}

.pofw-cart-modal-options .field .control .choice {
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
    /*border: 1px solid #6D4E2E;*/
    padding: 10px;
    position: relative;
}

.pofw-cart-modal-options .field .control .choice label {
    display: block;
    grid-column: 2 / 5;
    grid-row: 2;
    justify-self: center;
    padding-left: 0;
    text-align: center;
}

.pofw-cart-modal-options .field .control .choice label::before {
    content: '';
    position: absolute;
    inset: 0;
    cursor: pointer;
}

.pofw-cart-modal-options .field .control .choice input[type="radio"],
.pofw-cart-modal-options .field .control .choice input[type="checkbox"] {
    width: auto;
    grid-column: 1;
    grid-row: 1;
    align-self: center;
}

.pofw-cart-modal-options .field .control .choice .pofw-image {
    vertical-align: middle;
    margin-right: 0;
    width: 270px;
    height: 201px;
    object-fit: cover;
    object-position: center;
    grid-column: 2 / 5;
    grid-row: 1;
    justify-self: center;
}

.pofw-cart-modal-options .pofw-image {
    display: inline;
}

.pofw-cart-modal-options .pofw-image.pofw-popup {
    cursor: pointer;
}

.pofw-cart-modal-options .field > label {
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
    font-family: "sweet-sans-pro", "Times New Roman", Times, serif;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6D4E2E;
}

.pofw-cart-modal-options .pofw-required > label > span:first-child:after {
    color: #e32;
    content: ' *';
    display: inline;
}

.pofw-cart-modal-options .pofw-not-valid {
    border: 1px dotted red;
    padding: 0.5rem;
}

.pofw-cart-modal-options .pofw-required-text {
    color: red;
    font-style: italic;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Hide value title labels only when there's an image in the choice */
.pofw-cart-modal-options .choice:has(.pofw-image) label span:first-child {
    display: none;
}

/* Keep price labels visible if present */
.pofw-cart-modal-options .choice label .pofw-price {
    display: block;
    text-align: center;
}

/* Cart modal options: 2 items per row, center odd items */
.pofw-cart-modal-options .options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;

}

.pofw-cart-modal-options .options-list .choice {
    width: calc(50% - 5px);
    justify-content: center;
}

/* Center the last odd item */
.pofw-cart-modal-options .options-list .choice:last-child:nth-child(odd) {
    flex: 1 1 auto;
    /*max-width: calc(50% - 5px);*/
    display: flex;
    /* align-items: baseline; */
    width: 100%;
    min-width: 100%;
    justify-content: flex-start;
}

/* Last choice (no gift box) - exclude from grid, left align */
.pofw-cart-modal-options .field .control .choice:last-child {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    position: relative;
}

.pofw-cart-modal-validation-message {
    margin-top: 1rem;
}

.pofw-cart-modal-error {
    color: #e32;
    font-size: 0.875rem;
    padding: 0.75rem;
    background-color: #fff5f5;
    border: 1px solid #e32;
    border-radius: 0.25rem;
}

.pofw-cart-modal-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
}

.pofw-cart-modal-cancel-btn {
    padding: 0.75rem 1.5rem;
    background-color: #fff;
    color: #6D4E2E;
    border: 1px solid #6D4E2E;
    cursor: pointer;
    font-family: "sweet-sans-pro", "Times New Roman", Times, serif;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.2s ease;
}

.pofw-cart-modal-cancel-btn:hover {
    background-color: #f5f5f5;
}

.pofw-cart-modal-submit-btn {
    padding: 0.75rem 1.5rem;
    background-color: #6D4E2E;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: "sweet-sans-pro", "Times New Roman", Times, serif;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: background-color 0.2s ease;
}

.pofw-cart-modal-submit-btn:hover {
    background-color: #5B3813;
}

/* Nested modal radio in cart modal */
.pofw-modal-trigger-btn--nested {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.pofw-modal-overlay--nested {
    z-index: 10002;
}

label[for^="pofw_modal_cart_value-"] > span:not(.pofw-price) {
    display: none;
}

body.pofw-cart-modal-open {
    overflow: hidden;
}

@media screen and (max-width: 35em) {
    .pofw-cart-modal-content {
        width: 95%;
        max-width: 95%;
    }

    .pofw-cart-modal-options .options-list .choice {
        width: 100%;
    }

    .pofw-cart-modal-options .field .control .choice {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto;
        align-items: center;
        justify-content: start;
        padding: 5px;
    }

    .pofw-cart-modal-options .field .control .choice input[type="radio"],
    .pofw-cart-modal-options .field .control .choice input[type="checkbox"] {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }

    .pofw-cart-modal-options .field .control .choice .pofw-image {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        width: 100%;
        height: auto;
        max-width: unset !important;
    }

    .pofw-cart-modal-options .field .control .choice label {
        grid-column: 3;
        grid-row: 1;
        justify-self: start;
        text-align: left;
    }

    /* Last choice (No Gift Box) - no image, just radio + text */
    .pofw-cart-modal-options .field .control .choice:last-child {
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: flex-start;
        position: relative;
    }

    .pofw-cart-modal-footer {
        /*flex-direction: column-reverse;*/
    }

    .pofw-cart-modal-cancel-btn,
    .pofw-cart-modal-submit-btn {
        width: 100%;
    }
}

.field.pofw-required label {
    display: none;
}