/* ============================
   FAVORITES — Barra e Modal
   ============================ */

/* BARRA FIXA BOTTOM */
.ji-favorites-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--ji-dark);
    color: var(--ji-white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform var(--ji-transition);
}

.ji-favorites-bar.ji-is-visible {
    transform: translateY(0);
}

.ji-favorites-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ji-favorites-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.ji-favorites-info strong {
    color: var(--ji-brand);
    font-size: 18px;
}

.ji-favorites-actions {
    display: flex;
    gap: 10px;
}

/* BOTÕES FAVORITOS */
.ji-btn--fav-list {
    background: rgba(255, 255, 255, 0.15);
    color: var(--ji-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    font-size: 13px;
}

.ji-btn--fav-list:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ji-btn--whatsapp {
    background: #25D366;
    color: var(--ji-white);
    padding: 8px 16px;
    font-size: 13px;
}

.ji-btn--whatsapp:hover {
    background: #1da851;
}

/* MODAL FAVORITOS */
.ji-favorites-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.ji-favorites-modal[hidden] {
    display: none !important;
}

.ji-favorites-modal-content {
    background: #ffffff !important;
    color: #1a1a2e !important;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.ji-favorites-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ji-gray-100);
}

.ji-favorites-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e !important;
}

.ji-modal-close {
    background: #f4f4f7 !important;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #4a4a5a !important;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.ji-modal-close:hover {
    background: var(--ji-gray-100);
}

/* LISTA DE FAVORITOS */
.ji-favorites-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.ji-fav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ji-gray-100);
}

.ji-fav-item:last-child {
    border-bottom: none;
}

.ji-fav-item-info {
    flex: 1;
}

.ji-fav-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e !important;
}

.ji-fav-item-title a {
    color: #1a1a2e !important;
    text-decoration: none;
}

.ji-fav-item-title a:hover {
    color: var(--ji-brand-dark);
}

.ji-fav-item-meta {
    font-size: 12px;
    color: var(--ji-gray-500);
    margin-top: 2px;
}

.ji-fav-item-price {
    font-size: 15px;
    font-weight: 700;
    color: #b8a76e !important;
    white-space: nowrap;
}

.ji-fav-item-remove {
    background: none;
    border: none;
    color: #7a7a8a !important;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: color 0.3s;
}

.ji-fav-item-remove:hover {
    color: var(--ji-danger);
}

/* FOOTER MODAL */
.ji-favorites-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--ji-gray-100);
}

.ji-btn--clear-favs {
    background: transparent !important;
    border: 1px solid #D6C899 !important;
    color: #b8a76e !important;
    flex: 1;
}

.ji-btn--clear-favs:hover {
    background: #D6C899 !important;
    color: #1a1a2e !important;
}

.ji-favorites-modal-footer .ji-btn--whatsapp {
    flex: 1;
}

/* ANIMAÇÃO DO CORAÇÃO */
@keyframes ji-heart-pulse {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.ji-fav-btn.pulse {
    animation: ji-heart-pulse 0.5s ease;
}

/* ============================
   GALERIA NO CARD
   ============================ */

.ji-gallery {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--ji-gray-100);
}

.ji-gallery--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ji-gallery-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform var(--ji-transition);
}

.ji-gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.ji-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* DOTS (clicáveis) */
.ji-gallery-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 5;
}

.ji-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all var(--ji-transition);
    cursor: pointer;
}

.ji-dot.active {
    background: var(--ji-brand, #D6C899);
    width: 18px;
    border-radius: 4px;
}

.ji-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.8);
}

.ji-dot-more {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 8px;
}

/* COUNTER */
.ji-gallery-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 5;
}

/* DRAG STATE */
.ji-gallery-track {
    -webkit-user-select: none;
    user-select: none;
}

/* MOBILE */
@media (max-width: 768px) {

    .ji-favorites-content {
        flex-direction: column;
        padding: 12px 16px;
        gap: 10px;
    }

    .ji-favorites-actions {
        width: 100%;
    }

    .ji-favorites-actions .ji-btn {
        flex: 1;
    }

    .ji-favorites-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .ji-favorites-modal-footer {
        flex-direction: column;
    }
}