/* ==========================================================================
   HEADER.CSS — LEGADO DULCE
   Estilos del header, paneles laterales y ajustes globales.
   ========================================================================== */

/* --- Modificadores globales de tamaño de texto --- */
html.texto-sm { font-size: 87.5%; }
html.texto-md { font-size: 100%; }
html.texto-lg { font-size: 112.5%; }
html.texto-xl { font-size: 125%; }

/* --- HEADER --- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: transparent;
  transition: background-color 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,6,3,0.6) 0%, rgba(11,6,3,0) 100%);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.35s ease;
}

.header.scrolled {
  background: var(--cafe-espresso);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  padding: 0.5rem 1rem;
}

.header.scrolled::before { opacity: 0; }

.header-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-ancho);
  margin: 0 auto;
}

.header-logo {
  display: block;
  height: 80px;
  transition: height 0.35s ease;
}

.header-logo img {
  height: 100%;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.header.scrolled .header-logo { height: 56px; }

.header-acciones {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(11, 6, 3, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 209, 74, 0.15);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.header.scrolled .header-acciones {
  background: transparent;
  border-color: transparent;
}

.header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dorado-brillante);
  border-radius: 50%;
  transition: transform 0.25s ease, color 0.25s ease;
}

.header-btn:hover, .header-btn:active {
  transform: scale(1.08);
  color: var(--dorado-crema);
}

.header-btn-sello { width: 46px; height: 46px; }

/* --- OVERLAY --- */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 150;
}

.panel-overlay.activo { opacity: 1; visibility: visible; }

/* --- PANELES (base común) --- */
.panel {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--cafe-espresso);
  color: var(--blanco);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1.5rem;
  overflow-y: auto;
  box-shadow: -20px 0 60px rgba(0,0,0,0.4);
}

.panel.activo { transform: translateX(0); }

.panel-menu,
.panel-ajustes { width: 58%; max-width: 260px; }

.panel-cabeza {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(248, 209, 74, 0.15);
  margin-bottom: 1.75rem;
}

.panel-marca {
  font-family: var(--fuente-titulo);
  font-size: 1rem;
  font-style: italic;
  color: var(--dorado-brillante);
  letter-spacing: 0.08em;
}

.panel-cerrar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dorado-crema);
  border-radius: 50%;
  border: 1px solid rgba(248, 209, 74, 0.25);
  transition: var(--transicion);
}

.panel-cerrar:hover {
  background: var(--dorado-brillante);
  color: var(--cafe-espresso);
  border-color: var(--dorado-brillante);
}

/* --- NAV del panel menú --- */
.panel-nav {
  display: flex;
  flex-direction: column;
}

.panel-nav a {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.9rem 0;
  font-family: var(--fuente-titulo);
  font-size: 1.4rem;
  color: var(--blanco);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: padding 0.3s ease, color 0.3s ease;
}

.panel-nav a span {
  font-family: var(--fuente-cuerpo);
  font-size: 0.7rem;
  color: var(--dorado-profundo);
  letter-spacing: 0.15em;
  font-weight: 500;
}

.panel-nav a:hover, .panel-nav a:active {
  padding-left: 0.75rem;
  color: var(--dorado-brillante);
}

.panel-nav a:hover span, .panel-nav a:active span {
  color: var(--dorado-brillante);
}

.panel-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.95rem 1.25rem;
  background: var(--dorado-profundo);
  color: var(--cafe-espresso) !important;
  font-family: var(--fuente-cuerpo);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: var(--transicion);
}

.panel-cta:hover, .panel-cta:active {
  background: var(--dorado-brillante);
  letter-spacing: 0.2em;
}

/* --- Redes en panel menú --- */
.panel-redes-bloque {
  padding-top: 1.75rem;
}

.panel-redes-titulo {
  display: block;
  font-size: 0.78rem;
  color: rgba(252, 250, 165, 0.6);
  margin-bottom: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-redes {
  display: flex;
  gap: 0.5rem;
}

.panel-redes a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248, 209, 74, 0.3);
  border-radius: 50%;
  font-family: var(--fuente-cuerpo);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--dorado-brillante);
  transition: var(--transicion);
}

.panel-redes a:hover, .panel-redes a:active {
  background: var(--dorado-brillante);
  color: var(--cafe-espresso);
  border-color: var(--dorado-brillante);
}

/* --- AJUSTES --- */
.ajuste {
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.ajuste:last-of-type { border-bottom: none; }

.ajuste-label {
  display: block;
  font-size: 0.78rem;
  color: rgba(252, 250, 165, 0.6);
  margin-bottom: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ajuste-fila .ajuste-label { margin-bottom: 0.75rem; }

.ajuste-tamanos {
  display: flex;
  gap: 0.4rem;
}

.ajuste-tamanos button {
  flex: 1;
  padding: 0.65rem 0.4rem;
  background: transparent;
  border: 1px solid rgba(248, 209, 74, 0.25);
  color: var(--blanco);
  font-family: var(--fuente-titulo);
  font-weight: 600;
  border-radius: 2px;
  transition: var(--transicion);
}

.ajuste-tamanos button[data-tamano="sm"] { font-size: 0.85rem; }
.ajuste-tamanos button[data-tamano="md"] { font-size: 1rem; }
.ajuste-tamanos button[data-tamano="lg"] { font-size: 1.25rem; }
.ajuste-tamanos button[data-tamano="xl"] { font-size: 1.5rem; }

.ajuste-tamanos button:hover {
  border-color: var(--dorado-brillante);
  color: var(--dorado-brillante);
}

.ajuste-tamanos button.activo {
  background: var(--dorado-profundo);
  border-color: var(--dorado-brillante);
  color: var(--cafe-espresso);
}

.ajuste-toggle {
  width: 100%;
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 2px;
  color: rgba(255,255,255,0.4);
  font-family: var(--fuente-cuerpo);
  font-size: 0.8rem;
  font-style: italic;
  letter-spacing: 0.05em;
  cursor: not-allowed;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.15);
  transition: 0.3s;
  border-radius: 26px;
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--blanco);
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .switch-slider { background: var(--dorado-profundo); }
.switch input:checked + .switch-slider::before {
  transform: translateX(22px);
  background: var(--dorado-brillante);
}

/* Compartir */
.ajuste-accion {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.95rem 1rem;
  background: var(--dorado-profundo);
  color: var(--cafe-espresso);
  border-radius: 2px;
  font-family: var(--fuente-cuerpo);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: var(--transicion);
}

.ajuste-accion:hover {
  background: var(--dorado-brillante);
}

/* --- ALTO CONTRASTE (modificador del body) --- */
body.alto-contraste {
  --cafe-principal: #000000;
  --cafe-espresso: #000000;
  --dorado-profundo: #B26F00;
}

body.alto-contraste a:not(.panel-cta):not(.ajuste-accion):not(.header-logo):not(.panel-redes a):not(.header-btn):not(.panel-cerrar) {
  text-decoration: underline;
}

/* --- TABLET --- */
@media (min-width: 768px) and (max-width: 1023px) {
  .panel-menu,
  .panel-ajustes { width: 45%; max-width: 340px; }
}

/* --- DESKTOP --- */
@media (min-width: 1024px) {
  .header { padding: 1rem 2rem; }
  .header.scrolled { padding: 0.6rem 2rem; }

  .header-logo { height: 96px; }
  .header.scrolled .header-logo { height: 64px; }

  .panel-menu,
  .panel-ajustes { width: 28%; max-width: 380px; }

  .panel { padding: 1.5rem 1.75rem 2rem; }

  .panel-nav a { font-size: 1.6rem; padding: 1.1rem 0; }
}
