/* favorites.css */

/* Страница избранного */
.favorites-page {
    padding: 20px 0;
}

.favorites-page h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.favorites-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.favorites-info .favorites-count {
    font-weight: bold;
    color: #ff4757;
}

.btn-clear-all {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-clear-all:hover {
    background: #c82333;
}

/* Сетка товаров */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.favorite-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.favorite-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.favorite-item-inner {
    padding: 15px;
}

.item-image {
    margin-bottom: 15px;
    text-align: center;
}

.item-image img {
    max-width: 100%;
    height: 200px;
    object-fit: contain;
}

.item-title {
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
}

.item-title a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
}

.item-title a:hover {
    color: #007bff;
}

.item-price {
    margin-bottom: 15px;
}

.item-price .price,
.item-price .new-price {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.item-price .old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

/* Кнопки действий */
.item-actions {
    display: flex;
    gap: 10px;
}

.btn-add-to-cart,
.btn-remove-favorite {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-add-to-cart {
    background: #28a745;
    color: white;
}

.btn-add-to-cart:hover {
    background: #218838;
}

.btn-remove-favorite {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

.btn-remove-favorite:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Пустое состояние */
.empty-favorites {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    margin-bottom: 20px;
}

.empty-icon svg {
    opacity: 0.5;
}

.empty-text {
    font-size: 20px;
    color: #666;
    margin-bottom: 10px;
}

.empty-subtext {
    font-size: 16px;
    color: #999;
    margin-bottom: 30px;
}

.btn-go-to-catalog {
    display: inline-block;
    background: #007bff;
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-go-to-catalog:hover {
    background: #0056b3;
    color: white;
}

.favorites-info p {
    padding: 0 !important;
}


/* Кнопка избранного в хедере */
#new-h-favorite {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 15px;
    text-decoration: none;
}

#new-h-favorite img {
    width: 24px;
    height: 24px;
    filter: invert(48%) sepia(13%) saturate(3207%) hue-rotate(315deg) brightness(95%) contrast(80%);
}

#new-h-f-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    line-height: 18px;
}

/* Мобильная версия кнопки избранного */
#mob-favorite {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 40px;
    background: url(/wp-content/themes/santek_theme/images/heart_n.png) no-repeat center;
    background-size: 20px;
}

#mob-favorite .fav-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    line-height: 18px;
}

/* Кнопка избранного в карточке товара */
#add-to-favorite-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: 2px solid #ff4757;
    color: #ff4757;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    margin-left: 10px;
}

#add-to-favorite-btn:hover {
    background: #ff4757;
    color: #fff;
}

#add-to-favorite-btn:hover span {
    color: #fff;
}

#add-to-favorite-btn.active {
    background: #ff4757;
    color: white !important;
}

#add-to-favorite-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

#add-to-favorite-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Адаптивность */
@media (max-width: 768px) {
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .item-actions {
        flex-direction: column;
    }
    
    .favorites-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    #add-to-favorite-btn {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
}

/* Уведомления */
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.custom-notification.success {
    background: #28a745;
}

.custom-notification.error {
    background: #dc3545;
}