/* =========================================================
   SISTEMA DE COLORES Y VARIABLES
   ========================================================= */
:root {
  --bg: #f7f8fb;
  --ink: #1e1e1e;
  --muted: #6b7280;

  --primary: #243c8f;
  --primary-700: #1d2f6f;

  --surface: #ffffff;
  --surface-soft: #f4f5f9;
  --surface-alt: #f0f1f6;

  --border: #e5e7eb;
  --border-soft: #eceef3;

  --radius-lg: 18px;
  --radius-md: 12px;

  --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 24px rgba(0,0,0,0.09);

  --font: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
}

/* =========================================================
   BASE
   ========================================================= */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

.page-header {
  padding: 2.2rem 1rem 1.4rem;
  text-align: center;
}
.page-header h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: .3px;
}
.lead {
  margin: 0.35rem auto 1.6rem;
  color: var(--muted);
  max-width: 700px;
}

/* =========================================================
   TABS NAVIGATION
   ========================================================= */
.tabs {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
  flex-wrap: wrap;
}
.tab {
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  background: #efefef;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.25s;
}
.tab:hover {
  background: #e6e6e6;
}
.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tab-panel {
  display: none;
  max-width: 1180px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}
.tab-panel.active {
  display: block;
}

/* =========================================================
   NUEVA TARJETA GENERAL — section-box
   ========================================================= */
.section-box {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.3rem 1.5rem;
  margin: 2rem 0 2.5rem;
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   FRAMEWORK CARD
   ========================================================= */
.framework-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow-sm);
}
.fw-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.fw-title { margin: 0.2rem 0 0; }
.fw-desc { margin: 0.25rem 0; color: var(--muted); }
.fw-icon { width: 32px; height: 32px; }
.fw-link {
  margin-left: auto;
  text-decoration: none;
  background: #efefef;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  color: #111;
  border: 1px solid var(--border);
}

/* =========================================================
   CÓDIGO — CAJAS HOMOGÉNEAS
   ========================================================= */
.code-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 1rem;
}

.code-col {
  display: grid;
  gap: 1.2rem;
}

.code-box {
  background: #0f172a;
  color: #f1f5f9;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #1e293b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.22);
}

.code-header {
  background: #1e293b;
  padding: 0.6rem .95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #cbd5e1;
  border-bottom: 1px solid #0b1220;
}

.copy-btn {
  background: #334155;
  border: 1px solid #475569;
  color: #e2e8f0;
  padding: 0.32rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.25s;
}
.copy-btn:hover {
  background: #475569;
}

pre {
  margin: 0;
  padding: 1rem;
  max-height: 250px;
  overflow: auto;
  font-family: "Fira Code", monospace;
  font-size: 0.9rem;
}

/* =========================================================
   PREVIEW CARD (IFRAME)
   ========================================================= */
.preview-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.4rem 0;
  box-shadow: var(--shadow-sm);
}

.preview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-soft);
  padding: .95rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}

.preview-card iframe {
  width: 100%;
  border: none;
  display: block;
}

.simulate-mobile {
  width: 390px !important;
  border-radius: 20px;
  margin: 1rem auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

/* =========================================================
   DESCRIPCIÓN
   ========================================================= */
.desc-and-code {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.4rem;
}
.desc-box {
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   BOTÓN CAMBIAR VISTA (UNIFICADO)
   ========================================================= */
.toggle-btn {
  background: var(--primary);
  border: none;
  color: white;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  transition: 0.25s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.toggle-btn:hover {
  background: var(--primary-700);
}

/* =========================================================
   INTERACCIONES (SE MANTIENEN SIN SECTION-BOX)
   ========================================================= */
.inter-item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  margin-bottom: 1.8rem;
  box-shadow: var(--shadow-sm);
}

.btn-link {
  display: inline-block;
  margin-top: .6rem;
  padding: .55rem .95rem;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
}
.btn-link:hover { background: var(--primary-700); }

/* =========================================================
   SITIOS
   ========================================================= */

.sites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.site-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.site-thumb {
  position: relative;
  aspect-ratio: 4/3;
  background: #eaeaea;
}

.site-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.site-link-icon {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 0.25rem 0.35rem;
  opacity: 0;
  transition: 0.25s;
}

.site-card:hover .site-link-icon {
  opacity: 1;
}

.site-meta {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
}

.site-name {
  font-weight: 700;
}

.site-cat {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 860px) {
  .sites-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .sites-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 860px) {
  .code-pair { grid-template-columns: 1fr; }
  .desc-and-code { grid-template-columns: 1fr; }
  .sites-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 560px) {
  .sites-grid { grid-template-columns: 1fr; }
}
