/* ===================================
   ОБЩИЕ СТИЛИ ДЛЯ E-COMMERCE КОМПОНЕНТОВ
   =================================== */

/* Toast уведомления */
.toast-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-card);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--app-primary);
    margin-bottom: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
    max-width: 500px;
}

.toast-notification.success {
    border-left-color: var(--app-success);
}

.toast-notification.success i {
    color: var(--app-success);
}

.toast-notification.error {
    border-left-color: var(--app-accent);
}

.toast-notification.error i {
    color: var(--app-accent);
}

.toast-notification.info {
    border-left-color: var(--app-primary);
}

.toast-notification.info i {
    color: var(--app-primary);
}

.toast-notification i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.toast-notification span {
    flex: 1;
    color: var(--txt-main);
    font-weight: 600;
    font-size: 0.95rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Форма обратной связи */
.form-control:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control.is-invalid {
    border-color: var(--app-accent);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Адаптивные утилиты */
@media (max-width: 576px) {
    .toast-notification {
        min-width: auto;
        width: calc(100% - 20px);
        padding: 14px 18px;
    }

    .toast-notification i {
        font-size: 1.1rem;
    }

    .toast-notification span {
        font-size: 0.9rem;
    }
}

/* Карточка товара - общие стили */
.product-card-common {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-common:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

/* Кнопки действий */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.action-btn-primary {
    background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.action-btn-secondary {
    background: transparent;
    border: 2px solid var(--border-light);
    color: var(--txt-main);
}

.action-btn-secondary:hover {
    border-color: var(--app-primary);
    color: var(--app-primary);
    background: rgba(59, 130, 246, 0.05);
}

/* Бейджи */
.badge-common {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-hit {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.badge-sale {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.products-grid--premium {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

.products-grid--minimal {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
}

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

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Горизонтальный свайп */
.swipe-container {
    position: relative;
    overflow: hidden;
    margin: 0 -20px;
    padding: 10px 0;
}

.swipe-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 20px;
}

.swipe-track::-webkit-scrollbar {
    display: none;
}

.swipe-item {
    flex: 0 0 auto;
    width: 300px;
    scroll-snap-align: start;
}

.swipe-controls {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.swipe-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    color: var(--txt-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swipe-btn:hover {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: white;
    transform: scale(1.05);
}

/* Индикаторы свайпа */
.swipe-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px 0;
}

.swipe-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.swipe-indicator:hover {
    border-color: var(--app-primary);
    background: rgba(59, 130, 246, 0.2);
}

.swipe-indicator.active {
    background: var(--app-primary);
    border-color: var(--app-primary);
    transform: scale(1.2);
}

/* Анимации загрузки */
.skeleton-loader {
    background: linear-gradient(90deg, var(--bg-body) 25%, var(--bg-card) 50%, var(--bg-body) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-image {
    height: 240px;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    margin: 16px 0 8px;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin: 8px 0;
}

.skeleton-text.short {
    width: 60%;
}

/* Цена со скидкой */
.price-box {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.price-current {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--app-primary);
}

.price-old {
    font-size: 1rem;
    color: var(--txt-sub);
    text-decoration: line-through;
}

.price-discount {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Состояния товаров */
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stock-status.in-stock {
    background: rgba(16, 185, 129, 0.1);
    color: var(--app-success);
}

.stock-status.out-of-stock {
    background: rgba(239, 68, 68, 0.1);
    color: var(--app-accent);
}

/* Медиа-запросы для всех компонентов */
@media (max-width: 480px) {
    .swipe-item {
        width: 260px;
    }

    .swipe-btn {
        width: 40px;
        height: 40px;
    }

    .swipe-controls {
        justify-content: flex-end;
    }
}
