/* ── VARIABLES Y RESET ── */
:root {
  --violeta: #6d4aff;
  --violeta-suave: #8e6dff;
  --verde: #b6ff3b;
  --verde-hover: #2ed573;
  --fondo-oscuro: #111;
  --texto-claro: #f5f5f5;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; scroll-behavior: smooth; }

body {
  margin: 0; padding: 80px 0 0;
  font-family: "Gothic A1", sans-serif;
  background-color: #8b94e1;
  color: var(--texto-claro);
  display: flex; flex-direction: column; min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
main { flex: 1; }

/* ── CABECERA ── */
.cabecera {
  position: fixed; top: 0; left: 0; width: 100%; height: 70px;
  display: flex; align-items: center; padding: 0 20px;
  background: rgba(20,20,20,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  z-index: 4000;
}

.cabecera > a:first-child { flex-shrink: 0; display: inline-flex; align-items: center; }
#logo-dharma { height: 60px; width: auto; max-width: none; object-fit: contain; flex-shrink: 0; }

.btn-sesion {
  margin-left: auto; margin-right: 60px;
  padding: 8px 20px; border: 2px solid white; border-radius: 50px;
  color: white; text-decoration: none; font-size: 0.9rem;
  transition: all 0.3s; white-space: nowrap; flex-shrink: 0;
}
.cabecera .btn-panel-admin { margin-left: auto; margin-right: 10px; }
.cabecera .btn-sesion + .btn-sesion { margin-left: 0; }
.btn-sesion:hover { background: white; color: #1a1a2e; }

/* ── MENÚ HAMBURGUESA ── */
.menu-toggle {
  position: fixed; top: 18px; right: 20px;
  width: 40px; height: 30px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: transparent; border: none; cursor: pointer; z-index: 12000;
  transition: transform 0.3s ease;
}
.menu-toggle span {
  width: 100%; height: 3px; background-color: white; border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.68,-0.55,0.27,1.55);
}
.menu-toggle.active { transform: rotate(90deg); }
.menu-toggle.active span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; transform: scale(0); }
.menu-toggle.active span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

.navbar {
  position: fixed; top: 0; right: -100%; width: 85%; max-width: 320px; height: 100vh;
  background: rgba(10,10,25,0.9); backdrop-filter: blur(15px);
  transition: right 0.4s ease; padding-top: 120px;
  box-shadow: -10px 0 40px rgba(0,0,0,0.5); z-index: 11000;
}
.navbar.active { right: 0; }
.navbar ul { list-style: none; padding: 0; margin: 0; text-align: center; }
.navbar li { margin: 15px 0; }
.navbar a { color: white; text-decoration: none; font-size: 18px; padding: 10px 20px; transition: all 0.25s; }
.navbar a:hover { color: #a08bf4; }
.navbar a.activo { border-bottom: 2px solid var(--violeta); color: var(--violeta); }

/* ── OVERLAY ── */
.overlay {
  position: fixed; inset: 0; background: rgba(20,20,40,0.35); backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transition: 0.35s; z-index: 9000;
}
.overlay.active { opacity: 1; visibility: visible; }

/* ── WHATSAPP ── */
.whatsapp-float {
  position: fixed !important; bottom: 25px; right: 25px;
  width: 60px; height: 60px; background: #25d366;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  z-index: 1000; transition: transform 0.3s; text-decoration: none;
  font-size: 1.8rem; color: white;
}
.whatsapp-float:hover { transform: scale(1.1); }

/* ── ANIMACIÓN SCROLL ── */
.animar { opacity: 0; transform: translateY(40px); transition: 0.8s ease; }
.animar.visible { opacity: 1; transform: translateY(0); }

/* ── HERO ── */
.tienda-hero {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 5rem) 20px 1.5rem;
  position: relative;
}
.tienda-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 60% at 15% 50%, rgba(109,74,255,.3), transparent 65%),
    radial-gradient(ellipse 40% 50% at 85% 30%, rgba(182,255,59,.18), transparent 60%);
  pointer-events: none;
}
.tienda-hero h1 {
  font-size: clamp(2rem, 6vw, 3.8rem); font-weight: 700;
  margin: 0 0 .8rem; position: relative;
}
.tienda-hero h1 span {
  background: linear-gradient(90deg, var(--verde), var(--violeta-suave));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.tienda-hero p {
  font-size: 1rem; font-weight: 300; opacity: .85;
  max-width: 500px; margin: 0 auto; line-height: 1.7; position: relative;
}

/* ── FILTROS ── */
.filtros {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .7rem; padding: 1.5rem 20px 1rem;
}
.filtros label { font-size: .85rem; opacity: .7; }
.filtro-btn {
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 50px; padding: .38rem 1.1rem;
  font-family: "Gothic A1", sans-serif; font-size: .82rem; font-weight: 600;
  color: white; cursor: pointer; transition: all .25s ease;
}
.filtro-btn.activo {
  background: var(--violeta); border-color: var(--violeta);
  box-shadow: 0 4px 14px rgba(109,74,255,.5);
}

/* ── GRID TARJETAS ── */
.tienda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 28px;
  width: 90%; max-width: 1100px;
  margin: 1rem auto 5rem;
}

