/* Focus state for accessibility */
.ef-favorite-button:focus {
    outline: 2px solid #007acc;
}

/* Container alignment helpers (from Elementor prefix_class) */
.ef-favorite-button-align-left .ef-favorite-button-container {
    display: flex;
    justify-content: flex-start;
}
.ef-favorite-button-align-center .ef-favorite-button-container {
    display: flex;
    justify-content: center;
}
.ef-favorite-button-align-right .ef-favorite-button-container {
    display: flex;
    justify-content: flex-end;
}
.ef-favorite-button-align-stretch .ef-favorite-button-container {
    display: flex;
    justify-content: stretch;
    width: 100%;
}

.ef-favorite-button-container {
    display: inline-flex;
}

/* -------------------------------------------------------
    FAVORITE BUTTON CORE
------------------------------------------------------- */

.ef-favorite-button {
    display: inline-flex;
    align-items: center;
    gap: 3px; /* icon + counter arası boşluk */
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
}

/* Icon wrapper */
.ef-favorite-icon {
    display: inline-flex;
    align-items: center;
}

/* Favorite button içindeki tüm elemanlarda transition kapalı */
.ef-favorite-button,
.ef-favorite-button * {
    transition: none !important;
}

/* -------------------------------------------------------
   ICON VISIBLE STATE – KESİN ÇÖZÜM
   Hem eski yapıyı (.favorited / .unfavorited),
   hem yeni yapıyı (.ef-icon-favorite / .ef-icon-unfavorite)
   kapsayan güvenlik katmanı.
------------------------------------------------------- */

/* 1) Varsayılan durumda her şeyi gizle, sonra tek tek aç */
.ef-favorite-icon .favorited,
.ef-favorite-icon.favorited,
.ef-favorite-icon .ef-icon-favorite,
.ef-favorite-icon .ef-icon-unfavorite {
    display: none;
}

/* 2) Default state → sadece "unfavorited" ikon görünsün */
.ef-favorite-icon .unfavorited,
.ef-favorite-icon.unfavorited,
.ef-favorite-icon .ef-icon-unfavorite {
    display: inline-flex;
}

/* 3) Favorited state → sadece "favorited" ikon görünsün */
.ef-favorite-button.is-favorited .ef-favorite-icon .favorited,
.ef-favorite-button.is-favorited .ef-favorite-icon.favorited,
.ef-favorite-button.is-favorited .ef-favorite-icon .ef-icon-favorite {
    display: inline-flex;
}

.ef-favorite-button.is-favorited .ef-favorite-icon .unfavorited,
.ef-favorite-button.is-favorited .ef-favorite-icon.unfavorited,
.ef-favorite-button.is-favorited .ef-favorite-icon .ef-icon-unfavorite {
    display: none;
}

/* Counter */
.ef-favorite-count {
    color: #333333;
    margin: 0 !important; /* eski marginleri temizle */
    padding: 0;
}

/* Loading State */
.ef-favorite-button.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Loading Animation (bunu bırakıyoruz, sadece yüklemede döner) */
.ef-favorite-button.loading .ef-favorite-icon {
    animation: ef-spin 1s linear infinite;
}

@keyframes ef-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* -------------------------------------------------------
    MESSAGE BOX
------------------------------------------------------- */

.ef-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #32373c;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 9999;
    opacity: 0;
    animation: ef-fade-in-out 4s forwards;
    font-size: 14px;
}

@keyframes ef-fade-in-out {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* -------------------------------------------------------
    FAVORITES LINK WIDGET (HEADER)
------------------------------------------------------- */

.ef-favorites-link-widget {
    position: relative;
    display: inline-block;
}

.ef-favorites-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.ef-favorites-link-icon {
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Bubble style counter */
.ef-favorites-counter {
    position: absolute;
    top: -3px;
    right: -2px;
    background-color: #e25555;
    color: #ffffff;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {

    .ef-favorites-counter {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        padding: 0 3px;
    }

    .ef-favorite-count {
        font-size: 0.85em;
    }
}
