/* controles.css — Controles flotantes (footer.php): WhatsApp, carrito y sello de sonido; volumen; botón de
   sonido del Oráculo; velo de salida entre páginas.
   Los controles flotantes tienen una sola regla por elemento (reorganizado el 2026-11-11, sin cambios visuales:
   comprobado con una huella de estilos en 4 anchos y 3 estados). El volumen y el botón del Oráculo comparten aún
   reglas con oraculo.css: se ordenarán junto con esa hoja. */

/* --- Contenedor: esquina inferior derecha; WhatsApp y carrito se apilan encima del sello --- */
.atmosphere-control {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
@media (max-width: 600px) {
  .atmosphere-control {
    right: 12px;
    bottom: 12px;
  }
}
body:has(#meros-cart[open]) .atmosphere-control {
  visibility: hidden;
}
.atmosphere-control :focus-visible {
  outline: 2px solid #e6cfaa;
  outline-offset: 3px;
}

/* --- Sello de sonido flotante (el símbolo y sus estados: bloque «Sello de sonido» más abajo) --- */
.atmosphere-control .sound-toggle {
  position: relative;
  z-index: 9998;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 48px;
  height: 48px;
  min-width: 0;
  min-height: 0;
  margin-right: 4px; /* alineado con WhatsApp y el carrito (right: 4px) */
  padding: 0;
  overflow: visible;
  border: 1px solid #baa18470;
  border-radius: 50%;
  background: rgba(8, 14, 13, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px #0007;
  color: #d3bc91;
  font-family: Georgia, serif;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000;
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    color 0.3s;
}
.atmosphere-control .sound-toggle:hover,
.atmosphere-control .sound-toggle:focus-visible {
  transform: translateY(-2px);
}
@media (max-width: 600px) {
  .atmosphere-control .sound-toggle {
    font-size: 11px;
  }
}
/* etiqueta para lectores de pantalla (clase sr-only); solo se haría visible con un error de sonido */
.atmosphere-control .sound-toggle [data-sound-label] {
  position: absolute;
  top: 100%;
  left: 0;
  display: block;
  width: 100%;
  min-height: 17px;
  color: #dfc69e;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  visibility: hidden;
}
.atmosphere-control .sound-toggle.sound-error [data-sound-label] {
  visibility: visible;
}
/* el volumen aparece a la izquierda del sello, para que el sello no se mueva al activar el sonido */
body .atmosphere-control .atmosphere-level {
  order: -1;
}

/* --- WhatsApp y carrito flotantes (encima del sello) --- */
.atmosphere-control :is(.floating-whatsapp, .floating-cart) {
  position: absolute;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid #baa18470;
  border-radius: 4px;
  background: rgba(8, 14, 13, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px #0005;
  text-decoration: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.atmosphere-control .floating-whatsapp {
  bottom: calc(100% + 96px);
  color: #d3bc91;
}
.atmosphere-control .floating-cart {
  bottom: calc(100% + 32px);
  gap: 0;
  min-height: 48px;
  color: #eee5d6;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}
.atmosphere-control :is(.floating-whatsapp, .floating-cart):is(:hover, :focus-visible) {
  border-color: #d5b981;
  box-shadow: 0 0 14px #aa852730;
}
:is(.floating-whatsapp, .floating-cart) .dashicons {
  width: 24px;
  height: 24px;
  font-size: 24px;
  color: #d3bc91;
}
.floating-cart .cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  box-sizing: border-box;
  border: 1px solid #baa18460;
  border-radius: 50%;
  background: #0b100e;
  color: #fffee9;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* Por orden de cascada: compite con otra regla de este archivo (origen: publication.css). */
.publication-viewer-content > img {
  display: block;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 88dvh;
  object-fit: contain;
}

.atmosphere-level {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px 14px;
  color: #c8bdac;
  font-size: 12px;
}
.atmosphere-level[hidden] {
  display: none;
}
.atmosphere-level input {
  width: 90px;
  min-width: 0;
  accent-color: #baa184;
  cursor: pointer;
  min-height: 28px;
}
@media (max-width: 600px) {
  .atmosphere-level {
    padding-inline: 12px;
    gap: 6px;
  }
}
#mt-oracle button.mt-oracle-sound {
  color: #d0b383;
  font-family: Georgia, serif;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0;
}
/* Por orden de cascada: compite con otra regla de este archivo (origen: publication.css). */
#mt-oracle button.mt-oracle-sound {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  height: auto !important;
  padding: 10px 14px !important;
  display: flex;
  gap: 12px;
  justify-content: center;
  border: 3px double #bda071 !important;
  border-radius: 0 !important;
  background: #090c0bee !important;
  text-align: left;
}
#mt-oracle button.mt-oracle-sound {
  display: flex !important;
  flex-direction: column;
  gap: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
  min-height: 44px;
  border-radius: 0;
  overflow: visible;
}

#mt-oracle .mt-oracle-sound [data-sound-label] {
  display: block;
  font-size: 11px;
  line-height: 1.5;
  min-height: 17px;
  visibility: hidden;
  color: #dfc69e;
  text-align: center;
}
#mt-oracle .mt-oracle-sound:is(.active, .sound-error) [data-sound-label] {
  visibility: visible;
}
.atmosphere-control .atmosphere-level {
  justify-content: center;
  background: #080d0be8;
  border: 1px solid #baa18450;
  margin-top: 6px;
  padding: 8px;
}
/* Por orden de cascada: compite con otra regla de este archivo (origen: publication.css). */
#mt-oracle .atmosphere-level {
  justify-content: center;
}
/* Por orden de cascada: compite con otra regla de este archivo (origen: publication.css). */
#mt-oracle .atmosphere-level label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0;
}
/* Por orden de cascada: compite con otra regla de este archivo (origen: publication.css). */
#mt-oracle .atmosphere-level input[type="range"] {
  min-width: 0;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: #baa184;
}
.atmosphere-level output {
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}

