/* =====================================================================
   Pikipeques.com — hoja de estilos base.
   Paleta e identidad: colorida y cálida, inspirada en pikipeques.com
   ("Juega, Canta y Aprende"). Ajusta las variables --pk-* con la
   paleta/tipografía de marca definitiva cuando la tengas a la mano.
   ===================================================================== */

:root {
  --pk-amarillo: #FFC93C;
  --pk-coral: #FF6F59;
  --pk-teal: #2FB8AC;
  --pk-verde: #27AE60;
  --pk-morado: #7B61FF;
  --pk-azul-oscuro: #223A5E;
  --pk-crema: #FFF8EC;
  --pk-crema-alt: #FFF3D6;
  --pk-oscuro: #1C1B1F;
  --pk-texto: #2E2A26;
  --pk-radius: 20px;
  --pk-sombra: 0 10px 25px rgba(34, 58, 94, 0.12);
  font-size: 16px;
}

* { box-sizing: border-box; }

img { max-width: 100%; }

/* Nota: NO se usa overflow-x:hidden en html/body — rompe position:sticky
   (el header dejaba de quedarse pegado arriba al hacer scroll). Los
   desbordamientos horizontales reales se corrigen en su origen (ver
   comentario en .pk-header-inner y .pk-section más abajo). */

body {
  margin: 0;
  font-family: 'Quicksand', 'Baloo 2', system-ui, sans-serif;
  color: var(--pk-texto);
  background: var(--pk-crema);
  line-height: 1.6;
}

h1, h2, h3, h4, .pk-logo, .pk-btn {
  font-family: 'Baloo 2', 'Quicksand', system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }

.pk-container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* --- Header --- */
.pk-header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 50;
}
/* padding-top/bottom (no el shorthand "padding: 14px 0") para no pisar
   el padding lateral de .pk-container — mismo error que ya se corrigió
   en .pk-section: dejaba el logo, el carrito y la hamburguesa pegados
   al borde de la pantalla en móvil. */
.pk-header-inner {
  display: flex; align-items: center; padding-top: 14px; padding-bottom: 14px;
  flex-wrap: wrap; gap: 10px; transition: padding .2s ease;
}
.pk-logo { font-size: 1.6rem; font-weight: 800; transition: font-size .2s ease; }

/* Encabezado compacto: al hacer scroll hacia abajo se encoge (menos
   alto, logo un poco más chico) pero se queda siempre visible, en vez
   de desaparecer. Ver el toggle de la clase en assets/js/main.js. */
.pk-header.pk-header-scrolled .pk-header-inner { padding-top: 8px; padding-bottom: 8px; }
.pk-header.pk-header-scrolled .pk-logo { font-size: 1.3rem; }
.pk-logo-rainbow span { transition: transform .15s ease; display: inline-block; }
.pk-logo-rainbow:hover span:nth-child(odd) { transform: translateY(-2px); }
/* margin-left:auto empuja el nav (y todo lo que va después) hacia la
   derecha, pegado al carrito, en vez de repartir el espacio en 3 partes
   iguales (lo que dejaba un hueco enorme entre "Contacto" y el carrito). */
.pk-nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.pk-nav a { font-weight: 700; color: var(--pk-azul-oscuro); padding: 8px 4px; }
.pk-nav a:hover { color: var(--pk-teal); }
.pk-nav a.pk-nav-active { color: var(--pk-coral); }

.pk-header-actions { display: flex; align-items: center; gap: 10px; margin-left: 28px; }
/* padding-bottom + margin-bottom negativo: extiende el área que detecta
   ":hover" para que cubra también el hueco visual antes del submenú
   (si no, al bajar el mouse lento por ese hueco el submenú se cierra
   antes de llegar a él), sin mover ningún otro elemento del header. */
.pk-cart-wrap { position: relative; padding-bottom: 10px; margin-bottom: -10px; }
.pk-cart-btn {
  background: var(--pk-amarillo); border-radius: 999px; padding: 8px 18px;
  color: var(--pk-azul-oscuro); font-weight: 800; border: none; cursor: pointer;
  font-size: 1rem; font-family: inherit;
}
.pk-cart-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  background: #fff; border-radius: 14px; box-shadow: var(--pk-sombra);
  min-width: 175px; padding: 8px; z-index: 60; text-align: left;
}
.pk-cart-wrap:hover .pk-cart-dropdown,
.pk-cart-wrap.pk-cart-open .pk-cart-dropdown { display: block; }
.pk-cart-dropdown a { display: block; padding: 10px 12px; border-radius: 8px; font-weight: 700; color: var(--pk-azul-oscuro); }
.pk-cart-dropdown a:hover { background: var(--pk-crema-alt); color: var(--pk-teal); }

