/* ============================================================
   utilities.css — Clases helper
   Flex, grid, spacing, text, display, etc.
   No añadir lógica visual compleja aquí → va en components.css
   ============================================================ */

/* ── Display ─────────────────────────────────────────────────── */
.d-none    { display: none !important; }
.d-block   { display: block; }
.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-inline  { display: inline; }
.d-inline-flex  { display: inline-flex; }
.d-inline-block { display: inline-block; }

/* ── Flex ────────────────────────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1      { flex: 1; }
.flex-auto   { flex: auto; }
.flex-shrink-0 { flex-shrink: 0; }

.items-start   { align-items: flex-start; }
.items-center  { align-items: center; }
.items-end     { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }

.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-5  { gap: var(--space-5); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }

/* ── Grid ────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); }

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ── Padding ─────────────────────────────────────────────────── */
.p-0  { padding: 0; }
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }

.px-2  { padding-left: var(--space-2);  padding-right: var(--space-2); }
.px-3  { padding-left: var(--space-3);  padding-right: var(--space-3); }
.px-4  { padding-left: var(--space-4);  padding-right: var(--space-4); }
.px-5  { padding-left: var(--space-5);  padding-right: var(--space-5); }
.px-6  { padding-left: var(--space-6);  padding-right: var(--space-6); }

.py-2  { padding-top: var(--space-2);  padding-bottom: var(--space-2); }
.py-3  { padding-top: var(--space-3);  padding-bottom: var(--space-3); }
.py-4  { padding-top: var(--space-4);  padding-bottom: var(--space-4); }
.py-5  { padding-top: var(--space-5);  padding-bottom: var(--space-5); }
.py-6  { padding-top: var(--space-6);  padding-bottom: var(--space-6); }

/* ── Margin ──────────────────────────────────────────────────── */
.m-0  { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.mt-0  { margin-top: 0; }
.mt-2  { margin-top: var(--space-2); }
.mt-3  { margin-top: var(--space-3); }
.mt-4  { margin-top: var(--space-4); }
.mt-5  { margin-top: var(--space-5); }
.mt-6  { margin-top: var(--space-6); }
.mt-7  { margin-top: var(--space-7); }
.mt-8  { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }

.mb-2  { margin-bottom: var(--space-2); }
.mb-3  { margin-bottom: var(--space-3); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-5  { margin-bottom: var(--space-5); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-7  { margin-bottom: var(--space-7); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }

/* ── Tipografía ──────────────────────────────────────────────── */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }

.font-light     { font-weight: var(--weight-light); }
.font-regular   { font-weight: var(--weight-regular); }
.font-medium    { font-weight: var(--weight-medium); }
.font-semibold  { font-weight: var(--weight-semibold); }
.font-bold      { font-weight: var(--weight-bold); }
.font-extrabold { font-weight: var(--weight-extrabold); }

.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

.tracking-wide  { letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.08em; }

.leading-tight  { line-height: var(--leading-tight); }
.leading-snug   { line-height: var(--leading-snug); }
.leading-normal { line-height: var(--leading-normal); }

/* ── Colores de texto ────────────────────────────────────────── */
.text-primary { color: var(--color-text); }
.text-soft    { color: var(--color-text-soft); }
.text-muted   { color: var(--color-text-muted); }
.text-green   { color: var(--color-green); }
.text-blue    { color: var(--color-blue); }
.text-red     { color: var(--color-red); }
.text-amber   { color: var(--color-amber); }

/* ── Truncar texto ───────────────────────────────────────────── */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Ancho / alto ────────────────────────────────────────────── */
.w-full    { width: 100%; }
.h-full    { height: 100%; }
.w-auto    { width: auto; }
.min-w-0   { min-width: 0; }

/* ── Posición ────────────────────────────────────────────────── */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { inset: 0; }

/* ── Overflow ────────────────────────────────────────────────── */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ── Pointer ─────────────────────────────────────────────────── */
.pointer       { cursor: pointer; }
.pointer-none  { pointer-events: none; }

/* ── Animaciones de entrada ──────────────────────────────────── */
.animate-fade-up { animation: fadeUp 0.5s ease both; }
.animate-fade-in { animation: fadeIn 0.3s ease both; }

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.10s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.20s; }
.delay-5 { animation-delay: 0.25s; }

/* ── Visibility helpers ──────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Responsive: hide/show ───────────────────────────────────── */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 641px) {
  .show-mobile-only { display: none !important; }
}
@media (max-width: 768px) {
  .hide-tablet { display: none !important; }
}

/* ── Separadores de sección ──────────────────────────────────── */
.section { margin-bottom: var(--space-10); }
.section--sm { margin-bottom: var(--space-6); }
.section--lg { margin-bottom: var(--space-16); }
