/* ============================================================
   ALOHA BRANDS — Logística
   Tokens heredados de aloha-brands-website/css/style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Montserrat:wght@300;400;500;600;700&family=Inter:wght@300;400;500&display=swap');

:root {
  --black:        #080808;
  --black-rich:   #0d0c0b;
  --charcoal:     #161412;
  --charcoal-mid: #1e1c19;
  --warm-dark:    #252219;
  --gold:         #c9a84c;
  --gold-light:   #e2c46d;
  --gold-pale:    #f0dfa0;
  --gold-dim:     #8c6e2a;
  --bronze:       #7a5c1e;
  --ivory:        #f4efe4;
  --ivory-warm:   #ede5d0;
  --ivory-dim:    #d4c9b0;
  --white:        #ffffff;

  --rojo:   #c0522e;
  --verde:  #5a8a5c;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-sans:    'Montserrat', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --linea: 1px solid rgba(201, 168, 76, 0.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background: var(--black-rich);
  color: var(--ivory);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
}

img { display: block; max-width: 100%; height: auto; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; }

/* ── Micro-etiquetas ─────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

/* ── Botones ─────────────────────────────────────────────── */
.btn {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.72rem 1.5rem;
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
  background: transparent;
  transition: all 260ms var(--ease-out);
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--gold); border-color: var(--gold); color: var(--black); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-solid { background: var(--gold); border-color: var(--gold); color: var(--black); }
.btn-solid:hover:not(:disabled) { background: var(--gold-light); border-color: var(--gold-light); }
.btn-ghost { border-color: rgba(244, 239, 228, 0.2); color: var(--ivory-dim); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ivory-dim); background: transparent; color: var(--ivory); }
.btn-peligro { border-color: rgba(192, 82, 46, 0.5); color: #d97a55; }
.btn-peligro:hover:not(:disabled) { background: var(--rojo); border-color: var(--rojo); color: var(--white); }
.btn-sm { padding: 0.42rem 0.9rem; font-size: 0.64rem; }

/* ── Campos ──────────────────────────────────────────────── */
input[type=text], input[type=password], input[type=number], select, textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(244, 239, 228, 0.14);
  padding: 0.66rem 0.85rem;
  width: 100%;
  transition: border-color 200ms var(--ease-out);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
input::placeholder { color: rgba(212, 201, 176, 0.35); }
label.campo { display: block; }
label.campo > span { display: block; margin-bottom: 0.3rem; }

/* ── Loader ──────────────────────────────────────────────── */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--black-rich);
  display: grid; place-items: center;
  transition: opacity 500ms var(--ease-out);
}
#loader.fuera { opacity: 0; pointer-events: none; }
#loader img { width: 180px; opacity: 0.85; animation: pulso 1.8s ease-in-out infinite; }
@keyframes pulso { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }

/* ── Puerta de entrada ───────────────────────────────────── */
#gate {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 168, 76, 0.08), transparent 60%),
    var(--black-rich);
}
.gate-caja { width: min(380px, 100%); text-align: center; }
.gate-caja img { width: 220px; margin: 0 auto 2.4rem; }
.gate-caja .eyebrow { margin-bottom: 2rem; }
.gate-caja input { margin-bottom: 0.7rem; text-align: center; }
.gate-caja .btn { width: 100%; margin-top: 0.5rem; }
.gate-msg { min-height: 1.4rem; margin-top: 0.9rem; font-size: 0.84rem; color: #d97a55; }

.pw-envoltura { position: relative; }
.pw-envoltura input { padding-right: 3.6rem; }
.pw-ver {
  position: absolute; right: 0; top: 0; bottom: 0;
  padding: 0 0.9rem;
  font-family: var(--font-sans); font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-dim);
  transition: color 200ms var(--ease-out);
}
.pw-ver:hover, .pw-ver[aria-pressed="true"] { color: var(--gold-light); }

