/**
 * NUCLEAR CSS FIX FOR POPUP DISPLAY ISSUES
 * Maximum specificity to override ANY conflicting styles
 */

/* Force container to be block with no flex */
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices,
body #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices,
#wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices,
html body .wcc-popup-mode .wcc-options-prices {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 0 !important; /* Remove whitespace */
    text-align: left !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
}

/* Force ALL child divs to be inline-block */
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices > div,
body #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices > div,
#wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices > div,
html body .wcc-popup-mode .wcc-options-prices > div {
    display: inline-block !important;
    vertical-align: top !important;
}

/* Force 2 items per line with maximum specificity */
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices .wcc-option-price-item,
body #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices .wcc-option-price-item,
#wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices .wcc-option-price-item,
html body .wcc-popup-mode .wcc-option-price-item,
.wcc-option-price-item {
    display: inline-block !important;
    width: calc(50% - 5px) !important;
    max-width: calc(50% - 5px) !important;
    min-width: calc(50% - 5px) !important;
    font-size: 14px !important;
    vertical-align: top !important;
    margin-right: 0 !important;
    margin-bottom: 10px !important;
    float: none !important;
    flex: none !important;
    box-sizing: border-box !important;
}

/* Force title to full width */
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices .wcc-options-list-title,
body #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices .wcc-options-list-title,
#wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices .wcc-options-list-title,
html body .wcc-popup-mode .wcc-options-list-title {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    clear: both !important;
    font-size: 16px !important;
    margin-bottom: 10px !important;
}

/* Add gap between odd items */
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices .wcc-option-price-item:nth-child(odd):not(:last-child),
body #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices .wcc-option-price-item:nth-child(odd):not(:last-child),
html body .wcc-popup-mode .wcc-option-price-item:nth-child(odd):not(:last-child) {
    margin-right: 10px !important;
}

/* Override any display flex that might be applied */
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices.flex,
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices[style*="flex"],
#wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-options-prices[style*="flex"] {
    display: block !important;
}

/* Force price colors from CSS variables */
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-option-price-value,
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-option-price-label,
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-total-price-value,
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .price,
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .woocommerce-Price-amount {
    color: var(--wcc-price-text-color, #d4a574) !important;
}

/* Force remove button color */
body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-option-remove {
    background-color: var(--wcc-remove-button-color, #ff0000) !important;
    color: white !important;
}

/* Override inline styles with attribute selector */
[style*="display: flex"] .wcc-option-price-item,
[style*="display:flex"] .wcc-option-price-item {
    display: inline-block !important;
}

/* Media query for small screens - maintain 2 columns */
@media (max-width: 480px) {
    body.wcc-popup-active #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-option-price-item,
    #wcc-popup-overlay #wcc-popup #wcc-popup-content .wcc-option-price-item {
        width: calc(50% - 5px) !important;
        max-width: calc(50% - 5px) !important;
        min-width: calc(50% - 5px) !important;
    }
}

/* Debug borders - uncomment to see layout */
/*
.wcc-options-prices {
    border: 2px solid red !important;
}
.wcc-option-price-item {
    border: 2px solid blue !important;
}
.wcc-options-list-title {
    border: 2px solid green !important;
}
*/