/* Grid de favoritos */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

/* Responsividade da grid */
@media (max-width: 1200px) {
    .favorites-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .favorites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .favorites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .favorites-grid {
        grid-template-columns: 1fr;
    }
}

/* Item individual da grid */
.favorite-item {
    position: relative;
    height: 100%;           /* reforça que o link preencha o .mu-item */
    align-items: center;
  justify-content: center;
  padding: 10px;
  text-decoration: none;
  font-family: 'Darker Grotesque' !important;
  font-size: 18px !important;
  font-weight: 500;
  color: #333;
  border: 2px solid #5ed6a3;
  border-radius: 4px;
  transition: background .2s;
}

.favorite-item:hover {
     background: #5ed6a3;
    color: #000;
}

.favorite-item a {
    text-decoration: none;
    color: #000;
    font-weight: 500;
    display: block;
    padding-right: 20px;
}

.favorite-item a:hover {
    color: #000;
}

/* Botão de remover (×) na grid */
.remove-favorite {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-favorite:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.remove-favorite.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Botão principal de favoritos */
.fav-button {
    background-color: #71bfa9;
    color: #fff;
    border: none;
    padding: 0.5em 1em;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.fav-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.fav-button.is-favorite {
    background-color: #ff6b6b;
}

.fav-button.is-favorite:hover {
    background-color: #ff5252;
}

.fav-button.loading {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.fav-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Animação de loading */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mensagem de login */
.login-message {
    text-align: center;
    padding: 1rem;
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    margin: 1rem 0;
}

.login-message a {
    color: #71bfa9;
    text-decoration: none;
    font-weight: 600;
}

.login-message a:hover {
    text-decoration: underline;
}

/* Estados especiais */
.favorite-item {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Quando não há favoritos */
.favorites-grid p {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Acessibilidade */
.fav-button:focus,
.remove-favorite:focus {
    outline: 2px solid #71bfa9;
    outline-offset: 2px;
}

/* Melhorias visuais extras */
.favorite-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #71bfa9, #5aa394);
    border-radius: 4px 4px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.favorite-item:hover::before {
    opacity: 1;
}