@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* =========================
   ESTILOS GENERALES
   ========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body { width: 100%; overflow-x: hidden; }

body {
  font-family: 'Roboto', sans-serif;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
  background-color: #f8f9fa;
}

img, video { max-width: 100%; height: auto; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================
   HEADER STYLES
   ========================= */
.header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 9999;
  font-family: 'Roboto', sans-serif;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-container {
  background: linear-gradient(135deg, #1E1E2F, #6A0572, #F74436);
  background-size: 300% 100%;
  animation: gradientMove 15s ease infinite;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: visible;
}

.header-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shine 6s infinite;
  filter: blur(5px);
  pointer-events: none;
}

.header.floating {
  background: rgba(30, 30, 47, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Logo */
.logo {
  flex: 0 0 auto;
  margin-right: 2rem;
  position: relative;
  perspective: 1000px;
}

.logo img {
  height: 45px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.logo:hover img {
  transform: rotateY(360deg) scale(1.1);
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
}

/* =========================
   NAVIGATION (DESKTOP)
   ========================= */
.nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu-main {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-menu-auth {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-left: auto; /* empuja login + carrito a la derecha */
}

.nav-link {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.7rem 1.2rem;
  border-radius: 30px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.nav-link i { transition: transform 0.3s ease; }

.nav-link:hover i { transform: scale(1.2) translateY(-2px); }

.nav-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: -1;
}

.nav-link:hover::before {
  width: 300px;
  height: 300px;
}

/* =========================
   CART (DESKTOP)
   ========================= */
.cart-link {
  position: relative;
  margin-left: 0.75rem;
  padding: 0.7rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.cart-link i { transition: transform 0.3s ease; }

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #F74436;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  animation: cartBounce 2s infinite;
  box-shadow: 0 2px 8px rgba(247, 68, 54, 0.5);
}

/* =========================
   MOBILE MENU BUTTON
   ========================= */
.mobile-menu-btn {
  display: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: 1rem;
  z-index: 4500; /* arriba de todo */
}

.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 2px;
  background: white;
  margin: 5px 0;
  transition: all 0.4s ease;
  border-radius: 2px;
}

/* =========================
   WORKSHOPS SECTION
   ========================= */
.workshops {
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  margin-top: 60px;
}

.workshops::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  z-index: 0;
  background: radial-gradient(ellipse at center,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0) 35%,
    rgba(106,5,114,0.05) 100%);
  animation: rotate 60s linear infinite;
}

.workshops .container {
  position: relative;
  z-index: 2;
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.workshops h2 {
  font-size: 3rem;
  color: #1E1E2F;
  margin-bottom: 20px;
  position: relative;
  text-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transform: perspective(500px) translateZ(0px);
  transition: all 0.5s ease;
  opacity: 0;
  animation: fadeUp 1s forwards 0.3s;
}

.workshops h2:hover {
  transform: perspective(500px) translateZ(30px);
}

.divider {
  height: 4px;
  width: 80px;
  background: linear-gradient(90deg, #6A0572, #F74436);
  margin: 20px auto;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: scaleX(0);
  animation: growWidth 1.2s forwards 0.7s;
}

.divider::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
  animation: shimmer 3s infinite;
}

.workshops-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  margin-top: 60px;
  perspective: 1000px;
  position: relative;
}

.workshop-item {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 18px 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  font-weight: 500;
  color: #1E1E2F;
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
  flex: 0 1 auto;
  min-width: 300px;
  transform-style: preserve-3d;
  transform: translateZ(0) rotateX(0) rotateY(0);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  animation-fill-mode: forwards;
}

.workshop-item:nth-child(1) { animation: fadeUp 0.8s forwards 0.6s; }
.workshop-item:nth-child(2) { animation: fadeUp 0.8s forwards 0.8s; }
.workshop-item:nth-child(3) { animation: fadeUp 0.8s forwards 1s; }
.workshop-item:nth-child(4) { animation: fadeUp 0.8s forwards 1.2s; }
.workshop-item:nth-child(5) { animation: fadeUp 0.8s forwards 1.4s; }
.workshop-item:nth-child(6) { animation: fadeUp 0.8s forwards 1.6s; }

.workshop-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #6A0572, #F74436);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
  border-radius: 20px;
}

.workshop-item::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
  opacity: 0;
  transform: scale(0.5);
  transition: transform 0.6s ease, opacity 0.6s ease;
  pointer-events: none;
}