/* ── TARJETA PRODUCTO ── */
.tarjeta-producto {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px; backdrop-filter: blur(10px); overflow: hidden;
  display: flex; flex-direction: column; cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: aparecer .5s ease both;
}
.tarjeta-producto:hover { transform: translateY(-8px) scale(1.02); box-shadow: var(--shadow); }

@keyframes aparecer {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tarjeta-img {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  background: rgba(255,255,255,.07);
}
.tarjeta-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.tarjeta-producto:hover .tarjeta-img img { transform: scale(1.05); }

.tarjeta-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; opacity: .4; color: white;
}
.tarjeta-placeholder svg { width: 44px; height: 44px; }
.tarjeta-placeholder span { font-size: .75rem; }

.tipo-badge {
  position: absolute; top: 10px; left: 10px;
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  padding: .25rem .65rem; border-radius: 50px;
  color: white; background: var(--violeta); z-index: 10;
}
.tipo-badge.pdf    { background: #5352ed; }
.tipo-badge.audio  { background: #2ecc71; color: #003; }
.tipo-badge.video  { background: #e74c3c; }
.tipo-badge.pack   { background: linear-gradient(90deg, var(--violeta), var(--verde)); color: #111; }
.tipo-badge.servicio { background: #f39c12; color: #111; }

.tarjeta-cuerpo {
  padding: 1.1rem 1.2rem .7rem; flex: 1;
  display: flex; flex-direction: column; gap: .4rem;
}
.tarjeta-categoria { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--verde); }
.tarjeta-titulo    { font-size: 1.1rem; font-weight: 700; color: white; margin: 0; }
.tarjeta-desc      { font-size: .82rem; font-weight: 300; opacity: .8; line-height: 1.55; flex: 1; margin: 0; }

.tarjeta-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.tag {
  font-size: .68rem; font-weight: 600;
  background: rgba(255,255,255,.13); border-radius: 50px; padding: .18rem .6rem;
}

.tarjeta-footer {
  padding: .7rem 1.2rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
}
.precio { font-size: 1.4rem; font-weight: 700; color: white; }
.precio .moneda { font-size: 1rem; }
.precio .original { font-size: .8rem; text-decoration: line-through; opacity: .5; margin-left: .4rem; }

/* ── TARJETA VACÍA ── */
.tarjeta-vacia {
  border: 2px dashed rgba(255,255,255,.25); background: transparent;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1.5rem; text-align: center; border-radius: 20px;
  min-height: 220px; flex-direction: column; gap: .8rem; color: white;
}
.tarjeta-vacia svg { opacity: .35; width: 40px; height: 40px; }
.tarjeta-vacia p { font-size: .85rem; font-weight: 300; opacity: .6; margin: 0; line-height: 1.4; }

/* ── BOTONES GENERALES ── */
.btn-ver, .btn-agregar {
  background: var(--violeta); color: white; border: none; border-radius: 50px;
  padding: .5rem 1.2rem; font-family: "Gothic A1", sans-serif;
  font-weight: 700; font-size: .85rem; cursor: pointer; transition: all .25s ease;
  white-space: nowrap;
}
.btn-ver:hover, .btn-agregar:hover {
  background: var(--violeta-suave); transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(109,74,255,.4);
}

.btn-pagar {
  width: 100%; padding: .9rem; border-radius: 50px; border: none;
  background: linear-gradient(135deg, var(--verde), var(--verde-hover));
  color: #001a1a; font-family: "Gothic A1", sans-serif;
  font-weight: 700; font-size: 1rem; cursor: pointer; transition: 0.2s;
}
.btn-pagar:hover { opacity: .9; transform: translateY(-1px); }
.btn-pagar:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-vaciar {
  width: 100%; padding: .6rem; border-radius: 50px;
  border: 1px solid rgba(255,71,87,.4); background: transparent;
  color: #ff4757; font-family: "Gothic A1", sans-serif;
  font-weight: 600; font-size: .85rem; cursor: pointer; transition: 0.2s; margin-top: .5rem;
}
.btn-vaciar:hover { background: rgba(255,71,87,.1); }

/* ── CARRITO BOTÓN ── */
.carrito-btn {
  position: fixed; bottom: 100px; right: 25px; width: 58px; height: 58px;
  background: linear-gradient(135deg, var(--violeta), var(--violeta-suave));
  border-radius: 50%; border: none; color: white; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; cursor: pointer; box-shadow: 0 6px 20px rgba(109,74,255,.5);
  transition: transform 0.2s;
}
.carrito-btn:hover { transform: scale(1.1); }

.carrito-count {
  position: absolute; top: -2px; right: -2px;
  background: var(--verde); color: #111; font-size: .65rem; font-weight: 700;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── CARRITO PANEL ── */
.overlay-carrito {
  position: fixed; inset: 0;
  background: rgba(20,20,40,.45); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .35s; z-index: 12500;
}
.overlay-carrito.activo { opacity: 1; visibility: visible; }

.carrito-panel {
  position: fixed; top: 0; right: -100%;
  width: 100%; max-width: 400px; height: 100%;
  background: rgba(15,15,25,.98); backdrop-filter: blur(20px);
  z-index: 13000; display: flex; flex-direction: column;
  transition: right 0.4s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -10px 0 30px rgba(0,0,0,.5);
  border-left: 1px solid rgba(255,255,255,.1);
}
.carrito-panel.abierto { right: 0; }

.carrito-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.02);
}
.carrito-header h3 { margin: 0; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.carrito-cerrar {
  background: transparent; border: none; color: white;
  font-size: 1.4rem; cursor: pointer; width: 35px; height: 35px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}
.carrito-cerrar:hover { background: #ff4757; transform: rotate(90deg); }

.carrito-items {
  flex: 1; overflow-y: auto; padding: 1.2rem;
  display: flex; flex-direction: column; gap: .8rem;
}
.carrito-items::-webkit-scrollbar { width: 4px; }
.carrito-items::-webkit-scrollbar-track { background: transparent; }
.carrito-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

.carrito-item {
  display: flex; align-items: center; gap: 1rem; padding: .8rem;
  background: rgba(255,255,255,.03); border-radius: 12px;
  border: 1px solid rgba(255,255,255,.05);
}
.item-img {
  width: 55px; height: 55px; border-radius: 8px; overflow: hidden;
  flex-shrink: 0; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  display: flex; align-items: center; justify-content: center;
}
.item-img img { width: 100%; height: 100%; object-fit: cover; }

.btn-eliminar {
  background: rgba(255,71,87,.1); color: #ff4757;
  width: 35px; height: 35px; border-radius: 8px; border: none;
  cursor: pointer; transition: 0.2s; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.btn-eliminar:hover { background: #ff4757; color: #fff; }

.carrito-vacio {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4rem 1.5rem; text-align: center;
  color: rgba(255,255,255,.4); gap: 1.2rem;
}
.carrito-vacio svg { width: 80px; height: 80px; opacity: .5; }

.carrito-footer {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.carrito-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: .8rem 0 1rem; font-weight: 700; font-size: 1.1rem;
}
#carritoTotal { color: var(--verde); font-size: 1.3rem; }

/* ── MODAL PRODUCTO ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,10,25,.7); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 14000; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; opacity: 0; pointer-events: none; transition: opacity .4s ease;
}
.modal-overlay.abierto { opacity: 1; pointer-events: all; }

.modal {
  background: rgba(25,25,45,.95); border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px; max-width: 550px; width: 100%; padding: 2.5rem;
  position: relative; box-shadow: 0 25px 50px rgba(0,0,0,.5);
  transform: translateY(20px); transition: transform .4s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.abierto .modal { transform: translateY(0); }

.modal-cerrar {
  position: absolute; top: 1.2rem; right: 1.2rem;
  background: rgba(255,255,255,.05); border: none; border-radius: 50%;
  width: 36px; height: 36px; color: white; font-size: 1.2rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s ease;
}
.modal-cerrar:hover { background: #ff4757; transform: rotate(90deg); }

#modalTipo {
  display: inline-block; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; color: var(--verde); margin-bottom: .5rem; letter-spacing: 1px;
}
#modalTitulo { font-size: 1.8rem; font-weight: 700; color: #fff; margin: 0 0 1rem; }
#modalDesc { font-size: .95rem; line-height: 1.6; color: rgba(255,255,255,.8); margin-bottom: 1.5rem; }

.modal-incluye h4 { font-size: .85rem; font-weight: 700; opacity: .6; text-transform: uppercase; margin-bottom: .8rem; }
#modalIncluye { list-style: none; padding: 0; margin: 0 0 2rem; }
#modalIncluye li {
  font-size: .9rem; color: rgba(255,255,255,.75); margin-bottom: .6rem;
  display: flex; align-items: center; gap: 10px;
}
#modalIncluye li::before { content: '✦'; color: var(--verde); font-size: .8rem; }

.modal-pie {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5rem; margin-top: 1.5rem;
  gap: 1rem;
}
.modal-precio { font-size: 1.6rem; font-weight: 700; color: #fff; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 170px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--violeta); color: white; padding: .7rem 1.6rem;
  border-radius: 50px; font-weight: 700; opacity: 0; transition: .35s; z-index: 15000;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */

/* ── TABLET (≤ 768px) ── */
@media (max-width: 768px) {

  body { padding-top: 70px; }

  /* Hero */
  .tienda-hero { padding: 2rem 16px 1rem; }
  .tienda-hero h1 { font-size: clamp(1.6rem, 7vw, 2.5rem); }
  .tienda-hero p  { font-size: .9rem; }

  /* Filtros */
  .filtros { gap: .5rem; padding: 1rem 16px; }
  .filtro-btn { font-size: .78rem; padding: .32rem .9rem; }

  /* Grid — 2 columnas en tablet */
  .tienda-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 95%;
    margin-bottom: 7rem;
  }

  /* Tarjetas más compactas */
  .tarjeta-titulo   { font-size: 1rem; }
  .tarjeta-desc     { font-size: .78rem; }
  .precio           { font-size: 1.2rem; }
  .btn-ver          { padding: .45rem .9rem; font-size: .8rem; }

  /* Carrito panel ocupa todo el ancho */
  .carrito-panel { max-width: 100%; }

  /* Modal más compacto */
  .modal { padding: 1.8rem 1.4rem; }
  #modalTitulo { font-size: 1.4rem; }
  .modal-pie { flex-direction: column; align-items: flex-start; }
  .modal-pie .btn-agregar { width: 100%; text-align: center; }

  /* Toast más abajo para no tapar nav inferior */
  .toast { bottom: 80px; font-size: .85rem; }

  /* Carrito botón */
  .carrito-btn { bottom: 80px; right: 16px; width: 52px; height: 52px; }
}

/* ── MÓVIL (≤ 480px) ── */
@media (max-width: 480px) {

  /* Grid — 1 columna en móvil */
  .tienda-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 92%;
  }

  /* Tarjeta imagen más baja */
  .tarjeta-img { aspect-ratio: 16/9; }

  /* Filtros con scroll horizontal */
  .filtros {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 1rem 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filtros::-webkit-scrollbar { display: none; }
  .filtros label { display: none; }

  /* Tarjeta footer apilado */
  .tarjeta-footer { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .btn-ver { width: 100%; text-align: center; }

  /* Modal pantalla completa en móvil */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 20px 20px 0 0; max-height: 92vh;
    padding: 1.5rem 1.2rem;
  }

  /* Header sesion adaptable */
  .cabecera { padding: 0 10px; }
  #logo-dharma { height: 38px; width: auto; max-width: none; }
  .menu-toggle { right: 10px; width: 30px; height: 22px; top: 24px; }
  .btn-sesion { margin-right: 40px; font-size: .72rem; padding: 5px 10px; border-width: 1.5px; }
  .cabecera .btn-panel-admin { margin-right: 5px; }

  /* Carrito items más compactos */
  .carrito-items { padding: .8rem; }
  .item-img { width: 44px; height: 44px; }

  /* Toast */
  .toast { width: 85%; text-align: center; bottom: 90px; }
}

/* ── EXTRA PEQUEÑO (≤ 360px) ── */
@media (max-width: 360px) {
  .tienda-hero h1 { font-size: 1.5rem; }
  .tarjeta-titulo  { font-size: .95rem; }
  .precio          { font-size: 1.1rem; }
}