/**
 * Стили для уведомлений и улучшения UX
 */

/* Уведомления об ошибках */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: #fff;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.15);
    max-width: 400px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.error-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.notification-content i {
    color: #e74c3c;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.notification-content span {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    flex-grow: 1;
}

.close-notification {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.close-notification:hover {
    background: #f5f5f5;
    color: #666;
}

/* Уведомления об успехе */
.success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: #fff;
    border: 1px solid #27ae60;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.15);
    max-width: 400px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.success-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.success-notification .notification-content i {
    color: #27ae60;
}

/* Уведомления с предупреждением */
.warning-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: #fff;
    border: 1px solid #f39c12;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.15);
    max-width: 400px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.warning-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.warning-notification .notification-content i {
    color: #f39c12;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .error-notification,
    .success-notification,
    .warning-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }

    .error-notification.show,
    .success-notification.show,
    .warning-notification.show {
        transform: translateY(0);
    }
}

/* Анимации загрузки */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Улучшенные состояния кнопок */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Улучшенные фокусы для доступности */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline-offset: 2px;
}

/* Скрытие элементов для скринридеров */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Улучшенные hover эффекты */
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Анимации для модальных окон */
.modal {
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
}

.modal-content {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Улучшенные стили для форм */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
}

/* Улучшенные стили для карточек товаров */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Улучшенные стили для кнопок корзины */
.add-to-cart-btn {
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.add-to-cart-btn.in-cart {
    background-color: #27ae60;
}

.add-to-cart-btn.in-cart:hover {
    background-color: #229954;
}

/* Улучшенные стили для счетчика корзины */
.cart-counter {
    transition: transform 0.3s ease;
}

.cart-counter.updated {
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Улучшенные стили для поиска */
.search-form {
    position: relative;
}

.search-form input {
    padding-right: 40px;
}

.search-form button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* Улучшенные стили для мобильного меню */
.mobile-menu-toggle {
    transition: transform 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

/* Улучшенные стили для слайдера */
.swiper-button-next,
.swiper-button-prev {
    transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}



.filter-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.3s ease;
}

.filter-group label:hover {
    color: var(--primary-color);
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

/* Улучшенные стили для пагинации */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Улучшенные стили для хлебных крошек */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.breadcrumbs a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs .separator {
    color: #ccc;
}

.breadcrumbs .current {
    color: #333;
    font-weight: 500;
}

/* Улучшенные стили для рейтингов */
.rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating .star {
    color: #ffd700;
    font-size: 16px;
}

.rating .star.empty {
    color: #ddd;
}

/* Улучшенные стили для бейджей */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.badge.new {
    background: #27ae60;
    color: white;
}

.badge.sale {
    background: #e74c3c;
    color: white;
}

.badge.out-of-stock {
    background: #95a5a6;
    color: white;
}

/* Улучшенные стили для цен */
.price {
    font-weight: 600;
    color: var(--primary-color);
}

.price.old {
    text-decoration: line-through;
    color: #999;
    font-weight: normal;
    margin-right: 8px;
}

.price.discount {
    color: #e74c3c;
}

/* Улучшенные стили для кнопки "Назад" */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.back-button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    transform: translateX(-2px);
}

/* Улучшенные стили для загрузки */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Улучшенные стили для пустого состояния */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Улучшенные стили для сравнения товаров */
.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #ddd;
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.compare-bar.show {
    transform: translateY(0);
}

.compare-items {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    overflow-x: auto;
}

.compare-item {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
}

.compare-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 5px;
}

.compare-item .remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 5px;
}

.compare-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Улучшенные стили для избранного */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.favorite-btn:hover {
    background: white;
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #e74c3c;
}

.favorite-btn.active i {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Уведомление корзины */
.cart-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    max-width: 350px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid #27ae60;
}

.cart-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.cart-notification .notif-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
    animation: bellRing 0.5s ease;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

.cart-notification .notif-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-notification .notif-title {
    font-size: 13px;
    font-weight: 600;
    color: #27ae60;
}

.cart-notification .notif-text {
    font-size: 14px;
    color: #333;
    line-height: 1.3;
}

.cart-notification .notif-close {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.cart-notification .notif-close:hover {
    color: #333;
}

@media (max-width: 480px) {
    .cart-notification {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
}

/* Цвет в корзине */
.cart-item-color {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.cart-item-color .color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Модальное окно выбора предзаказа */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    max-width: 90%;
    width: 400px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

/* Модалка предзаказа */
.preorder-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.preorder-modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 90%;
    width: 380px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preorder-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f5f5f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.preorder-modal-close:hover {
    background: #ff14a6;
    color: #fff;
}

.preorder-modal-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ff14a6 0%, #ff8fd8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: #fff;
}

.preorder-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
}

.preorder-modal-product {
    font-size: 15px;
    color: #666;
    margin: 0 0 15px 0;
    font-weight: 500;
}

.preorder-modal-desc {
    font-size: 13px;
    color: #888;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.preorder-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preorder-btn-telegram,
.preorder-btn-site {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.preorder-btn-telegram {
    background: #0088cc;
    color: #fff;
}

.preorder-btn-telegram:hover {
    background: #006699;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 136, 204, 0.4);
}

.preorder-btn-site {
    background: #fff;
    color: #333;
    border: 2px solid #ddd;
}

.preorder-btn-site:hover {
    border-color: #ff14a6;
    color: #ff14a6;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 20, 166, 0.2);
}

@media (max-width: 480px) {
    .preorder-modal-content {
        padding: 30px 20px;
        width: 85%;
    }
    
    .preorder-modal-title {
        font-size: 20px;
    }
    
    .preorder-btn-telegram,
    .preorder-btn-site {
        padding: 16px;
        font-size: 14px;
    }
    
    .preorder-modal-close {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}

.modal-close-btn:hover {
    color: #333;
}