/* ── Barra superior ──────────────────────────────────────── */
#topbar {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.9rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: var(--linea);
  background: var(--black);
  position: sticky; top: 0; z-index: 40;
}
#topbar .marca { display: flex; align-items: center; gap: 0.9rem; }
#topbar .marca img { width: 108px; }
#topbar .marca .eyebrow { border-left: var(--linea); padding-left: 0.9rem; }
.espacio { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-sans); font-size: 0.68rem; letter-spacing: 0.08em;
  padding: 0.4rem 0.85rem;
  border: var(--linea);
  color: var(--ivory-dim);
  white-space: nowrap;
}
.chip .punto { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-dim); flex: none; }
.chip.ok .punto { background: var(--verde); }
.chip.mal .punto { background: var(--rojo); }
.chip button { color: var(--gold-light); font-size: 0.68rem; letter-spacing: 0.08em; text-decoration: underline; }

/* ── Navegación ──────────────────────────────────────────── */
#nav {
  display: flex; gap: 0.25rem; overflow-x: auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  border-bottom: var(--linea);
  background: var(--black);
  position: sticky; top: 61px; z-index: 39;
}
#nav button {
  font-family: var(--font-sans); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ivory-dim);
  padding: 0.95rem 1.15rem;
  border-bottom: 2px solid transparent;
  transition: all 220ms var(--ease-out);
  white-space: nowrap;
}
#nav button:hover { color: var(--ivory); }
#nav button.activa { color: var(--gold-light); border-bottom-color: var(--gold); }
#nav button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Contenido ───────────────────────────────────────────── */
main { padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2.5rem); max-width: 1400px; margin-inline: auto; }
.vista-cabeza { margin-bottom: 2rem; }
.vista-cabeza h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin-top: 0.35rem; }
.vista-cabeza p { color: var(--ivory-dim); font-size: 0.92rem; margin-top: 0.5rem; max-width: 62ch; }

.tarjeta {
  border: var(--linea);
  background: linear-gradient(180deg, rgba(255,255,255,0.022), transparent);
  padding: 1.6rem;
}
.tarjeta + .tarjeta { margin-top: 1rem; }
.tarjeta h2 { font-size: 1.15rem; margin-bottom: 0.9rem; }