.workshop-item:hover {
  transform: translateY(-15px) scale(1.05);
  box-shadow: 0 20px 40px rgba(106, 5, 114, 0.2);
  color: white;
  border-color: transparent;
  z-index: 10;
}

.workshop-item:hover::before { opacity: 1; }

.workshop-item:hover::after {
  opacity: 0.3;
  transform: scale(1);
  animation: pulse 2s infinite;
}

.workshop-item i {
  margin-right: 12px;
  transition: all 0.5s ease;
  display: inline-block;
  font-size: 1.2rem;
  position: relative;
  z-index: 2;
}

.workshop-item:hover i {
  transform: rotate(360deg) scale(1.3);
  color: white;
}

.workshop-item span {
  position: relative;
  z-index: 2;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Partículas flotantes */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: linear-gradient(to right, #6A0572, #F74436);
  border-radius: 50%;
  opacity: 0.3;
  animation: float 15s infinite linear;
}

/* =========================
   DROPDOWN NAVBAR (DESKTOP)
   ========================= */
.nav-item.has-dropdown { position: relative; }

.nav-item.has-dropdown .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dropdown-caret {
  font-size: .85em;
  opacity: .9;
  transition: transform .2s ease;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 290px;
  padding: 14px;
  margin: 0;
  list-style: none;

  background: linear-gradient(145deg, rgba(106, 5, 114, 0.95), rgba(30, 30, 47, 0.92));
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 18px;

  box-shadow:
    0 20px 50px rgba(106, 5, 114, 0.4),
    0 0 25px rgba(240, 142, 3, 0.15);

  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all .25s ease;
  z-index: 9999;
  backdrop-filter: blur(18px);
}

.dropdown-menu::before {
  content:"";
  position:absolute;
  top:-8px;
  left: 28px;
  width:14px;
  height:14px;
  background: rgba(30, 30, 47, 0.92);
  border-left: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.14);
  transform: rotate(45deg);
}

.nav-item.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-item.has-dropdown:hover .dropdown-caret { transform: rotate(180deg); }

.dropdown-link {
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 12px;
  color:#fff;
  text-decoration:none;
  font-weight: 600;
  transition: background .2s ease, transform .2s ease;
}

.dropdown-link i {
  width: 18px;
  text-align:center;
  color:#F08E03;
}

.dropdown-link:hover {
  background: linear-gradient(135deg, rgba(240, 142, 3, 0.35), rgba(247, 68, 54, 0.25));
  box-shadow: 0 6px 20px rgba(240, 142, 3, 0.3);
  transform: translateX(4px);
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1200px) {
  .workshop-item { min-width: calc(33.333% - 25px); }
}

