/* Rearrange YITH option content only when JS activates the layout scope */
body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .yith-wapo-option {
    height: auto !important;
    min-height: 0 !important;
}


/* Test only: render YITH per-row-3 grids as 2 columns */
body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid.per-row-3 .yith-wapo-option {
    width: 48% !important;
    max-width: 48% !important;
    margin-right: 2% !important;
    float: left !important;
    clear: none !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid.per-row-3 .yith-wapo-option:nth-of-type(2n) {
    margin-right: 0 !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid.per-row-3 .yith-wapo-option:nth-of-type(2n+1) {
    clear: both !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid.per-row-3 .yith-wapo-option:nth-of-type(3n+1) {
    clear: none !important;
}

@media (min-width: 768px) {
    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid.per-row-3 .yith-wapo-option {
        min-height: 108px !important;
        margin-bottom: 12px !important;
    }
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .outside .description {
    min-height: 16px !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    min-width: 0 !important;

    background: #1a1a1a !important;   /* slightly lighter than black */
    border: 1px solid transparent !important;  /* invisible by default */
    border-radius: 8px !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .yith-wapo-option:not(.selected):not(.checked):not(:has(input:checked)) .label_container.above.inside > label {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside > label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
    text-align: left !important;
    box-sizing: border-box !important;
    padding: 12px !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside > label > .image {
    flex: 0 0 110px !important;
    width: 110px !important;
    min-width: 110px !important;
    margin: 0 !important;
    text-align: center !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside > label > .image img {
    width: 110px !important;
    max-width: 110px !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside > label > .inside {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    text-align: left !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_price {
    display: block !important;
    min-height: 0 !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    overflow: visible !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_price .option-price {
    font-size: 0.95rem !important;
    display: block !important;
    margin: 2px 0 6px 0 !important;
    line-height: 1.2 !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_price br {
    display: revert !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_price font {
    font-size: 0.95rem !important;
    display: inline !important;
    margin: 0 !important;
    line-height: inherit !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_price > font:first-child {
    display: inline !important;
    margin: 0 !important;
    line-height: inherit !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .outside {
    padding: 0 !important;
    margin-top: 0 !important;
    text-align: left !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .outside .description {
    margin: 6px 12px 8px 126px !important;
    text-align: left !important;
    line-height: 1.25 !important;
    pointer-events: none !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .idt-option-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    min-height: 60px !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .idt-option-promo {
    display: block !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    line-height: inherit !important;
    min-height: 0 !important;
    margin: 0 0 4px 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .idt-option-title {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    min-height: 0 !important;
    margin: 0 !important;
}

body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .idt-option-head .option-price {
    margin-top: auto !important;
    display: block !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
}

    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .yith-wapo-option:hover .label_container.above.inside {
        border-color: rgba(255, 255, 255, 0.28) !important;
        background: #202020 !important;
    }


@media (max-width: 767px) {
    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid.per-row-1 .yith-wapo-option,
    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid.per-row-2 .yith-wapo-option,
    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid.per-row-3 .yith-wapo-option {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        float: none !important;
        clear: both !important;
        margin-bottom: 12px !important;
        height: auto !important;
        min-height: 0 !important;
    }

    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        min-width: 0 !important;
        background: #1a1a1a !important;   /* slightly lighter than black */
        border: 1px solid transparent !important;  /* invisible by default */
        border-radius: 8px !important;
        transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
    }
    


    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside > label {
        display: flex !important;
        gap: 12px !important;
        padding: 12px !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        align-items: flex-start !important;
        align-content: flex-start !important;
    }

    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside > label > .image {
        flex: 0 0 96px !important;
        width: 96px !important;
        min-width: 96px !important;
    }

    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside > label > .image img {
        width: 96px !important;
        max-width: 96px !important;
    }

    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .outside {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin-top: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .outside .description {
        margin: 6px 12px 8px 120px !important;
        text-align: left !important;
        line-height: 1.25 !important;
        pointer-events: none !important;
    }
}


/* Default non-selected card: no visible outline */
body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .yith-wapo-option:not(.selected):not(.checked):not(:has(input:checked)) .label_container.above.inside {
    background: #1a1a1a !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* Hover only for non-selected options */
body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .yith-wapo-option:not(.selected):not(.checked):not(:has(input:checked)):hover .label_container.above.inside {
    background: #202020 !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
}



@media (min-width: 768px) {
    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .yith-wapo-option {
        position: relative !important;
        min-height: 128px !important;
        height: 136px !important;
        overflow: visible !important;
    }

    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside {
        height: 100% !important;
        min-height: 136px !important;
    }

    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .label_container.above.inside > label {
        height: 100% !important;
        min-height: 136px !important;
        box-sizing: border-box !important;
    }

    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .outside {
        position: absolute !important;
        left: 126px !important;
        right: 12px !important;
        bottom: 8px !important;
        padding: 0 !important;
        margin: 0 !important;
        pointer-events: none !important;
    }

    body.idt-yith-grid-layout-active.single-product .yith-wapo-block .yith-wapo-addon .options.grid .outside .description {
        margin: 0 !important;
        line-height: 1.2 !important;
        font-size: 0.72rem !important;
        text-align: left !important;
    }
}