@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Poppins:wght@300;400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: "Playfair Display", serif;
}

/* Efecto de nieve */
.snowflake {
  position: fixed;
  top: -10px;
  z-index: 9999;
  user-select: none;
  cursor: default;
  animation: snowfall linear infinite;
  color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
}

@keyframes snowfall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
  }
}

/* Luces navideñas */
.christmas-lights {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  display: flex;
  justify-content: space-around;
  z-index: 9999;
  pointer-events: none;
}

.light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

.light:nth-child(1) {
  background: #ff4757;
  animation-delay: 0s;
}
.light:nth-child(2) {
  background: #26de81;
  animation-delay: 0.3s;
}
.light:nth-child(3) {
  background: #feca57;
  animation-delay: 0.6s;
}
.light:nth-child(4) {
  background: #ff6348;
  animation-delay: 0.9s;
}
.light:nth-child(5) {
  background: #48dbfb;
  animation-delay: 1.2s;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 10px currentColor;
  }
  50% {
    opacity: 0.3;
  }
}

/* Gradientes festivos */
.bg-festive-gradient {
  background: linear-gradient(135deg, #8b0000 0%, #dc143c 50%, #b22222 100%);
}

.bg-gold-gradient {
  background: linear-gradient(135deg, #d4af37 0%, #ffd700 50%, #ffa500 100%);
}

/* Animaciones suaves */
.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Focus states para accesibilidad */
a:focus,
button:focus {
  outline: 3px solid #ffd700;
  outline-offset: 2px;
}

/* Efecto estrella */
.star-decoration {
  animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Responsive navbar */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.active {
  max-height: 500px;
}

/* Navbar Mejorado - Desktop Responsive */
.navbar-main {
  backdrop-filter: blur(10px);
}

.nav-link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.3s ease;
}

@media (min-width: 1280px) {
  .nav-link {
    font-size: 0.95rem;
  }
}

@media (min-width: 1536px) {
  .nav-link {
    font-size: 1rem;
  }
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #dc2626, #16a34a);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 80%;
}

.cart-badge {
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Hamburger Icon Animation */
.hamburger-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 100;
  transition: transform 0.3s ease;
}

.hamburger-btn:hover {
  transform: scale(1.1);
}

.hamburger-icon {
  width: 28px;
  height: 20px;
  position: relative;
  transform: rotate(0deg);
  transition: 0.5s ease-in-out;
  cursor: pointer;
}

.hamburger-icon span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: #374151;
  border-radius: 9px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
}

.hamburger-icon span:nth-child(1) {
  top: 0px;
}

.hamburger-icon span:nth-child(2) {
  top: 8px;
}

.hamburger-icon span:nth-child(3) {
  top: 16px;
}

/* Hamburger Active State */
.hamburger-btn.active .hamburger-icon span:nth-child(1) {
  top: 8px;
  transform: rotate(135deg);
  background: #dc2626;
}

.hamburger-btn.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.hamburger-btn.active .hamburger-icon span:nth-child(3) {
  top: 8px;
  transform: rotate(-135deg);
  background: #dc2626;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 998;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Menu Sidebar */
.mobile-menu-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mobile-menu-sidebar.active {
  right: 0;
}

/* Mobile Menu Header */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-bottom: 2px solid #fca5a5;
  position: sticky;
  top: 0;
  z-index: 10;
}

.close-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  color: #dc2626;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.close-btn:hover {
  background: #dc2626;
  color: white;
  transform: rotate(90deg);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Mobile Menu Content */
.mobile-menu-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  overflow-y: auto;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  background: white;
  border: 2px solid #f3f4f6;
  border-radius: 12px;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mobile-nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.1), transparent);
  transition: left 0.5s ease;
}

.mobile-nav-item:hover::before {
  left: 100%;
}