.pk-menu-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; }

@media (max-width: 720px) {
  /* Logo centrado y carrito+hamburguesa fijos a la derecha (el nav de
     texto queda oculto y no ocupa espacio, así que el logo se puede
     centrar con position:absolute sin que nada más lo empuje). */
  .pk-header-inner { position: relative; justify-content: flex-end; }
  /* El logo se achica un poco en móvil para que, ya centrado, quede
     espacio suficiente entre él y el carrito+hamburguesa sin encimarse.
     "top" fijo (en vez de dejarlo en automático) para que se quede
     pegado arriba, en la misma fila que el carrito, incluso cuando el
     menú está abierto y el header crece de alto. */
  .pk-logo { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font-size: 1.2rem; transition: top .2s ease, font-size .2s ease; }
  .pk-nav {
    display: none; flex-direction: column; align-items: flex-start;
    width: 100%; order: 3; margin-left: 0; padding: 10px 0;
  }
  .pk-nav.pk-nav-open { display: flex; }
  .pk-header-actions { gap: 8px; }
  .pk-cart-btn { padding: 6px 12px; font-size: .95rem; transition: padding .2s ease, font-size .2s ease; }
  .pk-menu-toggle { display: block; }
  .pk-cart-dropdown { right: 0; left: auto; }

  /* Encabezado compacto en móvil: logo un poco más chico y realineado
     con el nuevo padding reducido del header. */
  .pk-header.pk-header-scrolled .pk-logo { top: 8px; font-size: 1.05rem; }
  .pk-header.pk-header-scrolled .pk-cart-btn { padding: 4px 10px; font-size: .85rem; }
}

@media (max-width: 600px) {
  /* Un poco más de aire a los lados en pantallas pequeñas. */
  .pk-container { padding: 0 24px; }
}

