/* 
 * DXPX Upsell Modal Styles
 */

/* General modal overlay styling for centering */
.dxpx-modal-overlay.is-visible {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.dxpx-modal-content.upsell-modal {
    max-width: 550px;
    width: 100%;
    background: var(--dxpx-surface-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    position: relative;
    z-index: 1003;
    animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.upsell-modal h3 {
    color: var(--dxpx-heading-color);
    margin-top: 0;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upsell-modal p {
    color: var(--dxpx-text-color);
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.5;
}

.upsell-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    max-height: 55vh;
    overflow-y: auto;
    padding: 0 4px; /* Avoid scrollbar cutting content */
}

/* Modern Clean Card Style */
.upsell-item {
    display: grid;
    grid-template-columns: 60px 1fr auto; /* Image - Details - Button */
    align-items: center;
    gap: 1rem;
    background: #fff;
    padding: 1rem;
    border: 1px solid var(--dxpx-border-color);
    border-radius: var(--dxpx-border-radius);
    transition: border-color 0.2s ease;
    text-align: left;
}

/* Slight border highlight on hover, but no movement/shadow to avoid clash */
.upsell-item:hover {
    border-color: var(--dxpx-primary-color);
}

.upsell-image {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f1f1f1;
    border: 1px solid #eee;
}

.upsell-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upsell-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Removed button from here, so no need for explicit flex direction for the button */
}

.upsell-name {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dxpx-heading-color);
    line-height: 1.2;
}

.upsell-price {
    font-size: 0.95rem;
    color: var(--dxpx-text-color);
    font-weight: 500;
}
.upsell-price .amount {
    color: var(--dxpx-heading-color);
    font-weight: 700;
}

/* Wrapper for the button in the grid */
.upsell-actions-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Push button to the right */
}

/* Improved Button - Solid Green Default */
/* Using !important to override potential theme/WooCommerce button styles */
button.upsell-add-btn,
.upsell-add-btn {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    padding: 0.6rem 1.2rem !important;
    border-radius: 0.5rem !important;
    background-color: var(--dxpx-primary-color) !important; /* Solid green background */
    background-image: none !important;
    color: #fff !important; /* White text */
    border: 2px solid var(--dxpx-primary-color) !important; /* Green border */
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    line-height: 1.2 !important;
    text-transform: none !important; /* Prevent theme uppercase */
    height: auto !important;
    box-shadow: none !important;
}

button.upsell-add-btn:hover:not(:disabled),
.upsell-add-btn:hover:not(:disabled) {
    background-color: var(--dxpx-primary-hover-color) !important; /* Slightly darker green on hover */
    border-color: var(--dxpx-primary-hover-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(104, 163, 67, 0.2) !important;
    transform: translateY(-1px); /* Only button moves, inside static card */
    text-decoration: none !important;
}

button.upsell-add-btn:disabled,
.upsell-add-btn:disabled {
    opacity: 0.7 !important;
    cursor: wait !important;
    background-color: #f1f1f1 !important;
    background-image: none !important;
    border-color: #ddd !important;
    color: #999 !important;
    transform: none !important;
    box-shadow: none !important;
}

.upsell-add-btn span {
    position: relative;
    z-index: 1;
}

/* Actions */
.upsell-actions {
    margin-top: 1rem;
}

/* Override unwanted generic button hover styles */
button.button-text-only,
.button-text-only {
    background: transparent !important;
    border: none !important;
    color: #888 !important; /* Muted gray text */
    font-size: 0.9rem !important;
    cursor: pointer !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px !important;
    transition: color 0.2s ease !important;
    box-shadow: none !important;
    text-transform: none !important;
    line-height: normal !important;
}

button.button-text-only:hover,
.button-text-only:hover {
    background-color: transparent !important; /* Ensure background stays transparent */
    color: var(--dxpx-heading-color) !important; /* Hover to heading color */
    text-decoration: underline !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .upsell-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.75rem;
    }
    
    .upsell-image {
        margin: 0 auto;
    }
    
    .upsell-add-btn {
        width: 100%;
    }
}