.mobile-nav-item:hover {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #dc2626;
  color: #dc2626;
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.mobile-nav-item:active {
  transform: translateX(8px) scale(0.98);
}

.mobile-nav-item i:first-child {
  font-size: 1.25rem;
  margin-right: 1rem;
  width: 24px;
  text-align: center;
}

.mobile-nav-item span {
  flex: 1;
  font-size: 1rem;
}

.mobile-nav-item i:last-child {
  font-size: 0.875rem;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.mobile-nav-item:hover i:last-child {
  opacity: 1;
  transform: translateX(4px);
}

/* Mobile Menu Footer */
.mobile-menu-footer {
  padding: 1.5rem 0 0.5rem;
  border-top: 2px solid #f3f4f6;
}

.social-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.social-icon:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  transform: translateY(-4px) rotate(5deg);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
  border-color: #fca5a5;
}

/* Animación de entrada para items del menú */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mobile-menu-sidebar.active .mobile-nav-item {
  animation: slideInRight 0.4s ease forwards;
}

.mobile-menu-sidebar.active .mobile-nav-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-sidebar.active .mobile-nav-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-sidebar.active .mobile-nav-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-sidebar.active .mobile-nav-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-sidebar.active .mobile-nav-item:nth-child(5) { animation-delay: 0.3s; }

/* Responsive adjustments */
@media (min-width: 640px) {
  .mobile-menu-sidebar {
    width: 70%;
    max-width: 380px;
  }
}

/* Navbar responsive breakpoints */
@media (min-width: 1024px) and (max-width: 1279px) {
  /* Ajustes para pantallas medianas (laptops pequeñas) */
  .navbar-main .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .nav-link {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-size: 0.85rem;
  }
  
  .nav-link i {
    font-size: 0.875rem;
  }
}

@media (min-width: 1280px) and (max-width: 1535px) {
  /* Ajustes para pantallas grandes */
  .nav-link {
    font-size: 0.9rem;
  }
}

@media (min-width: 1024px) {
  .nav-link {
    font-size: 0.875rem;
  }
}

@media (min-width: 1280px) {
  .nav-link {
    font-size: 0.95rem;
  }
}

@media (min-width: 1536px) {
  .nav-link {
    font-size: 1rem;
  }
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* Active nav link state */
.nav-link.active-link {
  color: #dc2626;
  background: #fee2e2;
}

.nav-link.active-link::after {
  width: 80%;
}

.mobile-nav-item.active-link {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #dc2626;
  color: #dc2626;
}

.mobile-nav-item.active-link::before {
  background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.2), transparent);
}

/* Mejoras para tablets */
@media (min-width: 768px) and (max-width: 1023px) {
  .navbar-main .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Ajustes adicionales para evitar overflow */
@media (min-width: 1024px) {
  .navbar-main {
    overflow-x: hidden;
  }
  
  .navbar-main .container {
    max-width: 100%;
  }
}

/* Optimización para pantallas de 1366px (común en laptops) */
@media (min-width: 1024px) and (max-width: 1366px) {
  .nav-link i {
    margin-right: 0.375rem;
  }
  
  .navbar-main .gap-2 {
    gap: 0.25rem;
  }
}

/* Ocultar iconos en resoluciones muy ajustadas */
@media (min-width: 1024px) and (max-width: 1150px) {
  .nav-link i {
    display: none;
  }
  
  .nav-link {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Ribbon festivo */
.ribbon {
  position: absolute;
  top: 15px;
  right: -5px;
  background: #dc143c;
  color: white;
  padding: 5px 15px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.ribbon::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  border-left: 5px solid transparent;
  border-right: 5px solid #8b0000;
  border-bottom: 8px solid transparent;
}

/* ===== Botón Volver Arriba ===== */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 9998;
  outline: none;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  box-shadow: 0 6px 30px rgba(220, 38, 38, 0.6);
  transform: translateY(-4px) scale(1.05);
}

.scroll-to-top:active {
  transform: translateY(-2px) scale(1);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
}

/* Animación del icono */
.scroll-to-top i {
  animation: bounce-arrow 2s infinite;
}

@keyframes bounce-arrow {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

.scroll-to-top:hover i {
  animation: none;
  transform: translateY(-2px);
}

/* Efecto de ripple al hacer clic */
.scroll-to-top::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.scroll-to-top:active::before {
  width: 100px;
  height: 100px;
  opacity: 0;
}

/* Decoración navideña del botón */
.scroll-to-top::after {
  content: '✨';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 1rem;
  animation: twinkle-star 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes twinkle-star {
  0%, 100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8) rotate(180deg);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .scroll-to-top {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
    font-size: 1.25rem;
  }

  .scroll-to-top::after {
    font-size: 0.875rem;
    top: -6px;
    right: -6px;
  }
}

@media (max-width: 480px) {
  .scroll-to-top {
    width: 46px;
    height: 46px;
    bottom: 16px;
    right: 16px;
    font-size: 1.125rem;
  }

  .scroll-to-top::after {
    display: none; /* Ocultar estrella en móviles muy pequeños */
  }
}

/* Cuando el menú móvil está abierto, ajustar z-index */
body.menu-open .scroll-to-top {
  z-index: 997; /* Debajo del menú móvil */
}

/* Modo de alto contraste para accesibilidad */
@media (prefers-contrast: high) {
  .scroll-to-top {
    border: 2px solid white;
  }
}

/* Reducir animaciones para usuarios con preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .scroll-to-top {
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .scroll-to-top i,
  .scroll-to-top::after {
    animation: none;
  }

  .scroll-to-top:hover {
    transform: none;
  }
}