/* --- Hero --- */
.pk-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #FFE7A8 0%, #FFD3D6 50%, #CDEDE4 100%);
  color: var(--pk-texto); padding: 70px 0 90px; border-radius: 0 0 40px 40px;
}
.pk-hero::before, .pk-hero::after {
  content: ""; position: absolute; border-radius: 50%; z-index: 0;
}
.pk-hero::before { top: -90px; right: -70px; width: 280px; height: 280px; background: rgba(255, 166, 77, 0.5); }
.pk-hero::after { bottom: -110px; left: -90px; width: 300px; height: 300px; background: rgba(148, 214, 193, 0.5); }
.pk-hero-inner {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 1fr;
  gap: 40px; align-items: center;
}
.pk-hero-badge {
  display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--pk-coral);
  font-weight: 700; font-size: .85rem; padding: 9px 18px; border-radius: 999px; margin-bottom: 20px;
}
.pk-hero h1 { font-size: 2.9rem; line-height: 1.08; max-width: 640px; margin: 0 0 18px; }
.pk-hero p { font-size: 1.05rem; max-width: 480px; opacity: 0.85; margin-bottom: 26px; }
.pk-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pk-hero-art {
  position: relative; background: rgba(255,255,255,0.4); border-radius: 28px;
  padding: 36px 20px; text-align: center; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.pk-hero-art-img { width: 100%; max-width: 480px; height: auto; display: block; }
.pk-btn {
  display: inline-block; background: var(--pk-amarillo); color: var(--pk-azul-oscuro);
  font-weight: 800; padding: 14px 28px; border-radius: 999px; margin-top: 18px;
  border: none; cursor: pointer; font-size: 1rem;
}
.pk-btn:hover { filter: brightness(1.05); }
.pk-btn-outline { background: #fff; border: none; color: var(--pk-texto); }
.pk-btn-coral { background: var(--pk-coral); color: #fff; }
.pk-btn-teal { background: var(--pk-teal); color: #fff; }
.pk-btn-dark { background: var(--pk-oscuro); color: #fff; }

/* --- Secciones genéricas --- */
/* padding-top/bottom (no el shorthand "padding: 60px 0") para no pisar
   el padding lateral de .pk-container en secciones que combinan ambas
   clases — eso era lo que dejaba las tarjetas de productos/música/blog
   pegadas al borde de la pantalla en móvil. */
.pk-section { padding-top: 60px; padding-bottom: 60px; }
.pk-section h2 { font-size: 1.9rem; color: var(--pk-texto); margin-bottom: 8px; }
.pk-section .pk-subtitle { color: #6b675f; margin-bottom: 32px; }
.pk-section-center { text-align: center; }
.pk-section-center .pk-subtitle { max-width: 560px; margin-left: auto; margin-right: auto; }
.pk-band-alt { background: var(--pk-crema-alt); }

/* --- Galería de fotos del producto (miniaturas + visor con zoom) --- */
.pk-gallery-main {
  position: relative; display: block; width: 100%; padding: 0; border: none;
  background: none; cursor: zoom-in; border-radius: var(--pk-radius);
  overflow: hidden; box-shadow: var(--pk-sombra);
}
.pk-gallery-main img { width: 100%; display: block; }
.pk-gallery-zoom-hint {
  position: absolute; bottom: 12px; right: 12px; background: rgba(34, 58, 94, 0.75);
  color: #fff; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  opacity: 0; transition: opacity .15s ease;
}
.pk-gallery-main:hover .pk-gallery-zoom-hint { opacity: 1; }
.pk-gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pk-gallery-thumb {
  width: 70px; height: 70px; padding: 0; border-radius: 12px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; background: none; opacity: .7;
  transition: opacity .15s ease, border-color .15s ease;
}
.pk-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-gallery-thumb:hover { opacity: 1; }
.pk-gallery-thumb-active { border-color: var(--pk-teal); opacity: 1; }

.pk-modal-gallery { max-width: 900px; background: #fff; }
.pk-gallery-stage { display: flex; align-items: center; gap: 10px; }
.pk-gallery-zoom-wrap {
  flex: 1; max-height: 74vh; overflow: auto; border-radius: 14px;
  background: var(--pk-crema); display: flex; align-items: center; justify-content: center;
}
.pk-gallery-zoom-wrap img { max-width: 100%; max-height: 74vh; display: block; cursor: zoom-in; transition: max-width .2s ease, max-height .2s ease; }
.pk-gallery-zoom-wrap.pk-gallery-zoomed { display: block; cursor: zoom-out; }
.pk-gallery-zoom-wrap.pk-gallery-zoomed img { max-width: none; max-height: none; width: 165%; cursor: zoom-out; }
.pk-gallery-nav {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; border: none;
  background: var(--pk-crema-alt); color: var(--pk-azul-oscuro); font-size: 1.5rem;
  line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pk-gallery-nav:hover { background: var(--pk-amarillo); }
.pk-gallery-meta { text-align: center; color: #8a857b; font-size: .85rem; margin: 12px 0 0; }

@media (max-width: 720px) {
  .pk-gallery-nav { width: 34px; height: 34px; font-size: 1.2rem; }
}

/* --- Sección dividida (imagen + texto), ej. "La música como llave" --- */
.pk-split { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.pk-split img { width: 100%; height: 100%; max-height: 360px; object-fit: cover; border-radius: var(--pk-radius); box-shadow: var(--pk-sombra); }
.pk-split h2 { margin-top: 0; }
.pk-split p { color: #6b675f; }

@media (max-width: 860px) {
  .pk-hero-inner, .pk-split { grid-template-columns: 1fr; }
  .pk-hero h1 { font-size: 2.2rem; }
}

/* --- Tarjetas de canciones (inicio + /musica) --- */
.pk-song-card { border-radius: var(--pk-radius); overflow: hidden; display: block; transition: transform .15s ease; }
.pk-song-card:hover { transform: translateY(-4px); }
.pk-song-card img { width: 100%; height: 150px; object-fit: cover; display: block; background: rgba(0,0,0,0.05); }
.pk-song-card-body { padding: 16px; }
.pk-song-card-body h3 { margin: 0 0 4px; font-size: 1.02rem; }
.pk-song-card-body p { margin: 0; font-size: .85rem; color: #555; }

/* --- Tarjetas (producto, blog, categoría) --- */
.pk-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.pk-card {
  background: #fff; border-radius: var(--pk-radius); box-shadow: var(--pk-sombra);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease;
}
.pk-card:hover { transform: translateY(-4px); }
.pk-card img { width: 100%; height: 170px; object-fit: cover; background: #eee; }
.pk-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.pk-card-tag {
  align-self: flex-start; background: var(--pk-amarillo); color: var(--pk-azul-oscuro);
  font-size: .72rem; font-weight: 800; text-transform: uppercase; padding: 4px 10px;
  border-radius: 999px; margin-bottom: 8px;
}
.pk-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.pk-card .pk-price { font-weight: 800; color: var(--pk-coral); font-size: 1.1rem; margin-top: auto; }
.pk-price-old { text-decoration: line-through; color: #999; font-weight: 500; font-size: .85rem; margin-left: 6px; }
.pk-price-badge {
  display: inline-block; background: var(--pk-coral); color: #fff; font-size: .72rem; font-weight: 800;
  padding: 2px 9px; border-radius: 999px; margin-left: 8px; vertical-align: middle;
}

/* --- Formularios --- */
.pk-form label { display: block; font-weight: 700; margin: 14px 0 6px; }
.pk-form input, .pk-form textarea, .pk-form select {
  width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid #ddd; font-size: 1rem;
}
.pk-form textarea { min-height: 120px; }

/* --- Footer --- */
.pk-footer { background: var(--pk-oscuro); color: #fff; padding: 40px 0 24px; margin-top: 60px; }
.pk-footer a { opacity: .85; }
.pk-footer a:hover { opacity: 1; }
.pk-footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.pk-footer-logo { font-size: 1.4rem; font-weight: 800; }
.pk-footer-nav { display: flex; gap: 22px; }
.pk-footer-nav a { font-weight: 600; }
.pk-social { display: flex; gap: 10px; margin-top: 0; }
.pk-social a {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: transform .15s ease, filter .15s ease;
}
.pk-social a svg { width: 18px; height: 18px; fill: #fff; display: block; }
.pk-social a:hover { transform: translateY(-3px); filter: brightness(1.1); }
.pk-social-fb { background: #1877F2; }
.pk-social-ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.pk-social-tiktok { background: #000; }
.pk-social-yt { background: #FF0000; }
.pk-footer-copy { text-align: center; opacity: .55; font-size: .8rem; margin-top: 32px; }
.pk-footer-copy a { text-decoration: underline; opacity: 1; }

/* --- Botones de "Compartir" (producto/blog), mismo estilo que .pk-social --- */
.pk-share { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pk-video-modal-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pk-video-modal-actions .pk-share { margin-top: 0; }
.pk-share-label { font-size: .85rem; color: #6b675f; }
.pk-share-icon {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, filter .15s ease;
}
.pk-share-icon svg { width: 18px; height: 18px; fill: #fff; display: block; }
.pk-share-icon:hover { transform: translateY(-3px); filter: brightness(1.1); }
.pk-share-whatsapp { background: #25D366; }
.pk-share-fb { background: #1877F2; }
.pk-share-x { background: #000; }
.pk-share-copy { background: #8a94a3; }

@media (max-width: 600px) {
  .pk-footer-inner { flex-direction: column; text-align: center; }
}

/* --- Utilidades --- */
.pk-badge-fisico { background: var(--pk-verde); color: #fff; }
.pk-badge-digital { background: var(--pk-morado); color: #fff; }
.pk-empty { text-align: center; padding: 60px 20px; color: #8a857b; }
.pk-alert { padding: 14px 18px; border-radius: 14px; margin-bottom: 18px; }
.pk-alert-error { background: #ffe1e1; color: #a11; }
.pk-alert-success { background: #e2f8ef; color: #147a52; }

/* --- Modal --- */
.pk-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(34, 58, 94, 0.55);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.pk-modal-overlay.pk-modal-open { display: flex; }
.pk-modal {
  background: #fff; border-radius: var(--pk-radius); box-shadow: var(--pk-sombra);
  max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 28px;
  position: relative;
}
.pk-modal-close {
  position: absolute; top: 16px; right: 20px; background: none; border: none;
  font-size: 1.3rem; cursor: pointer; color: #8a857b; line-height: 1;
}

/* --- Modal de video (videos relacionados del blog) --- */
.pk-modal-video { max-width: 720px; }
.pk-video-embed {
  position: relative; width: 100%; padding-top: 56.25%; margin: 14px 0 18px;
  background: #000; border-radius: 12px; overflow: hidden;
}
.pk-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.pk-song-card-btn {
  width: 100%; border: none; background: none; padding: 0; margin: 0;
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.pk-song-card-thumb { position: relative; }
.pk-play-overlay {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 54px; height: 54px; border-radius: 50%; background: rgba(34, 58, 94, 0.65);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; pointer-events: none; transition: background .15s ease;
}
.pk-song-card-btn:hover .pk-play-overlay { background: var(--pk-teal); }