.fila { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }
.rejilla { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ── Estado vacío ────────────────────────────────────────── */
.vacio { text-align: center; padding: clamp(2.5rem, 8vw, 5rem) 1.5rem; border: var(--linea); }
.vacio h2 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.vacio p { color: var(--ivory-dim); max-width: 52ch; margin: 0 auto 1.8rem; font-size: 0.93rem; }
.vacio .fila { justify-content: center; }

/* ── Tabla ───────────────────────────────────────────────── */
.tabla-envoltura { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
  font-family: var(--font-sans); font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dim);
  text-align: left; padding: 0.7rem 0.9rem; border-bottom: var(--linea); white-space: nowrap;
}
td { padding: 0.85rem 0.9rem; border-bottom: 1px solid rgba(244, 239, 228, 0.06); vertical-align: top; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td .sku { font-family: var(--font-sans); font-size: 0.74rem; letter-spacing: 0.08em; color: var(--gold-light); }
td .meta { font-size: 0.74rem; color: rgba(212, 201, 176, 0.55); }

/* ── Marco de imagen (catálogo) ──────────────────────────── */
.img-marco {
  aspect-ratio: 4 / 3;
  border: var(--linea);
  background: rgba(255, 255, 255, 0.02);
  display: grid; place-items: center;
  overflow: hidden;
}
.img-marco img { width: 100%; height: 100%; object-fit: cover; }
.img-marco .meta { text-align: center; padding: 0 .5rem; }
.img-marco-sm { width: 52px; aspect-ratio: 1; }

/* ── Etiquetas de estado ─────────────────────────────────── */
.etiqueta {
  display: inline-block;
  font-family: var(--font-sans); font-size: 0.6rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.24rem 0.6rem; border: 1px solid currentColor; white-space: nowrap;
}
.etiqueta.ok    { color: #7aa87c; }
.etiqueta.aviso { color: var(--gold); }
.etiqueta.mal   { color: #d97a55; }
td .detalle { margin-top: 0.45rem; line-height: 1.5; max-width: 42ch; }

/* ── Nota / advertencia ──────────────────────────────────── */
.nota {
  border-left: 2px solid var(--gold-dim);
  background: rgba(201, 168, 76, 0.05);
  padding: 0.9rem 1.1rem;
  font-size: 0.87rem;
  color: var(--ivory-dim);
}
.nota.mal { border-left-color: var(--rojo); background: rgba(192, 82, 46, 0.07); }
.nota strong { color: var(--ivory); font-weight: 500; }

/* ── Avisos flotantes ────────────────────────────────────── */
#avisos { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 80; display: grid; gap: 0.5rem; justify-items: end; }
.aviso {
  font-family: var(--font-sans); font-size: 0.78rem; letter-spacing: 0.03em;
  background: var(--charcoal-mid); border: var(--linea); border-left-width: 2px;
  color: var(--ivory); padding: 0.75rem 1.1rem; max-width: 340px;
  opacity: 0; transform: translateY(8px); transition: all 320ms var(--ease-out);
}
.aviso.entra { opacity: 1; transform: none; }
.aviso-ok { border-left-color: var(--verde); }
.aviso-error { border-left-color: var(--rojo); }
.aviso-info { border-left-color: var(--gold); }

[hidden] { display: none !important; }

/* ── Impresión / PDF (paso 7) ────────────────────────────
   window.print() + @media print: sin dependencias. El contenido vive en
   #areaImprimir (invisible en pantalla) y solo aparece al imprimir. */
#areaImprimir { display: none; }

@media print {
  body * { visibility: hidden; }
  #areaImprimir, #areaImprimir * { visibility: visible; }
  #areaImprimir {
    display: block; position: absolute; top: 0; left: 0; width: 100%;
    background: #fff; color: #111; font-family: var(--font-body); font-size: 11pt;
  }
  @page { size: letter; margin: 1.5cm; }

  .pdf-encabezado { display: flex; justify-content: space-between; align-items: flex-start;
    border-bottom: 2px solid #111; padding-bottom: .5rem; margin-bottom: 1rem; }
  .pdf-logo { max-width: 180px; max-height: 70px; }
  .pdf-datos-empresa { font-size: 8pt; text-align: right; line-height: 1.4; }
  .pdf-titulo { font-family: var(--font-display); font-size: 16pt; margin-top: .5rem; }
  .pdf-subtitulo { font-size: 11pt; color: #333; margin-bottom: 1rem; }
  .pdf-galeria { display: flex; gap: .5rem; margin-bottom: 1rem; }
  .pdf-foto { width: 110px; height: 110px; object-fit: cover; border: 1px solid #ccc; }
  .pdf-render { width: 100%; max-height: 300px; object-fit: contain; border: 1px solid #ccc; margin-bottom: 1rem; }
  #areaImprimir h2 { font-family: var(--font-display); font-size: 12pt; margin: 1rem 0 .4rem; color: #111; }
  .pdf-tabla { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 9.5pt; }
  .pdf-tabla th, .pdf-tabla td { border: 1px solid #ccc; padding: .3rem .6rem; text-align: left; }
  .pdf-tabla th { width: 40%; background: #f2f2f2; font-weight: 600; }
  .pdf-tabla-patrones th, .pdf-tabla-patrones td { width: auto; }
  .pdf-nota { font-size: 9pt; margin-top: .5rem; }
  .pdf-nota-mal { color: #a33; }
  .pdf-pie { margin-top: 2rem; font-size: 7.5pt; color: #666; border-top: 1px solid #ccc; padding-top: .4rem; }
}
