/**
 * Favorites стили (избранное)
 * 
 * @package MedEquip_Aggregator
 */

/* ===== Favorite Button (на карточке) ===== */
.equipment-favorite-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.equipment-favorite-btn:hover {
    border-color: #dc3545;
    background: #fff5f5;
}

.equipment-favorite-btn svg {
    width: 20px;
    height: 20px;
    color: #6c757d;
    transition: all 0.2s;
}

.equipment-favorite-btn:hover svg {
    color: #dc3545;
}

/* Active State */
.equipment-favorite-btn.active {
    background: #dc3545;
    border-color: #dc3545;
}

.equipment-favorite-btn.active svg {
    color: #ffffff;
    fill: #ffffff;
}

.equipment-favorite-btn.active:hover {
    background: #c82333;
    border-color: #c82333;
}

/* Loading State */
.equipment-favorite-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.equipment-favorite-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== Equipment Card Integration ===== */
.equipment-card {
    position: relative;
}

.equipment-card .equipment-favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

/* ===== Favorites Page ===== */
.favorites-page {
    padding: 40px 0;
}

.favorites-header {
    margin-bottom: 30px;
}

.favorites-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.favorites-count-text {
    font-size: 16px;
    color: #6c757d;
}

.favorites-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-clear-favorites {
    padding: 10px 20px;
    background: #dc3545;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-clear-favorites:hover {
    background: #c82333;
}

.btn-export-favorites {
    padding: 10px 20px;
    background: #ffffff;
    color: #495057;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-export-favorites:hover {
    border-color: #12356a;
    color: #12356a;
}

/* Favorites Grid */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.favorites-empty {
    text-align: center;
    padding: 80px 20px;
}

.favorites-empty svg {
    width: 80px;
    height: 80px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.favorites-empty h2 {
    font-size: 24px;
    color: #495057;
    margin: 0 0 12px 0;
}

.favorites-empty p {
    font-size: 16px;
    color: #6c757d;
    margin: 0 0 24px 0;
}

.btn-browse-catalog {
    display: inline-block;
    padding: 12px 24px;
    background: #12356a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-browse-catalog:hover {
    background: #1d4ed8;
}

/* Loading State */
.favorites-loading {
    text-align: center;
    padding: 60px 20px;
}

.favorites-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top-color: #12356a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.favorites-loading p {
    color: #6c757d;
    font-size: 16px;
}

/* ===== Favorites in Single Equipment ===== */
.single-equipment .equipment-favorite-btn {
    width: 48px;
    height: 48px;
}

.single-equipment .equipment-favorite-btn svg {
    width: 24px;
    height: 24px;
}

/* With Text */
.equipment-favorite-btn.with-text {
    width: auto;
    padding: 10px 16px;
    border-radius: 8px;
}

.equipment-favorite-btn.with-text span {
    margin-left: 8px;
    font-size: 14px;
    font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .favorites-page {
        padding: 24px 0;
    }
    
    .favorites-header h1 {
        font-size: 24px;
    }
    
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .favorites-actions {
        flex-direction: column;
    }
    
    .btn-clear-favorites,
    .btn-export-favorites {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .favorites-grid {
        grid-template-columns: 1fr;
    }
    
    .favorites-empty {
        padding: 40px 20px;
    }
    
    .favorites-empty svg {
        width: 60px;
        height: 60px;
    }
    
    .favorites-empty h2 {
        font-size: 20px;
    }
    
    .favorites-empty p {
        font-size: 14px;
    }
}

/* ===== Animation Helpers ===== */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

