/* /styles/main.css (VERSÃO COMPLETA E CORRIGIDA) */

@keyframes fade-in {
    from { background-color: rgba(0, 0, 0, 0); }
    to { background-color: rgba(0, 0, 0, 0.8); }
}

@keyframes fade-out {
    from { background-color: rgba(0, 0, 0, 0.8); }
    to { background-color: rgba(0, 0, 0, 0); }
}

@keyframes slide-in {
    from { transform: translateX(500px); }
    to { transform: translateX(0px); }
}

@keyframes slide-out {
    from { transform: translateX(0px); }
    to { transform: translateX(500px); }
}

#cart-drawer[data-state="open"] { animation: fade-in 0.4s forwards; }
#cart-drawer[data-state="closed"] { animation: fade-out 0.4s forwards; }
#cart-drawer[data-state="open"] > div { animation: slide-in 0.4s forwards; }
#cart-drawer[data-state="closed"] > div { animation: slide-out 0.4s forwards; }

.dialog[data-state="open"] { animation: fade-in 0.4s forwards; }
.dialog[data-state="closed"] { animation: fade-out 0.4s forwards; }
.dialog[data-state="open"] > div { animation: dialog-in 0.2s forwards; }
.dialog[data-state="closed"] > div { animation: dialog-out 0.2s forwards; }

@keyframes dialog-in {
    from { opacity: 0; scale: 50%; }
    to { opacity: 1; scale: 100%; }
}

@keyframes dialog-out {
    from { opacity: 1; scale: 100%; }
    to { opacity: 0; scale: 50%; }
}

#category-section,
#category #products-list {
    scroll-margin-top: 100px;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    opacity: 0;
    transform: translateY(20px);
}

#category-section.visible,
#category #products-list.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes loading {
    0% { left: -50%; }
    to { left: 100%; }
}

/* --- ESTILOS DO POPUP DE VENDAS --- */
@keyframes sales-popup-gradient {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.apx-purchase-popup {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    font-family: 'Poppins', sans-serif;
    color: rgb(var(--foreground));
    background: linear-gradient(135deg, rgba(var(--primary), 0.2), rgba(var(--primary), 0.1));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--primary), 0.3);
    border-radius: var(--radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(-120%);
    pointer-events: none;
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.apx-purchase-popup.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.apx-purchase-popup::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(90deg, transparent, rgb(var(--primary)), transparent);
    background-size: 200% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: sales-popup-gradient 3s linear infinite;
}

.apx-purchase-popup .popup-icon i { font-size: 1.8rem; color: rgb(var(--primary)); }
.apx-purchase-popup .popup-text p { margin: 0; font-size: 0.85rem; line-height: 1.4; color: rgb(var(--muted-foreground)); }
.apx-purchase-popup .popup-text .popup-name,
.apx-purchase-popup .popup-text .popup-product { font-weight: 600; color: rgb(var(--foreground)); }

@media (max-width: 768px) {
    .apx-purchase-popup { max-width: calc(100vw - 40px); bottom: 20px; left: 20px; }
}

/* --- ESTILOS DO CARROSSEL PRINCIPAL --- */
.main-carousel {
    width: 100%;
    height: 500px;
    border-radius: var(--radius);
    overflow: hidden;
}

.swiper-slide .slide-content {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.swiper-slide .slide-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 50%);
    padding: 40px;
    color: white;
    width: 100%;
}

.animated-button {
    background-color: rgb(var(--primary));
    color: rgb(var(--primary-foreground));
    padding: 10px 25px;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.3s ease;
    transform: scale(1);
    display: inline-block;
    margin-top: 1rem;
}

.animated-button:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    box-shadow: 0 4px 20px rgba(var(--primary), 0.4);
}

.swiper-button-next, .swiper-button-prev { color: rgb(var(--primary)); }
.swiper-pagination-bullet-active { background: rgb(var(--primary)); }

/* --- FUNDO ANIMADO --- */
@keyframes animated-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        -45deg,
        rgb(var(--background)),
        rgba(var(--primary), 0.15),
        rgb(var(--background)),
        rgb(var(--background))
    );
    background-size: 400% 400%;
    animation: animated-gradient 20s ease infinite;
    z-index: -20;
}

/* --- EFEITO DE BRILHO NO TEXTO DO CARROSSEL --- */
@keyframes text-glow {
    0%, 100% { text-shadow: 0 0 5px rgba(255, 255, 255, 0.4), 0 0 10px rgba(var(--primary), 0.3); }
    50% { text-shadow: 0 0 10px rgba(255, 255, 255, 0.6), 0 0 20px rgba(var(--primary), 0.5); }
}

.slide-overlay h2,
.slide-overlay p {
    animation: text-glow 4s ease-in-out infinite;
}

.group > div {
  position: relative;
  overflow: hidden;
}

.group > div::before {
  content: '';
  position: absolute;
  top: -20%;
  width: 80px;
  height: 130%;
  background-color: rgba(255, 255, 255, 0.089);
  rotate: 20deg;
  filter: blur(10px);
  z-index: 20;
  animation: effects 3s ease infinite;
}

@keyframes effects {
  from {
    left: -50%;
  }
  to {
    left: 160%;
  }
}

.animated-button {
  position: relative;
  z-index: 1;
}

.animated-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  border-radius: 50%;
  animation: pulse 2s infinite;
  z-index: -1;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}
