/* WooCommerce Custom Upsell - Frontend Styles */
/* Design B - Everything on one horizontal line */

.wc-custom-upsell-section {
    margin: 20px 0;
}

/* Container */
.wc-upsell-quantity-discount {
    margin-bottom: 15px;
}

.wc-upsell-quantity-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Option Block */
.wc-upsell-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 20px;
    background: #fff;
    transition: border-color 0.2s ease;
}

.wc-upsell-option.has-badge {
    margin-top: 14px;
}

.wc-upsell-option:hover {
    border-color: #bbb;
}

.wc-upsell-option.selected {
    border-color: #47A025;
}

/* Hide radio */
.wc-upsell-option input[type="radio"] {
    display: none;
}

/* Badge above */
.option-badge-top {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #47A025;
    color: white;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Left side - qty + discount on one line */
.option-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.option-qty {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.option-discount-percent {
    font-size: 13px;
    color: #666;
}

/* Right side - prices + savings on one line */
.option-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.option-original-price {
    font-size: 14px;
    color: #999;
}

.option-final-price {
    font-size: 17px;
    font-weight: 700;
    color: #333;
}

.option-savings {
    background: #FEF0E5;
    color: #E56B00;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ==================== */
/* Cross-Sell Products  */
/* ==================== */

.wc-upsell-cross-sell {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.wc-upsell-cross-sell .wc-upsell-title {
    font-size: 1em;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
}

.wc-upsell-cross-sell-products {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wc-cross-sell-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 18px;
    background: #fff;
    transition: border-color 0.2s ease;
}

.wc-cross-sell-item:hover {
    border-color: #bbb;
}

.wc-cross-sell-item.selected {
    border-color: #47A025;
}

.wc-cross-sell-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.cross-sell-content {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.cross-sell-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.cross-sell-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.cross-sell-details {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cross-sell-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.cross-sell-pricing {
    display: flex;
    align-items: center;
    gap: 10px;
}

.original-price {
    font-size: 13px;
    color: #999;
}

.discounted-price {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.savings {
    background: #FEF0E5;
    color: #E56B00;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Hide old elements */
.wc-upsell-summary,
.wc-upsell-actions {
    display: none !important;
}

/* ==================== */
/* Responsive           */
/* ==================== */

@media (max-width: 550px) {
    .wc-upsell-option {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px;
    }
    
    .option-left {
        width: 100%;
    }
    
    .option-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .cross-sell-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .cross-sell-pricing {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Loading state */
.wc-upsell-loading {
    opacity: 0.6;
    pointer-events: none;
}