@media (max-width: 992px) {
  .workshop-item { min-width: calc(50% - 25px); }
  .workshops h2 { font-size: 2.5rem; }

  /* Mostrar botón hamburguesa */
  .mobile-menu-btn { display: block; }

  /* Botón hamburguesa arriba-derecha */
  .mobile-menu-btn{
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 99999;
  }

  /* Carrito arriba-derecha (antes del botón) */
  .cart-link{
    position: fixed !important;
    top: 14px;
    right: 66px;
    z-index: 99998;
    margin-left: 0 !important;
  }

  /* deja espacio en header para no chocar con iconos */
  .header-container{
    padding-right: 4.8rem;
  }

  /* PANEL OVERLAY DEL MENÚ */
  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 100vh;

    padding-top: 90px;
    background: linear-gradient(135deg, #1E1E2F 0%, #6A0572 100%);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-y: auto;

    z-index: 9000;
    transform: translateX(100%);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
  }

  .nav-menu.active {
    transform: translateX(0);
    opacity: 1;
  }

  .nav-menu-main,
  .nav-menu-auth {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    margin: 0;
  }

  .nav-menu-auth { margin-left: 0; }

  /* Centrado REAL: texto + ícono */
  .nav-link{
    width: min(92vw, 360px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.2rem;
    padding: 1rem 1.6rem;
    gap: 12px;
  }

  /* Dropdown toggle centrado */
  .nav-item.has-dropdown .dropdown-toggle{
    width: min(92vw, 360px);
    justify-content: center;
  }

  /* Dropdown en móvil */
  .has-dropdown .dropdown-menu{
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 8px 0 0;
    backdrop-filter: none;

    width: min(92vw, 360px);
    margin: 0 auto;
    display: none;
  }

  .has-dropdown.open .dropdown-menu{ display: block; }
  .dropdown-menu::before{ display:none; }

  .dropdown-link{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    gap: 12px;
  }

  .dropdown-link:hover { background: rgba(255,255,255,0.10); }
}

@media (max-width: 768px) {
  .workshops { padding: 100px 0 60px; }
  .workshops h2 { font-size: 2.2rem; }

  .workshop-item {
    min-width: 100%;
    margin-bottom: 5px;
  }

  .header-container { padding: 0.8rem 1rem; }
}

@media (max-width: 576px) {
  .workshops h2 { font-size: 1.8rem; }

  .workshops-list {
    flex-direction: column;
    max-width: 330px;
    margin: 40px auto;
    gap: 18px;
  }

  .workshop-item {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    transform: none !important;
    margin-bottom: 0;
  }

  .workshop-item:hover { transform: translateY(-5px) !important; }

  .workshop-item i {
    font-size: 1.3rem;
    width: 25px;
    margin-right: 15px;
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .header-container { padding: 0.7rem; }
  .logo img { height: 35px; }

  .nav-link { width: 180px; font-size: 1.1rem; }

  .workshops { padding: 80px 0 50px; }
  .workshop-item { padding: 14px 18px; }
  .workshops-list { max-width: 280px; }
}

/* =========================
   ANIMATIONS
   ========================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes growWidth {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes float {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-100vh) rotate(180deg); }
  100% { transform: translateY(-200vh) rotate(360deg); }
}

@keyframes pulse {
  0% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.1; transform: scale(1.1); }
  100% { opacity: 0.3; transform: scale(1); }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes gradientMove {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shine {
  0% { left: -100%; }
  20% { left: 100%; }
  100% { left: 100%; }
}

@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
/* =========================
   PATCH: ESTRUCTURA UL CORRECTA + RESPONSIVE/ZOOM
   (PEGAR AL FINAL)
   ========================= */

.logo { margin-right: 0 !important; }
.header-container { gap: 16px; }

/* nav-menu ahora tiene 2 li: main y auth */
.nav-menu{
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.nav-menu-main{
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-width: 0;
  flex: 1 1 auto;
}

.nav-menu-auth{
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 0 0 auto;
  margin-left: auto;
}

/* Evita cortes por zoom */
.nav{ min-width: 0; }
.nav-link{ white-space: nowrap; }

/* Compacta un poco antes de que se rompa */
@media (max-width: 1350px){
  .nav-menu-main{ gap: 0.9rem; }
  .nav-link{ padding: 0.55rem 0.9rem; font-size: 0.95rem; }
}

/* Si no cabe, activa wrap (mejor 2 líneas que cortar carrito) */
@media (max-width: 1250px){
  .nav-menu-main{ flex-wrap: wrap; row-gap: 10px; }
}

/* Adelanta móvil para evitar “zona muerta” por zoom */
@media (max-width: 1180px){
  .mobile-menu-btn{ display:block; }

  .nav-menu{
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;

    padding-top: 90px;
    background: linear-gradient(135deg, #1E1E2F 0%, #6A0572 100%);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-y: auto;
    z-index: 9000;
    pointer-events: none;

    transform: translateX(100%);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
  }

  .nav-menu.active{ transform: translateX(0); opacity: 1; pointer-events: auto; }

  .nav-menu-main,
  .nav-menu-auth{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-left: 0;
  }

  .nav-link{
    width: min(92vw, 360px);
    justify-content: center;
    text-align: center;
    font-size: 1.2rem;
  }

  /* carrito + hamburguesa arriba */
  .mobile-menu-btn{
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 4500;
  }

  .cart-link{
    position: fixed !important;
    top: 14px;
    right: 66px;
    z-index: 4600;
    margin-left: 0 !important;
  }

  .header-container{ padding-right: 4.8rem; }
}