/* Strona Ulubione - style zharmonizowane z template-product-grid.php */
.favorites-page-container {
    max-width: 1440px; /* Zwiększono z 1300px na 1440px, żeby pasowało do product-grid */
    margin: 0 auto;
    padding: 0 15px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-family: 'Libre Baskerville', serif;
    color: #333;
    margin-bottom: 15px;
}

.separator {
    width: 100px;
    height: 2px;
    background-color: #759ecb;
    margin: 0 auto 30px;
}

/* Loader */
.favorites-loader {
    text-align: center;
    padding: 50px 0;
}

.favorites-loader i {
    color: #759ecb;
    margin-bottom: 15px;
}

/* Pusta lista ulubionych */
.favorites-empty {
    text-align: center;
    padding: 50px 0;
}

.favorites-empty p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #666;
}

.favorites-empty .w-btn {
    display: inline-block;
    background-color: #759ecb;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.favorites-empty .w-btn:hover {
    background-color: #6389b6;
}

/* Siatka produktów - dopasowana do product-grid */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)); /* 5 kolumn jak w product-grid */
    gap: 30px;
    margin: 0 auto 40px;
    max-width: 1440px;
    width: 100%;
}

/* Pojedynczy produkt */
.favorite-product {
    text-align: left;
    background: transparent;
    border: none;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: none;
    margin-bottom: 15px;
}

/* Wymuszenie proporcji 4:5 - dwoma metodami dla pewności */
.product-image-container,
.favorite-product .product-image-container,
#favorites-grid .product-image-container,
[class*="woocommerce"] .product-image-container {
    position: relative !important;
    overflow: hidden !important;
    margin-bottom: 15px !important;
    aspect-ratio: 4 / 5 !important; /* Zmieniono z 1/1 na 4/5 */
    padding-top: 125% !important; /* 4:5 = 0.8, 1/0.8 = 1.25, 1.25 * 100% = 125% */
    height: 0 !important; /* Ważne dla techniki padding-top */
    background-color: transparent !important;
    width: 100% !important;
}

.product-image-container img,
.favorite-product .product-image-container img,
#favorites-grid .product-image-container img,
[class*="woocommerce"] .product-image-container img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    transition: transform 0.3s ease;
}

.product-image-container:hover img {
    transform: scale(1.05);
}

.favorite-product-name {
    font-size: 13px !important; /* Zmniejszono z 14px na 13px jak w product-grid */
    font-weight: 600;
    color: #333;
    margin: 0 0 5px !important; /* Zmniejszono z 7px na 5px jak w product-grid */
    line-height: 1.3;
    min-height: 30px !important; /* Zmniejszono z 36px na 30px jak w product-grid */
}

.favorite-product-name a {
    color: #333;
    text-decoration: none;
}

.favorite-product-name a:hover {
    color: #759ecb;
}

.favorite-product-price {
    font-size: 14px !important; /* Zmniejszono z 16px na 14px jak w product-grid */
    color: #000;
    font-weight: 700;
    margin: 0 !important;
}

/* Przyciski */
.add-to-favorites,
.add-to-cart-button {
    position: absolute !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important; /* Zmniejszono z 36px na 32px jak w product-grid */
    height: 32px !important; /* Zmniejszono z 36px na 32px jak w product-grid */
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    padding: 0 !important;
}

.add-to-favorites {
    top: 10px !important;
    right: 10px !important;
    background-color: #759ecb !important; /* Zmieniono z #ff6b6b na #759ecb */
    border-color: #759ecb !important; /* Zmieniono z #ff6b6b na #759ecb */
}

.add-to-cart-button {
    bottom: 10px !important;
    left: 10px !important;
}

.add-to-favorites:hover,
.add-to-cart-button:hover {
    background: white !important;
    transform: scale(1.1) !important;
}

.favorite-icon,
.cart-icon {
    color: #fff !important; /* Zmieniono z #444 na #fff dla lepszego kontrastu na niebieskim tle */
    transition: all 0.2s ease !important;
    font-size: 14px !important; /* Zmniejszono z 16px na 14px jak w product-grid */
}

.add-to-favorites.active {
    background-color: #759ecb !important; /* Zmieniono z #ff6b6b na #759ecb */
    border-color: #759ecb !important; /* Zmieniono z #ff6b6b na #759ecb */
}

.add-to-favorites.active .favorite-icon {
    color: #fff !important;
}

.add-to-cart-button.added {
    background-color: #4CAF50 !important;
    border-color: #4CAF50 !important;
}

.add-to-cart-button.added .cart-icon {
    color: #fff !important;
}

/* Animacja */
@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.button-animate {
    animation: buttonPulse 0.3s ease;
}

/* Responsywność - dopasowana dokładnie do product-grid */
@media (min-width: 1400px) {
    .favorites-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important; /* Maksymalnie 5 kolumn */
    }
}

@media (max-width: 1200px) {
    .favorites-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .favorites-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 15px;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .favorites-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 15px;
    }
    
    .favorite-product-name {
        min-height: auto !important;
    }
}

@media (max-width: 480px) {
    .favorites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }
}

@media (max-width: 360px) {
    .favorites-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
        gap: 15px;
    }
}