/* ====== GLOBAL ====== */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-size: 18px;
  background: #ffffff;
  color: #212529;
}

/* [MOBILE FIX] Ensure predictable sizing and media fluidity */
*, *::before, *::after { box-sizing: border-box; }
/* [MOBILE FIX] Prevent media from overflowing containers */
img, video, canvas, svg { max-width: 100%; height: auto; display: block; }
/* ===== TIPOGRAFÍA ESTILO HOOPSHOES ===== */

/* Títulos grandes, branding, impacto */
h1, h2, h3, .navbar-brand, .hero-caption h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Menú principal y subtítulos */
.nav-link, .dropdown-item, .card-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
}

/* Cuerpo de texto y párrafos */
body, p, td, .footer {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  line-height: 1.5;
}


/* ====== NAVBAR ====== */
.custom-navbar {
  background-color: #ffffff !important;
  border-bottom: 2px solid #e0e0e0;
  padding: 12px 20px;
}

/* [MOBILE FIX] Keep navbar above overlapping content */
.custom-navbar { z-index: 1030; }

.custom-navbar .navbar-brand {
  font-weight: 700;
  color: #b00000;
  font-size: 1.4rem;
  letter-spacing: 1px;
}

.custom-navbar .nav-link {
  color: #333 !important;
  font-weight: 500;
  margin: 0 8px;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-link:focus {
  background-color: #b00000;
  color: #fff !important;
}

.custom-navbar .nav-link.active {
  background-color: #b00000;
  color: #fff !important;
}

/* Dropdown */
.dropdown-menu {
  border-radius: 8px;
  border: 1px solid #eee;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dropdown-item:hover {
  background-color: #f5f5f5;
  color: #b00000;
}

/* ====== HERO (general, carrusel u otras vistas) ====== */
.hero {
  height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  position: relative;
}

.hero-img {
  object-fit: cover;
  width: 100%;
  height: 70vh;
  max-height: 700px;
  min-height: 400px;
  filter: brightness(70%);
}

.hero-caption {
  bottom: 20%;
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 10px;
  display: inline-block;
  padding: 16px 20px;
  max-width: 90%;
  margin: auto;
}

.hero-caption h1 {
  color: #fff;
  margin-bottom: 10px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  font-size: 3rem;
  font-weight: 700;
}

.hero-caption p {
  color: #fff;
  margin: 0 0 10px 0;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  font-size: 1.2rem;
}

/* Hero gradiente overlay */
.hero-img::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.6));
}

/* ====== CARDS (estilo general) ====== */
.card {
  border: none;
  border-radius: 10px;
  background: #f8f9fa;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.card-title {
  color: #b00000;
  font-weight: bold;
  text-align: center;
}

/* ====== BOTONES ====== */
.btn-hero {
  background: #b00000;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.btn-hero:hover {
  background: #d32f2f;
}

/* ====== FOOTER ====== */
.footer {
  background: #f5f5f5;
  color: #555;
  text-align: center;
  padding: 20px;
  font-size: 0.95rem;
  border-top: 2px solid #e0e0e0;
}

/* ====== MODAL ====== */
.modal-content {
  border-radius: 10px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .navbar-brand img {
    height: 80px;
  }
  .custom-navbar .nav-link {
    padding: 12px 16px;
    text-align: center;
  }
}

@media (max-width: 576px) {
  html, body {
    font-size: 19px;
    line-height: 1.5;
  }

  /* [MOBILE FIX] Contenido con respiro lateral en móviles */
  .container, .container-fluid { padding-left: 16px; padding-right: 16px; }

  /* [MOBILE FIX] Navbar brand más compacta en teléfonos */
  .navbar-brand img { height: 64px; }

  /* [MOBILE FIX] Evitar scroll horizontal en móviles por desfases */
  html, body { overflow-x: hidden; }

  h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 0.8rem;
  }

  .container {
    max-width: 95%;
    padding: 0 10px;
  }

  .card-body {
    padding: 1.2rem;
  }

  .btn, .btn-hero {
    font-size: 1rem;
    padding: 12px 20px;
    border-radius: 10px;
  }

  .footer {
    font-size: 1rem;
    padding: 25px 10px;
  }

  .hero-caption {
    bottom: 12%;
    padding: 12px 16px;
  }
  .hero-caption h1 {
    font-size: 1.6rem;
  }
  .hero-caption p {
    font-size: 0.9rem;
  }
}