/* Por orden de cascada: compite con otra regla de este archivo (origen: publication.css). */
#mt-oracle .atmosphere-level {
  margin: 14px auto 0;
  max-width: 210px;
  gap: 6px;
  padding: 0;
  font-size: 11px;
}
/* Por orden de cascada: compite con otra regla de este archivo (origen: publication.css). */
#mt-oracle .atmosphere-level input[type="range"] {
  width: 90px;
}
#mt-oracle .atmosphere-level[hidden],
.atmosphere-control .atmosphere-level[hidden] {
  display: none;
}
body .atmosphere-control .atmosphere-level,
#mt-oracle .atmosphere-level {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin-top: 14px;
  max-width: 100%;
  width: 100%;
}
body .atmosphere-level label,
#mt-oracle .atmosphere-level label {
  font-size: 10px;
  text-transform: uppercase;
  color: #fffee9;
  line-height: 1.4;
  flex-shrink: 0;
  margin: 0;
  letter-spacing: 0;
}
body .atmosphere-level output {
  font-size: 11px;
  color: #fffee9;
  text-align: right;
  min-width: 34px;
  flex-shrink: 0;
}
body .atmosphere-level input[type="range"],
#mt-oracle .atmosphere-level input[type="range"] {
  --volume-fill: 50%;
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  width: 100%;
  min-width: 40px;
  max-width: none;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  touch-action: pan-y;
}
.atmosphere-level input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border: 0;
  border-radius: 2px;
  background:
    repeating-linear-gradient(110deg, transparent 0 4px, #090c0b 4px 6px),
    linear-gradient(
      to right,
      #fffee9 0 var(--volume-fill),
      #6e6c60 var(--volume-fill) 100%
    );
  box-shadow:
    0 1px 1px #000,
    inset 0 1px 0 #ffffff30;
}
.atmosphere-level input[type="range"]::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 2px;
  background:
    repeating-linear-gradient(110deg, transparent 0 4px, #090c0b 4px 6px),
    linear-gradient(
      to right,
      #fffee9 0 var(--volume-fill),
      #6e6c60 var(--volume-fill) 100%
    );
  box-shadow:
    0 1px 1px #000,
    inset 0 1px 0 #ffffff30;
}
.atmosphere-level input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5.5px;
  border: 1px solid #725719;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 25%,
    #f4df9f 0,
    #c6a44b 22%,
    #aa8527 48%,
    #705019 85%
  );
  box-shadow:
    inset 0 0 0 2px #aa852799,
    inset 0 -2px 2px #302206aa,
    0 2px 3px #000b;
  transition: box-shadow 0.2s;
}
.atmosphere-level input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 1px solid #725719;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 25%,
    #f4df9f 0,
    #c6a44b 22%,
    #aa8527 48%,
    #705019 85%
  );
  box-shadow:
    inset 0 0 0 2px #aa852799,
    inset 0 -2px 2px #302206aa,
    0 2px 3px #000b;
  transition: box-shadow 0.2s;
}
.atmosphere-level
  input[type="range"]:is(:hover, :focus-visible)::-webkit-slider-thumb {
  box-shadow:
    inset 0 1px 2px #fff9,
    0 0 8px #aa852780,
    0 2px 3px #000b;
}
.atmosphere-level
  input[type="range"]:is(:hover, :focus-visible)::-moz-range-thumb {
  box-shadow:
    inset 0 1px 2px #fff9,
    0 0 8px #aa852780,
    0 2px 3px #000b;
}
body .atmosphere-level input[type="range"]:focus-visible {
  outline: 1px solid #fffee9;
  outline-offset: 2px;
}
body .atmosphere-control .atmosphere-level[hidden],
#mt-oracle .atmosphere-level[hidden] {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .atmosphere-level input[type="range"]::-webkit-slider-thumb {
    transition: none;
  }
  .atmosphere-level input[type="range"]::-moz-range-thumb {
    transition: none;
  }
}
body .atmosphere-level label,
body .atmosphere-level output,
#mt-oracle .atmosphere-level label,
#mt-oracle .atmosphere-level output {
  position: absolute;
  width: 1px;
  height: 1px;
  min-width: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
