/* ============================================================
   LAYOUT — LENTIFLIX
   Shell principal: header, main, footer, toasts, selector tienda
   ============================================================ */

/* ─── Header ────────────────────────────────────────────────── */
.app-header {
  height: 78px;
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.header-logo {
  height: 40px;
  border-radius: var(--radius-md);
  padding: 0.5em;
  background-color: white;
}

.header-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* ─── Franja de la demo (SDD-0003) ──────────────────────────── */
.demo-franja {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  padding: 8px 16px;
  background-color: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  color: #78350f;
  font-size: .9rem;
  text-align: center;
}

.demo-franja__boton {
  padding: 4px 12px;
  border: 1px solid #b45309;
  border-radius: var(--radius-sm);
  background-color: #fff;
  color: #78350f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.demo-franja__boton:hover:not(:disabled) {
  background-color: #fde68a;
}

.demo-franja__boton:disabled {
  opacity: .6;
  cursor: wait;
}

/* ─── Navegación ─────────────────────────────────────────────── */
.header-nav {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 999px;
  transition: background .2s ease, transform .1s ease;
}
.nav-link:hover  { background: rgba(255, 255, 255, .18); }
.nav-link:active { transform: scale(.98); }

.nav-link.is-active {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
/* Los iconos (Administración, Mi cuenta) no llevan subrayado: se marcan con fondo (G-14) */
.nav-link.is-active:has(img, svg) {
  background: rgba(255, 255, 255, .22);
}

/* ─── Body / Main ────────────────────────────────────────────── */
body {
  margin: 0;
  background: var(--color-bg);
  font-family: var(--font-base);
}

.app-main { padding: 18px; }

.app-container {
  max-width: 90%;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
}

/* ─── Footer ─────────────────────────────────────────────────── */
.app-footer {
  margin-top: 24px;
  padding: 16px 0;
  background: transparent;
  color: var(--color-muted);
  font-size: 13px;
}

.app-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.footer-separator { opacity: .4; }

/* ─── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  min-width: 260px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .95rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-success { background: #4cc278; color: #ffffff; }
.toast-error   { background: #ff4646; color: #ffffff; }

/* ─── Selector de tienda (header centro) ────────────────────── */
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.tienda-selector { position: relative; }

/* Botón actual — glass blanco sobre el azul del header */
.tienda-selector__current {
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: 600;
  white-space: nowrap;
  padding: 10px 14px;
  transition: background .15s ease, border-color .15s ease;
  user-select: none;
}
.tienda-selector__current:hover {
  background: rgba(255, 255, 255, .24);
  border-color: rgba(255, 255, 255, .40);
}

.tienda-selector__chevron {
  transition: transform .2s ease;
  opacity: .80;
  flex-shrink: 0;
}
.tienda-selector.is-open .tienda-selector__chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.tienda-selector__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 999;
  animation: dropIn .15s ease-out;
}
.tienda-selector.is-open .tienda-selector__dropdown { display: block; }

@keyframes dropIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.tienda-selector__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: .90rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  transition: background .12s ease;
  border-bottom: 1px solid var(--color-border-soft);
}
.tienda-selector__option:last-child { border-bottom: none; }
.tienda-selector__option:hover      { background: var(--color-resaltado); }

.tienda-selector__option.is-active {
  background: var(--color-primary-soft);
  font-weight: 700;
  color: var(--color-primary);
}

.tienda-selector__check {
  width: 16px;
  font-size: .85rem;
  color: var(--color-primary);
  font-weight: 800;
  flex-shrink: 0;
}

/* Una sola tienda: texto estático */
.tienda-nombre-solo {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  font-size: 1.1em;
  font-weight: 600;
  white-space: nowrap;
}
