/* vm_upsell - cross-selling shopping cart front styles */

/* The wrapper is the grid cell; neutralize the inner miniature's own column
   classes so it fills the cell instead of nesting another column (which caused
   the progressively shrinking items). */
.vmups-product {
    position: relative;
}

.vmups-product > .product-miniature {
    float: none;
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding-left: 0;
    padding-right: 0;
}

/* The theme (theme.css) forces .products.row article.prod-box-grid to a fixed
   width via several min-width media queries (e.g. 25% at >=1600px). Scope an
   override to this module's cross-selling block only (NOT globally) so the
   inner miniature fills the .vmups-product grid cell at every breakpoint. */
.vm-upsell-crossselling .products.row article.prod-box-grid {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
}

@media (min-width: 768px) {
    .vm-upsell-crossselling .products.row article.prod-box-grid {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
}

@media (min-width: 992px) {
    .vm-upsell-crossselling .products.row article.prod-box-grid {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
}

@media (min-width: 1200px) {
    .vm-upsell-crossselling .products.row article.prod-box-grid {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
}

@media (min-width: 1600px) {
    .vm-upsell-crossselling .products.row article.prod-box-grid {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
}

/* Hide the standard add-to-cart block and quantity controls (not needed as we use custom buttons) */
.vm-upsell-crossselling .an_productattributes-qty-add,
.vm-upsell-crossselling .an_productattributes-qty-container,
.vm-upsell-crossselling .an_productattributes-add,
.vm-upsell-crossselling .add-to-cart-mini,
.vm-upsell-crossselling [data-button-action="add-to-cart"] {
    display: none !important;
}

.vmups-action-container {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Custom upsell buttons */
.vmups-product .vmups-add-to-upsell, .vmups-product .vmups-remove-from-upsell {
    display: inline-block !important;
    width: 100%;
    margin-top: 10px;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Respect the hidden-xs-up toggle class: only one button is shown at a time.
   The rules above use !important, so this more-specific selector is required to
   win over them (and over the theme's an_productattributes front.css). */
.vmups-product .vmups-add-to-upsell.hidden-xs-up,
.vmups-product .vmups-remove-from-upsell.hidden-xs-up {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.vmups-buttons {
    display: block !important;
    width: 100%;
    opacity: 1 !important;
    visibility: visible !important;
}

.vmups-product .vmups-buttons .vmups-add-to-upsell.btn.btn-primary {
    background-color: #fff !important;
    color: #EF7F1A !important;
    border: 2px solid #EF7F1A !important;
}

.vmups-product .vmups-buttons .vmups-add-to-upsell.btn.btn-primary:hover {
    background-color: #EF7F1A !important;
    color: #fff !important;
    border-color: #EF7F1A !important;
}

.vmups-product:hover .product-miniature {
    outline: 2px solid #EF7F1A;
    z-index: 10;
}

/* Remove button is permanently visible if item added, keeps orange bg, adds orange border to div */
.vmups-product .vmups-buttons .vmups-remove-from-upsell.btn.btn-primary {
    background-color: #EF7F1A !important;
    border-color: #EF7F1A !important;
    color: #fff !important;
}

.vmups-product.vmups-in-cart .product-miniature {
    outline: 2px solid #EF7F1A;
}

/* "Added to cart" label (keeping for legacy if still needed elsewhere) */
.vmups-in-cart-label {
    display: none;
    margin-top: 8px;
    padding: 4px 8px;
    font-weight: 600;
    color: #4c9f38;
    text-align: center;
}
.vmups-product.vmups-in-cart .vmups-in-cart-label {
    display: inline-block;
}

/* Option B+ undo popup (bonus item removed) */
.vmups-undo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.vmups-undo-dialog {
    max-width: 420px;
    width: 90%;
    padding: 24px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.vmups-undo-message {
    margin: 0 0 18px;
    font-size: 15px;
    color: #333;
}

.vmups-undo-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.vmups-undo-actions .vmups-undo-reinsert.btn {
    background-color: #EF7F1A;
    border-color: #EF7F1A;
    color: #fff;
}

.vmups-undo-actions .vmups-undo-reinsert.btn:hover {
    background-color: #d96f12;
    border-color: #d96f12;
}
