/**
 * Sync Combination Stock - Cart Validation Styles
 */

/* Komunikat ostrzegawczy */
.synccombstock-cart-warning {
    border: 2px solid #dc3545 !important;
    border-radius: 5px;
    padding: 20px;
    background-color: #f8d7da !important;
    color: #721c24 !important;
    margin: 20px 0 !important;
    animation: synccombstock-fade-in 0.3s ease-in;
}

@keyframes synccombstock-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.synccombstock-cart-warning .alert-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: bold;
}

.synccombstock-cart-warning .material-icons {
    font-size: 24px;
}

.synccombstock-cart-warning hr {
    border-color: #f5c6cb;
    margin: 15px 0;
}

.synccombstock-cart-warning strong {
    font-weight: 600;
}

/* Ukryj przyciski checkout gdy jest błąd */
body:has(.synccombstock-cart-warning) .cart-summary .checkout,
body:has(.synccombstock-cart-warning) .cart-grid-right .checkout,
body:has(.synccombstock-cart-warning) a[href*="order"] {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

/* Ukryj standardowe błędne komunikaty PrestaShop */
/* Komunikaty typu "Możesz kupić tylko X sztuk" są błędne dla produktów z synchronizowanymi kombinacjami */
/* Nasz moduł pokazuje właściwe komunikaty przez JavaScript */

/* Ukryj alerts z tekstem o ilości sztuk dla produktów z kombinacjami */
.alert:has(.alert-text):not(.synccombstock-cart-warning) {
    /* Nie ukrywamy - może być potrzebny dla innych produktów */
}

/* Opcjonalnie: dodaj klasę do body gdy moduł jest aktywny */
body.synccombstock-active .notifications .alert {
    /* Filtruj tylko te o dostępności */
}

/* Dodaj wizualny feedback gdy przycisk jest zablokowany */
.synccombstock-blocked {
    position: relative;
}

.synccombstock-blocked::after {
    content: "Zmniejsz ilość produktów w koszyku";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1000;
}

.synccombstock-blocked:hover::after {
    opacity: 1;
}

