/* Fuentes de marca auto-hospedadas (sin Google Fonts ni cambios de CSP).
   Barlow Condensed = títulos · Barlow = cuerpo. */
@import '@fontsource/barlow/400.css';
@import '@fontsource/barlow/500.css';
@import '@fontsource/barlow/600.css';
@import '@fontsource/barlow/700.css';
@import '@fontsource/barlow-condensed/600.css';
@import '@fontsource/barlow-condensed/700.css';
@import '@fontsource/barlow-condensed/800.css';

/* Peninsula Fitness — sistema base mobile-first.
   Tono: industrial premium, deportivo, contrastes fuertes, botones claros. */

/* Tokens — mismo sistema que el sitio público (src/styles/pf.css). Tema oscuro. */
:root {
  --pf-bg: #0e0f12;
  --pf-bg-2: #121319;
  --pf-surface: #16181d;
  --pf-surface-2: #1e2129;
  --pf-surface-3: #23262f;
  --pf-border: #2a2e38;
  --pf-border-2: #353a47;
  --pf-text: #f4f5f7;
  --pf-text-dim: #a6adbb;
  --pf-text-mut: #767d8c;
  /* Marca Peninsula Fitness (azul/índigo) */
  --pf-accent: #2e2ed6;
  --pf-accent-700: #3636c1;
  --pf-accent-300: #8a8aff;
  --pf-accent-text: #8a8aff;
  --pf-accent-soft: rgba(46, 46, 214, 0.14);
  --pf-success: #2ecc71;
  --pf-warning: #f1c40f;
  --pf-danger: #ff7a8a;
  --pf-card-grad: linear-gradient(180deg, #181b22, var(--pf-surface));
  --pf-radius: 12px;
  --pf-radius-sm: 8px;
  --pf-radius-lg: 22px;
  --pf-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --pf-shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.65);
  --pf-maxw: 1760px;
  --pf-font: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  --pf-font-head: 'Barlow Condensed', 'Barlow', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

/* Tema claro (toggle en el header del CRM, persistido en localStorage). */
[data-theme='light'] {
  --pf-bg: #f1f2f5;
  --pf-bg-2: #e9ebef;
  --pf-surface: #ffffff;
  --pf-surface-2: #f3f4f7;
  --pf-surface-3: #e8eaef;
  --pf-border: #dde0e7;
  --pf-border-2: #cfd3dc;
  --pf-text: #14161b;
  --pf-text-dim: #565d6b;
  --pf-text-mut: #8a909d;
  --pf-accent-700: #2222a4;
  --pf-accent-300: #4b4bdd;
  --pf-accent-text: #2424b8;
  --pf-accent-soft: rgba(46, 46, 214, 0.09);
  --pf-success: #18a85b;
  --pf-warning: #b7860b;
  --pf-danger: #d23048;
  --pf-card-grad: linear-gradient(180deg, #ffffff, #f6f7fa);
  --pf-shadow: 0 8px 26px rgba(20, 30, 60, 0.1);
  --pf-shadow-lg: 0 30px 70px -24px rgba(20, 30, 60, 0.28);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--pf-font);
  background: var(--pf-bg);
  color: var(--pf-text);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

img {
  max-width: 100%;
  display: block;
}

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

h1,
h2,
h3 {
  font-family: var(--pf-font-head);
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: 0; /* la condensada ya es estrecha; sin tracking negativo */
  text-transform: none;
}

.container {
  width: 90%;
  max-width: var(--pf-maxw);
  margin: 0 auto;
  padding: 0;
}
/* En móvil usamos casi todo el ancho con un mínimo de respiro lateral. */
@media (max-width: 600px) {
  .container {
    width: 100%;
    padding: 0 14px;
  }
}

/* ---- Botones (mínimo 44px alto, mobile-first) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--pf-radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border 0.15s ease;
  width: 100%;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--pf-accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--pf-accent-700);
}
.btn-secondary {
  background: transparent;
  color: var(--pf-text);
  border-color: var(--pf-border);
}
.btn-secondary:hover {
  border-color: var(--pf-text-dim);
}
.btn-whatsapp {
  background: #25d366;
  color: #08240f;
}

@media (min-width: 640px) {
  .btn {
    width: auto;
  }
}

/* ---- Tarjetas ---- */
.card {
  background: var(--pf-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  overflow: hidden;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--pf-bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--pf-border);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
/* Marca igual que el sitio público (mark + wordmark + subtítulo). */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}
.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}
.brand-word {
  font-family: var(--pf-font-head);
  font-weight: 800;
  font-size: 1.28rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
.brand-word .dot {
  color: var(--pf-accent-text);
}
.brand-word small {
  display: block;
  font-family: var(--pf-font);
  font-weight: 600;
  font-size: 0.52rem;
  letter-spacing: 0.34em;
  color: var(--pf-text-mut);
  margin-top: 3px;
}
/* En el footer el wordmark no lleva subtítulo */
.footer-brand .brand-word small {
  display: none;
}
@media (max-width: 640px) {
  .brand-word {
    font-size: 1.05rem;
  }
  .crm-user,
  .crm-site-link {
    display: none;
  }
}
.nav-links {
  display: none;
  gap: 20px;
  align-items: center;
}
.nav-links a {
  color: var(--pf-text-dim);
  font-weight: 600;
}
.nav-links a:hover {
  color: var(--pf-text);
}
@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

/* ---- Botón de icono (toggle de tema) ---- */
.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--pf-radius-sm);
  background: var(--pf-surface-2);
  border: 1px solid var(--pf-border);
  cursor: pointer;
  color: var(--pf-text);
  transition: background 0.2s ease, transform 0.15s ease;
}
.icon-btn:hover {
  background: var(--pf-surface-3);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ---- Hero ---- */
.hero {
  padding: 48px 0 32px;
}
.hero h1 {
  font-size: clamp(2.1rem, 8.5vw, 3.6rem);
  font-weight: 800;
  text-transform: uppercase;
}
.hero p {
  color: var(--pf-text-dim);
  font-size: 1.05rem;
  max-width: 60ch;
}
.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
@media (min-width: 640px) {
  .hero-cta {
    flex-direction: row;
  }
}

/* ---- Grid de productos ---- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 8px;
  height: 100%;
}
.product-card .pc-cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pf-accent-300);
  font-weight: 700;
}
.product-card h3 {
  font-size: 1.05rem;
  margin: 0;
}
.product-card .pc-meta {
  color: var(--pf-text-dim);
  font-size: 0.85rem;
}
.product-card .pc-price {
  font-family: var(--pf-font-head);
  margin-top: auto;
  font-weight: 700;
  font-size: 1.25rem;
}
.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.badge-specialist {
  background: rgba(241, 196, 15, 0.15);
  color: var(--pf-warning);
}
.badge-quotable {
  background: rgba(46, 204, 113, 0.15);
  color: var(--pf-success);
}

/* ---- Secciones ---- */
.section {
  padding: 32px 0;
}
.section h2 {
  font-size: 1.5rem;
}
.muted {
  color: var(--pf-text-dim);
}

/* ---- Chips de categoría / filtros ---- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.chip {
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--pf-border);
  color: var(--pf-text-dim);
  font-size: 0.85rem;
  font-weight: 600;
}
.chip[aria-current='true'] {
  background: var(--pf-accent);
  color: #fff;
  border-color: var(--pf-accent);
}

/* ---- Formularios ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pf-text-dim);
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--pf-surface-2);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-sm);
  color: var(--pf-text);
  font-size: 1rem;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid var(--pf-accent);
  outline-offset: 1px;
}
.field-error {
  color: #ff7a8a;
  font-size: 0.8rem;
}

/* ---- Footer (mismo estilo que el sitio público, adaptado al CRM) ---- */
.site-footer {
  background: var(--pf-bg-2);
  border-top: 1px solid var(--pf-border);
  padding-block: 44px 24px;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
}
@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 40px;
  }
}
.footer-brand .brand {
  margin-bottom: 14px;
}
.footer-brand p {
  color: var(--pf-text-dim);
  max-width: 320px;
  font-size: 0.9rem;
}
.footer-claims {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.footer-claims span {
  font-size: 0.74rem;
  color: var(--pf-text-dim);
  border: 1px solid var(--pf-border);
  border-radius: 999px;
  padding: 5px 11px;
}
.footer-col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--pf-text-mut);
  margin-bottom: 14px;
  font-family: var(--pf-font);
  font-weight: 700;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col a {
  color: var(--pf-text-dim);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.footer-col a:hover {
  color: var(--pf-accent-text);
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--pf-border);
  color: var(--pf-text-mut);
  font-size: 0.82rem;
}
.flag-ca {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--pf-text-dim);
}

/* ---- Tablas CRM ---- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 560px;
}
table.data th,
table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--pf-border);
}
table.data th {
  color: var(--pf-text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- KPIs ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
.kpi {
  padding: 16px;
  background: var(--pf-card-grad);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
}
.kpi .kpi-value {
  font-family: var(--pf-font-head);
  font-size: 1.9rem;
  font-weight: 700;
}
.kpi .kpi-label {
  color: var(--pf-text-dim);
  font-size: 0.8rem;
}

/* ---- Notas / avisos ---- */
.notice {
  padding: 12px 14px;
  border-radius: var(--pf-radius-sm);
  border: 1px solid var(--pf-border);
  background: var(--pf-surface-2);
  font-size: 0.9rem;
  color: var(--pf-text-dim);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
