/**
 * fixes-responsive.css
 * Consolidación responsiva + fixes críticos
 * Breakpoints estándar: 576px (tablet), 992px (desktop)
 * Elimina duplicados y estandariza
 */

:root {
  /* Breakpoints estándar */
  --bp-mobile: 575px;
  --bp-tablet: 576px;
  --bp-desktop: 992px;
}

/* ============================================
   IMÁGENES - Aspect Ratio
   ============================================ */

/* Perfiles team */
.team-member img,
.resume .team-member img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  max-width: 200px;
}

/* Logos sponsors */
.mla-sponsors img,
.sponsor-logo img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  width: 100%;
  max-height: 80px;
}

/* Noticias */
.news-item img,
.resume .resume-item img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

/* ============================================
   HERO - Altura adaptativa
   ============================================ */

#hero {
  min-height: 100vh;
  height: auto;
}

@media (max-width: 575px) {
  #hero {
    min-height: 80vh;
    height: auto;
    padding: 40px 20px;
  }

  #hero h1 {
    font-size: 2rem;
  }
}

/* ============================================
   GRIDS - Mobile-first consolidation
   ============================================ */

/* Default: 1 column (mobile) */
.mla-grid,
.mla-showcase,
.team-grid,
.news-grid,
.sponsors-grid {
  grid-template-columns: 1fr;
}

/* Tablet: 2 columns */
@media (min-width: 576px) {
  .mla-grid,
  .news-grid,
  .sponsors-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 3-4 columns */
@media (min-width: 992px) {
  .mla-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mla-showcase {
    grid-template-columns: repeat(3, 1fr);
  }

  .news-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .sponsors-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .team-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ============================================
   GRÁFICOS - Responsive
   ============================================ */

.chart-container,
#calculadora canvas,
.calculator-chart {
  max-width: 100%;
  width: 100%;
  max-height: 500px;
}

@media (max-width: 575px) {
  .chart-container,
  #calculadora canvas,
  .calculator-chart {
    max-height: 300px;
  }
}

/* ============================================
   FORMULARIOS - Full width en móvil
   ============================================ */

@media (max-width: 575px) {
  .calculator-form input,
  .calculator-form select,
  .form-control {
    width: 100%;
    margin-bottom: 1rem;
  }

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

  .form-row > * {
    width: 100%;
  }
}

/* ============================================
   TABLAS - Responsive (Agenda CRÍTICA)
   ============================================ */

table {
  width: 100%;
  overflow-x: auto;
  display: block;
}

@media (max-width: 991px) {
  table,
  tbody,
  tr,
  td,
  th {
    display: block;
    width: 100%;
  }

  tr {
    margin-bottom: 1.5rem;
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 8px;
  }

  td, th {
    text-align: right;
    padding-left: 50%;
    position: relative;
    margin-bottom: 0.5rem;
  }

  td::before,
  th::before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    font-weight: bold;
    text-align: left;
  }

  th {
    display: none;
  }
}

/* ============================================
   PADDING/MARGIN - Adaptive spacing
   ============================================ */

section {
  padding: 80px 0;
}

@media (max-width: 575px) {
  section {
    padding: 40px 0;
  }

  section .container {
    padding: 0 15px;
  }
}

@media (max-width: 991px) {
  section {
    padding: 60px 0;
  }
}

/* ============================================
   NAVBAR - CSS-Only Hamburger Menu (Checkbox Pattern)
   ============================================ */

/* Hide checkbox input completely */
.nav-toggle-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Mobile nav toggle button (label) */
.mobile-nav-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 9999;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--mla-pink-main, #ef6694);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}

.mobile-nav-toggle:hover {
  background-color: var(--mla-burgundy, #a24f68);
  transform: scale(1.1);
}

.mobile-nav-toggle .hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
}

/* Navbar mobile positioning - ALWAYS VISIBLE (no toggle due to browser hang issue) */
@media (max-width: 991px) {
  #navbar {
    position: static;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    background-color: white;
    flex-direction: column;
    gap: 0;
    overflow-y: visible;
    z-index: auto;
    transition: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
  }

  #navbar ul {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu li a {
    padding: 12px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .nav-menu li i {
    font-size: 18px;
  }

  /* Hide hamburger button since menu is always visible */
  .mobile-nav-toggle {
    display: none;
  }
}

/* ============================================
   TEXT - Responsive typography
   ============================================ */

@media (max-width: 575px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  .section-title h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 991px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.6rem;
  }
}

/* ============================================
   UTILITIES - Remove redundant breakpoints
   ============================================ */

/* Remover conflictos de Bootstrap old breakpoints */
@media (max-width: 768px) {
  /* Estas reglas van a conflictuar - consolidadas arriba */
}

@media (max-width: 1200px) {
  /* Estas reglas van a conflictuar - consolidadas arriba */
}

/* Desactivar d-lg-block/hide en mobile */
@media (max-width: 991px) {
  .d-lg-none {
    display: none !important;
  }

  .d-lg-block {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .d-lg-block {
    display: block !important;
  }

  .d-lg-none {
    display: none !important;
  }
}

/* ============================================
   ESPECÍFICO: Calculadora
   ============================================ */

#calculadora {
  background: #f9e6ed;
  padding: 60px 20px;
}

#calculadora .calculator-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 992px) {
  #calculadora .calculator-grid {
    grid-template-columns: 1fr 1fr;
  }
}

#calculadora input:focus {
  border-color: #ef6694;
  box-shadow: 0 0 0 0.2rem rgba(239, 102, 148, 0.25);
}

/* ============================================
   ESPECÍFICO: Agenda
   ============================================ */

#agenda table {
  background: white;
  border-collapse: collapse;
}

#agenda tr:hover {
  background: #f9e6ed;
}

#agenda td, #agenda th {
  padding: 12px;
  border-bottom: 1px solid #ddd;
}

#agenda th {
  background: #ef6694;
  color: white;
  font-weight: bold;
}

/* ============================================
   FIN
   ============================================ */