/* [MOBILE FIX] Tablas fluidas con scroll horizontal suave en móviles */
/* Esta regla es sobreescrita por .table-mobile-stack para evitar el scroll en la tabla de QRs */
@media (max-width: 768px) {
  .table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table thead, .table tbody, .table tfoot { width: 100%; }
}

/* [MOBILE FIX] Carouseles y contenedores amplios sin desbordar */
@media (max-width: 768px) { .carousel { overflow: hidden; } }

/* [MOBILE FIX] Mapas 100% fluidos */
.map-container, #map { width: 100%; max-width: 100%; }
.map-container { overflow: hidden; }


/* ====== LOGO ESCALABLE Y PROPORCIONAL ====== */

/* Tamaño del logo por defecto (escritorio) */
.navbar-logo {
  height: auto;
  max-height: 180px; /* Ajusta este valor si querés más chico */
  width: auto;
  transition: max-height 0.3s ease;
  display: block;
}

/* En laptops y tablets */
@media (max-width: 992px) {
  .navbar-logo {
    max-height: 90px;
  }
}

/* En pantallas medianas */
@media (max-width: 768px) {
  .navbar-logo {
    max-height: 70px;
  }
}

/* En celulares chicos */
@media (max-width: 576px) {
  .navbar-logo {
    max-height: 60px;
  }
}


/* ======= MOBILE TABLE STACK (FIX ESTÉTICO) ======= */
@media screen and (max-width: 768px) {
    /* Ocultar el table-responsive, que obliga al scroll horizontal */
    .table-mobile-stack:not(.no-responsive) {
        display: block;
        width: 100%;
        overflow-x: hidden; /* Evitar scroll */
    }
    
    .table-mobile-stack thead {
        /* Ocultar la cabecera de la tabla en móvil */
        display: none;
    }

    .table-mobile-stack tr {
        /* Convertir filas a bloques para apilarlos */
        display: block;
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 0.25rem;
        padding: 10px;
    }
    
    .table-mobile-stack td {
        /* Convertir celdas a bloques, y usar flexbox para alinear contenido */
        display: flex; /* Usamos flex para mejor alineación del label y valor */
        justify-content: space-between; /* Separamos label y valor */
        text-align: left !important;
        padding: 5px 0;
        border: none;
        width: 100%; /* Asegura que cada celda use el ancho completo */
        align-items: center;
    }
    
    /* Etiquetar los datos para mejor claridad, usando atributos data-label */
    .table-mobile-stack td::before {
        content: attr(data-label);
        font-weight: 600; /* Ligeramente más fuerte para label */
        flex-shrink: 0; /* Evita que el label se encoja */
        margin-right: 10px;
        color: #333; /* Color más oscuro para el label */
    }
    
    /* Estilos específicos para la columna de Acciones */
    .table-mobile-stack tr td:nth-child(4) { /* Columna de Acciones */
        text-align: center !important; /* Centramos el botón */
        padding-top: 15px;
        border-top: 1px solid #e9ecef; /* Separador */
    }

    /* Hacemos el botón de acción más visible y fácil de tocar */
    .table-mobile-stack tr td:nth-child(4) .btn {
        width: 100%;
        font-size: 1.1rem;
        padding: 10px 0;
    }
    
    /* [LIMPIEZA] Eliminamos reglas innecesarias que causaban solapamiento */
    .table-mobile-stack tr td:nth-child(2),
    .table-mobile-stack tr td:nth-child(3) {
        display: flex; /* Mantener la propiedad flex */
        width: 100%; /* Se asegura que no se pongan en línea y rompan el layout */
    }
}
