/* Капсула — обводка навколо всього блоку */
.quantity-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #f5c518;
    border-radius: 8px;
    overflow: hidden;
    margin: 0;
    height: 38px;
}

.quantity-button {
    width: 32px;
    height: 100%;
    background-color: #ffffff;
    border: none;
    text-align: center;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.2s ease;
    color: #555;
}

.quantity-button:hover {
    background-color: #fff8dc;
}

.input-quantity {
    width: 36px;
    height: 100%;
    text-align: center;
    font-size: 14px;
    border: none;
    border-left: 1px solid #f5c518;
    border-right: 1px solid #f5c518;
    margin: 0;
    outline: none;
    -moz-appearance: textfield;
    color: #333;
}

/* Прибираємо стрілки браузера */
.input-quantity::-webkit-outer-spin-button,
.input-quantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Blocksy контейнер */
.ct-woo-card-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

/* Адаптив */
@media (max-width: 768px) {
    .ct-woo-card-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }

    .ct-woo-card-actions .button {
        flex: 1;
        white-space: nowrap;
    }

    .quantity-buttons {
        display: flex !important;
        flex-shrink: 0;
        margin: 0 !important;
        width: auto !important;
        height: 36px;
    }

    .input-quantity {
        width: 30px;
    }

    .quantity-button {
        width: 28px;
        font-size: 16px;
    }
}

/* Індикатор оновлення кошика */
.woocommerce-cart-form.cart-updating {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
    position: relative;
}

.woocommerce-cart-form.cart-updating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    border: 3px solid #f5c518;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cart-spin 0.7s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes cart-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Мобільний підсумок за позицію */
@media (max-width: 768px) {
    .product-mobile-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    .mobile-subtotal {
        display: block !important;
        width: 100%;
        font-size: 15px;
        font-weight: 700 !important;
        color: #333 !important;
        margin-left: 0 !important;
        margin-top: 4px;
        padding-top: 6px;
        border-top: 1px solid #eee;
    }
}

/* Кнопка "Вже у кошику" */
.add_to_cart_button.in-cart {
    background-color: #e8f5e9 !important;
    border-color: #4caf50 !important;
    color: #2e7d32 !important;
    cursor: default !important;
    opacity: 0.9;
}

/* Інформаційний бейдж про оптову ціну */
.klipsa-wholesale-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 4px;
    padding: 8px 12px;
    border-left: 3px solid #4caf50;
    background-color: #f1f8f1;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.klipsa-wholesale-badge .badge-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background-color: #4caf50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
}

.klipsa-wholesale-badge .badge-amount {
    color: #4caf50;
    font-weight: 600;
}

/* Блок цін */
.klipsa-price-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    margin-bottom: 4px;
}

.klipsa-price-label {
    font-size: 13px;
    color: #666;
}

.klipsa-price-value {
    font-weight: 600;
    color: #222;
}

.klipsa-price-retail .klipsa-price-value {
    font-size: 15px;
}

.klipsa-price-wholesale .klipsa-price-value {
    font-size: 14px;
    color: #555;
}

/* Toast повідомлення */
.klipsa-toast {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: #2e7d32;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.klipsa-toast.klipsa-toast-visible {
    top: 24px;
}

.klipsa-toast-icon {
    font-size: 16px;
    font-weight: 700;
}

/* Роздрібний toast — інший колір */
.klipsa-toast.klipsa-toast-retail {
    background: #1565c0;
}

@media (max-width: 768px) {
    .klipsa-toast {
        white-space: normal;
        width: 90%;
        text-align: center;
        justify-content: center;
    }
}

/* Сторінка новинок — сітка товарів */
.klipsa-new-products-wrap ul.products.klipsa-new-products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px !important;
    float: none !important;
    width: 100% !important;
}

.klipsa-new-products-wrap ul.products.klipsa-new-products-grid li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    padding: 0 !important;
}

.klipsa-new-products-count {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .klipsa-new-products-wrap ul.products.klipsa-new-products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .klipsa-new-products-wrap ul.products.klipsa-new-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 480px) {
    .klipsa-new-products-wrap ul.products.klipsa-new-products-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

/* Вирівнюємо стиль карток на сторінці новинок під стандартні картки */
.klipsa-new-products-wrap ul.products.klipsa-new-products-grid li.product .woocommerce-loop-product__title,
.klipsa-new-products-wrap ul.products.klipsa-new-products-grid li.product .woocommerce-loop-product__title a {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #222 !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
}

.klipsa-new-products-wrap ul.products.klipsa-new-products-grid li.product .woocommerce-loop-product__title a:hover {
    color: #d4a96a !important;
}