/* ============================================
   LAYOUT
   ============================================ */

/* ============================================
   CONTENEDOR
   ============================================ */

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-fluid {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-md {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-lg {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ============================================
   FLEX
   ============================================ */

.flex {
  display: flex;
}

.flex-row {
  flex-direction: row;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-around {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.flex-end {
  justify-content: flex-end;
  align-items: center;
}

.flex-start {
  justify-content: flex-start;
  align-items: center;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }
.flex-auto { flex: auto; }

.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; }

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

/* ============================================
   GRID
   ============================================ */

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.grid-auto-sm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.grid-auto-lg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.grid-gap-sm { gap: var(--space-sm); }
.grid-gap-md { gap: var(--space-md); }
.grid-gap-lg { gap: var(--space-lg); }

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

/* ============================================
   SECCIONES
   ============================================ */

section {
  padding: var(--space-3xl) 0;
}

section.section-sm {
  padding: var(--space-xl) 0;
}

section.section-lg {
  padding: var(--space-3xl) var(--space-lg);
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-title h2 {
  margin-bottom: var(--space-md);
}

.section-title p {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   ALINEAMIENTO DE TEXTO
   ============================================ */

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

.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.text-white { color: white; }

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

.text-bold { font-weight: var(--font-weight-bold); }
.text-semibold { font-weight: var(--font-weight-semibold); }
.text-normal { font-weight: var(--font-weight-normal); }
.text-light { font-weight: var(--font-weight-light); }

.text-italic { font-style: italic; }
.text-decoration-none { text-decoration: none; }
.text-underline { text-decoration: underline; }

/* ============================================
   VISIBILIDAD
   ============================================ */

.hidden { display: none !important; }
.visible { display: block !important; }

.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;
}

/* ============================================
   BORDES Y SOMBRAS
   ============================================ */

.border {
  border: var(--border-width) solid var(--color-border);
}

.border-top {
  border-top: var(--border-width) solid var(--color-border);
}

.border-right {
  border-right: var(--border-width) solid var(--color-border);
}

.border-bottom {
  border-bottom: var(--border-width) solid var(--color-border);
}

.border-left {
  border-left: var(--border-width) solid var(--color-border);
}

.rounded {
  border-radius: var(--border-radius-md);
}

.rounded-sm {
  border-radius: var(--border-radius-sm);
}

.rounded-lg {
  border-radius: var(--border-radius-lg);
}

.rounded-full {
  border-radius: var(--border-radius-full);
}

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ============================================
   FONDOS
   ============================================ */

.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-accent { background-color: var(--color-accent); }
.bg-background { background-color: var(--color-background); }
.bg-surface { background-color: var(--color-surface); }

.bg-gradient-primary { background: var(--gradient-primary); }
.bg-gradient-accent { background: var(--gradient-accent); }
.bg-gradient-secondary { background: var(--gradient-secondary); }
.bg-gradient-hero { background: var(--gradient-hero); }

/* ============================================
   ANCHO Y ALTO
   ============================================ */

.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-auto { height: auto; }

.min-h-screen { min-height: 100vh; }
.min-h-full { min-height: 100%; }

/* ============================================
   OVERFLOW
   ============================================ */

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ============================================
   POSICIÓN
   ============================================ */

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* ============================================
   OPACIDAD
   ============================================ */

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */

@media (max-width: 576px) {
  section {
    padding: var(--space-xl) 0;
  }
  
  .container,
  .container-fluid,
  .container-sm {
    padding: 0 var(--space-md);
  }
  
  .text-sm-left { text-align: left; }
  .text-sm-center { text-align: center; }
  .text-sm-right { text-align: right; }
  
  .hidden-sm { display: none; }
}

@media (max-width: 768px) {
  .text-md-left { text-align: left; }
  .text-md-center { text-align: center; }
  .text-md-right { text-align: right; }
  
  .hidden-md { display: none; }
}

@media (min-width: 769px) {
  .hidden-lg { display: none; }
  
  .visible-lg { display: block; }
}

/* ============================================
   IMPRESIÓN
   ============================================ */

@media print {
  body {
    background: white;
    color: black;
  }
  
  header,
  footer,
  .no-print {
    display: none;
  }
  
  .container {
    max-width: 100%;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
}
