/* ==========================================================
   VYNTA — CARRITO DE COMPRA (burbuja flotante)
   Módulo independiente. Requiere que comun.css esté cargado
   antes para heredar las variables de color del tema oscuro.
   Funciona en hombre.html y mujer.html.
   ========================================================== */

/* --- CONTENEDOR RAÍZ AISLADO ---
   Todo el carrito vive dentro de #vyntaCartRoot, que es un punto
   fijo de tamaño 0. Así NADA del carrito ocupa espacio en el flujo
   de la página ni puede desacomodar el diseño ni crear scroll. */
#vyntaCartRoot {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 3000;
}

/* --- BURBUJA FLOTANTE --- */
.vynta-cart-bubble {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #f5f5f5;
  color: #0a0a0a;
  border: none;
  cursor: pointer;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.vynta-cart-bubble:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.6);
}

.vynta-cart-bubble svg {
  width: 26px;
  height: 26px;
}

/* Animación de "salto" al agregar un producto */
.vynta-cart-bubble.bump {
  animation: vynta-cart-bump 0.4s ease;
}

@keyframes vynta-cart-bump {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.25); }
  60%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}

/* Contador de items */
.vynta-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #25d366;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.vynta-cart-count.visible {
  display: flex;
}

/* --- PANEL DESPLEGABLE --- */
.vynta-cart-panel {
  position: fixed;
  bottom: 100px;
  right: 26px;
  width: 360px;
  max-width: calc(100vw - 40px);
  max-height: 70vh;
  background: #111111;
  border: 1px solid #2a2a2a;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s ease;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

.vynta-cart-panel.abierto {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Cabecera del panel */
.vynta-cart-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.vynta-cart-header h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  color: #f5f5f5;
  margin: 0;
}

.vynta-cart-header .vynta-cart-close {
  background: transparent;
  border: none;
  color: #777;
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.vynta-cart-header .vynta-cart-close:hover {
  color: #fff;
}

/* Lista de items (scroll) */
.vynta-cart-items {
  overflow-y: auto;
  padding: 8px 0;
  flex-grow: 1;
}

.vynta-cart-empty {
  padding: 40px 22px;
  text-align: center;
  color: #666;
  font-size: 13px;
  letter-spacing: 1px;
}

/* Item individual */
.vynta-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid #1c1c1c;
}

/* Cuadrito de color del producto */
.vynta-cart-swatch {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #ffffff33;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px #000;
}

.vynta-cart-item-info {
  flex-grow: 1;
  min-width: 0;
}

/* Nombre — doble clic lleva al producto */
.vynta-cart-item-nombre {
  color: #f5f5f5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
  user-select: none;
  transition: color 0.2s;
}

.vynta-cart-item-nombre:hover {
  color: #25d366;
  text-decoration: underline;
}

.vynta-cart-item-meta {
  color: #888;
  font-size: 11px;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.vynta-cart-item-precio {
  color: #aaa;
  font-size: 11px;
  margin-top: 2px;
}

/* Control de cantidad */
.vynta-cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vynta-cart-qty button {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #3a3a3a;
  background: transparent;
  color: #f5f5f5;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.vynta-cart-qty button:hover {
  border-color: #f5f5f5;
  background: #f5f5f5;
  color: #0a0a0a;
}

.vynta-cart-qty span {
  color: #f5f5f5;
  font-size: 13px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

/* Botón eliminar item */
.vynta-cart-item-del {
  background: transparent;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.vynta-cart-item-del:hover {
  color: #e05555;
}

/* Pie del panel */
.vynta-cart-footer {
  padding: 16px 22px 20px;
  border-top: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.vynta-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  color: #f5f5f5;
}

.vynta-cart-total span:first-child {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
}

.vynta-cart-total span:last-child {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 1px;
}

.vynta-cart-wa-btn {
  width: 100%;
  background: #25d366;
  color: #fff;
  border: none;
  padding: 15px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.25s, transform 0.2s;
}

.vynta-cart-wa-btn:hover {
  background: #1fbb57;
  transform: translateY(-2px);
}

.vynta-cart-wa-btn:disabled {
  background: #2a2a2a;
  color: #666;
  cursor: not-allowed;
  transform: none;
}

.vynta-cart-clear {
  width: 100%;
  background: transparent;
  border: none;
  color: #666;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px;
  transition: color 0.2s;
}

.vynta-cart-clear:hover {
  color: #e05555;
}

/* Botón "Agregar al carrito" que se inyecta dentro del modal */
.vynta-add-cart-btn {
  width: 100%;
  background: transparent;
  border: 1px solid #f5f5f5;
  color: #f5f5f5;
  padding: 14px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  transition: all 0.25s;
}

.vynta-add-cart-btn:hover {
  background: #f5f5f5;
  color: #0a0a0a;
}

/* Toast de confirmación al agregar */
.vynta-cart-toast {
  position: fixed;
  bottom: 100px;
  right: 26px;
  background: #1c1c1c;
  border: 1px solid #2a2a2a;
  color: #f5f5f5;
  padding: 12px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  z-index: 3100;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.vynta-cart-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   BOTÓN CAMBIO DE COLECCIÓN (Masculina <-> Femenina)
   Se inyecta en el centro del nav. Solo se ve en móvil.
   ========================================================== */
.vynta-switch-col {
  display: none; /* oculto en escritorio */
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--chrome, #c8c8c8);
  color: var(--chrome-light, #f5f5f5);
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
  transition: all 0.3s;
}

.vynta-switch-col svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.vynta-switch-col:active {
  background: var(--chrome-light, #f5f5f5);
  color: #0a0a0a;
}

/* --- MÓVIL --- */
@media (max-width: 768px) {
  /* Mostrar el botón de cambio de colección solo en celular */
  .vynta-switch-col {
    display: inline-flex;
  }

  .vynta-cart-bubble {
    bottom: 18px;
    right: 18px;
    width: 54px;
    height: 54px;
  }
  .vynta-cart-bubble svg {
    width: 24px;
    height: 24px;
  }
  .vynta-cart-panel {
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    bottom: 84px;
    max-height: 75vh;
  }
  .vynta-cart-toast {
    right: 12px;
    left: 12px;
    text-align: center;
  }
}
