/**
 * Quantity Discount Plugin - Styles
 */

/* Скрываем стандартную цену WooCommerce */

.quantity-discount-selector {
    margin: 20px 0;
    margin-bottom: 25px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: none; /* Скрыт по умолчанию */
}

/* Показываем только когда плагин активен (кука установлена) */
body.quantity-discount-active .quantity-discount-selector {
    display: block;
}

.quantity-discount-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.quantity-option {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #ffffff;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
}

.quantity-option:hover {
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.quantity-option.selected {
    border-color: #007cba;
    background: #e7f5ff;
    box-shadow: 0 2px 12px rgba(0, 124, 186, 0.2);
}

.quantity-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.multiplier-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.quantity-option.selected .multiplier-label {
    color: #007cba;
}

.multiplier-price {
    font-size: 24px;
    font-weight: 500;
    color: #555;
}

.quantity-option.selected .multiplier-price {
    color: #007cba;
    font-weight: 600;
}

@media (max-width: 768px) {
    .multiplier-price {
        font-size: 21px;
    }
}

.discount-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Скрытие стандартного поля количества WooCommerce (только когда плагин активен) */
body.quantity-discount-active .quantity-discount-selector ~ .quantity {
    display: none !important;
}

/* Стиль для кнопки добавления в корзину (только когда плагин активен) */
body.quantity-discount-active .cart .single_add_to_cart_button {
    margin-left: 0;
}

/* Анимация при загрузке */
.quantity-discount-selector {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Дополнительные стили для корзины и чекаута */
.woocommerce-cart-form .product-name dl.variation,
.woocommerce-checkout-review-order .product-name dl.variation {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

.woocommerce-cart-form .product-name dl.variation dt,
.woocommerce-checkout-review-order .product-name dl.variation dt {
    float: left;
    clear: both;
    margin-right: 5px;
    font-weight: 600;
}

.woocommerce-cart-form .product-name dl.variation dd,
.woocommerce-checkout-review-order .product-name dl.variation dd {
    margin-left: 0;
}

/* Стили для блока экономии */
.quantity-discount-savings {
    margin-top: 10px;
    padding: 10px;
    background: #e7f5e7;
    border: 1px solid #4caf50;
    border-radius: 4px;
    color: #2e7d32;
    font-size: 14px;
    text-align: center;
}

.quantity-discount-savings strong {
    color: #1b5e20;
}

.quantity-discount-savings-row th,
.quantity-discount-savings-row td {
    color: #2e7d32 !important;
    font-weight: 600 !important;
}

.quantity-discount-savings-row .woocommerce-Price-amount {
    color: #2e7d32 !important;
}