#mt-oracle .mt-oracle-sound.active:not(.sound-error) [data-sound-label] {
  visibility: hidden;
}
body .atmosphere-control .atmosphere-level {
  flex: 0 1 70px;
  width: 70px;
  min-width: 44px;
  margin: 0;
  padding: 0;
}
/* Por orden de cascada: compite con otra regla de este archivo (origen: publication.css). */
body .button,
body .woocommerce a.button,
body .woocommerce button.button,
body .woocommerce input.button {
  background: rgba(8, 14, 13, 0.55) !important;
  color: var(--ivory) !important;
  border: 1px solid rgba(186, 161, 132, 0.62) !important;
  border-radius: 2px !important;
  min-height: 48px;
  padding: 12px 22px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-weight: 400 !important;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
  box-shadow:
    inset 0 1px 0 #fff1,
    0 6px 20px #0003;
  backdrop-filter: blur(8px);
  transition:
    background 0.25s,
    border-color 0.25s,
    box-shadow 0.25s,
    color 0.25s;
}
/* --- Sello de sonido (sustituye al parche «Despertar la atmósfera»; footer.php y publication-oracle.php) ---
   Botón redondo con un símbolo en línea dorada. El texto queda para lectores de pantalla y como globo (title);
   publication-sound.js sigue cambiando la etiqueta y las clases .active / .sound-error. */
#mt-oracle .atmosphere-inline button.mt-oracle-sound.mt-sigil {
  flex: 0 0 auto;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 48px !important;
  height: 48px !important;
  min-height: 0;
  padding: 0 !important;
  border: 1px solid #baa18470 !important;
  border-radius: 50% !important;
  background: rgba(8, 14, 13, 0.9) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px #0007;
  color: #d3bc91;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s, color 0.3s;
}
#mt-oracle .atmosphere-inline button.mt-oracle-sound.mt-sigil {
  width: 42px !important;
  height: 42px !important;
  margin: 0 auto;
  background: rgba(8, 12, 9, 0.6) !important;
}
.mt-sigil .mt-sigil-svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  overflow: visible;
}
.mt-sigil .mt-sigil-ring { stroke-width: 0.8; opacity: 0.55; }
.mt-sigil .mt-sigil-ticks { stroke-width: 1; opacity: 0.55; }
.mt-sigil .mt-sigil-dot { fill: currentColor; stroke: none; }
.mt-sigil .mt-sigil-wave { opacity: 0.32; transition: opacity 0.4s; }
.mt-sigil:hover,
.mt-sigil:focus-visible {
  border-color: #e2c597 !important;
  box-shadow: 0 0 18px #bda07140;
  color: #ead3a6;
}
.mt-sigil:focus-visible { outline: 1px solid #e2c597; outline-offset: 3px; }
.mt-sigil:hover .mt-sigil-wave { opacity: 0.6; }
.mt-sigil.active { border-color: #d7b780 !important; color: #ecd2a0; box-shadow: 0 0 18px #bda07140; }
.mt-sigil.active .mt-sigil-wave { opacity: 1; }
.mt-sigil.sound-error { border-color: #c98a4b !important; color: #c98a4b; }
@media (prefers-reduced-motion: no-preference) {
  .mt-sigil.active .mt-sigil-wave { animation: mt-sigil-onda 2.4s ease-in-out infinite; }
  .mt-sigil.active .mt-sigil-wave.w2 { animation-delay: 0.3s; }
  .mt-sigil.active .mt-sigil-wave.w3 { animation-delay: 0.6s; }
}
@keyframes mt-sigil-onda {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* sello «en espera»: el navegador no dejó sonar la página nueva; la música retoma con el primer toque */
.mt-sigil.waiting { color: #ecd2a0; border-color: #d7b780 !important; }
.mt-sigil.waiting .mt-sigil-wave { opacity: 0.55; }
@media (prefers-reduced-motion: no-preference) {
  .mt-sigil.waiting { animation: mt-sigil-espera 1.8s ease-in-out infinite; }
}
@keyframes mt-sigil-espera {
  0%, 100% { box-shadow: 0 0 0 0 #d7b78055; }
  50% { box-shadow: 0 0 0 9px #d7b78000; }
}

/* --- Paso entre páginas con la música encendida (publication-sound.js) ---
   Velo: la pantalla se oscurece 0,45 s mientras la música se apaga y se amortigua; luego cambia de página.
   (Se probó @view-transition entre documentos y se retiró: Chrome la abortaba con «Page already revealed».) */
.mt-velo-salida {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #050605;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.mt-velo-salida.on { opacity: 0.62; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) {
  .mt-velo-salida { display: none; }
}

/* Móvil: WhatsApp y carrito más pequeños, centrados sobre el sello (2026-11-11). */
@media (max-width: 600px) {
  .atmosphere-control :is(.floating-whatsapp, .floating-cart) {
    right: 7px;
    width: 42px;
    height: 42px;
    min-height: 42px;
  }
  .atmosphere-control .floating-whatsapp {
    bottom: calc(100% + 78px);
  }
  .atmosphere-control .floating-cart {
    bottom: calc(100% + 24px);
  }
  :is(.floating-whatsapp, .floating-cart) .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
  }
}
