/* ---------- ESTILOS BASE ---------- */
body, html {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: #f9fbfd;
  color: #0a233f;
  overflow-x: hidden; /* Evita scroll horizontal */
  max-width: 100%;
}

.container {
  padding: 15px;
  max-width: 1000px;
  margin: auto;
}

.main-header {
  position: relative;
  width: 100%;
  height: 300px;
  background: url('../fondo.jpg') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  overflow: hidden;
  padding-top: 20px;
}




/* capa oscura con brillo */
.main-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(0, 0, 0, 0.5) 20%,
    rgba(0, 0, 0, 0.35) 50%,
    rgba(0, 0, 0, 0.2) 100%
  );
  z-index: 1;
}


.main-header h1,
.main-header p,
.main-header img {
  position: relative;
  z-index: 2;
}

.header-logo {
  width: 180px;
  height: auto;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.header-slogan {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  margin: 0;
}

.header-sub {
  font-size: 1rem;
  font-weight: 500;
  color: #e6e6e6;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  margin-top: 5px;
}

/* Cabecera reducida para subpáginas */
.main-header.small {
  height: 100px;
  padding: 10px 20px;
  justify-content: space-between;
  flex-direction: row;
  background: #023e8a;
}

/* Responsive header */
@media (max-width: 768px) {
  .main-header {
    height: 270px;
    background-position: top center;
    padding-top: 30px;
  }

  .main-header::after {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: brightness(1.25);
  }

  .header-logo {
    width: 140px;
  }

  .header-slogan {
    font-size: 1.1rem;
    line-height: 1.3;
    padding: 0 10px;
  }

  .header-sub {
    font-size: 0.95rem;
    line-height: 1.2;
  }
}

/* ---------- LISTADO DE MOTOS ---------- */
.moto-list {
  display: grid;
  gap: 15px;
  padding: 15px;
}

/* Diseño vertical: imagen arriba, texto y botón centrados */
.moto-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding: 15px;
  gap: 10px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.moto-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.moto-card img.thumb {
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
}

.moto-info {
  flex: 1;
  text-align: center;
  padding: 10px;
}

.moto-info h3 {
  margin: 8px 0 6px;
  font-size: 1.1rem;
  color: #023e8a;
  font-weight: 600;
}

.moto-info p {
  margin: 4px 0;
  font-size: 0.95rem;
  color: #333;
}

.ver-btn {
  display: inline-block;
  margin-top: 10px;
  background: #0077b6;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}

.ver-btn:hover {
  background: #0096c7;
  transform: translateY(-2px);
}

@media(min-width:768px) {
  .moto-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- FILTROS ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: flex-end;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 15px;
  margin: 20px auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  max-width: 1000px;
}
.filtro {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filtro label {
  font-size: 0.85rem;
  color: #023e8a;
  font-weight: 600;
}
.filters select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  font-size: 0.95rem;
  color: #333;
  width: 160px;
  height: 38px;
}
.filters select:focus {
  border-color: #023e8a;
  box-shadow: 0 0 0 3px rgba(2, 62, 138, 0.2);
  outline: none;
}

/* ---------- DETALLE DE MOTO MEJORADO ---------- */
.detail-header {
  background: #023e8a;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-logo-detail {
  height: 55px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.moto-title {
  text-align: center;
  color: #023e8a;
  margin: 15px 0;
  font-size: 1.5rem;
}
.moto-card-detail {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 20px;
  margin: 15px auto;
  max-width: 480px;
  text-align: left;
}
.moto-card-detail p {
  margin: 6px 0;
  font-size: 0.95rem;
}

/* ---------- ICONOS DE CONTACTO ---------- */
.contact-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 25px 0 15px;
}
.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.4rem;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s;
}
.contact-icon.whatsapp { background: #25D366; color: white; }
.contact-icon.email { background: #023e8a; color: white; }
.contact-icon.phone { background: #0096c7; color: white; }
.contact-icon:hover {
  transform: scale(1.08);
  filter: brightness(1.1);
}

/* ---------- BOTÓN VOLVER ---------- */
.back-bar {
  text-align: center;
  margin: 20px 0 40px;
}
.back-bar .back-btn {
  background: #ccc;
  color: #222;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.back-bar .back-btn:hover { background: #bbb; }

/* ---------- ADAPTACIÓN MÓVIL ---------- */
@media (max-width: 600px) {
  .moto-title {
    font-size: 1.2rem;
    padding: 0 10px;
  }
  .moto-card-detail {
    padding: 15px;
    margin: 10px;
  }
  .contact-bar {
    gap: 18px;
    margin: 20px 0 10px;
  }
  .contact-icon {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
  .back-bar {
    margin-top: 15px;
  }
  .back-bar .back-btn {
    width: 100%;
    font-size: 1rem;
  }
  .header-logo-detail {
    height: 45px;
  }
  .detail-header {
    height: 80px;
    justify-content: center;
  }
  .moto-card {
    padding: 12px;
  }
  .moto-card img.thumb {
    width: 100%;
    max-width: 100%;
  }
}
/* ---------- FOOTER ---------- */
footer {
  text-align: center;
  font-size: 0.9rem;
  color: #333;
  padding: 20px 10px;
  background: #f1f1f1;
  margin-top: 40px;
  border-top: 1px solid #ddd;
}

footer p {
  margin: 5px 0;
}

footer .nota-footer {
  font-size: 0.8rem;
  color: #777;
  font-style: italic;
}
/* ---------- ADAPTACIÓN MÓVIL ---------- */
@media (max-width: 600px) {

  /* 🔹 Ajuste general */
  body, html {
    overflow-x: hidden;
    max-width: 100%;
  }

/* 🔹 CABECERA: más baja y con contenido arriba */
.main-header {
  height: 180px; /* antes 270px */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* 👈 esto hace que empiece desde arriba */
  padding-top: 15px; /* menos espacio arriba */
  background-position: top center;
}


  .header-logo {
    width: 130px; /* más proporcionado al nuevo alto */
    margin-bottom: 8px;
  }

  .header-slogan {
    font-size: 1rem;
    line-height: 1.2;
  }

  .header-sub {
    font-size: 0.9rem;
  }

  /* 🔹 TARJETAS DE MOTOS */
  .moto-card {
    padding: 12px;
  }

  .moto-card img.thumb {
    width: 100%;
    max-width: 100%;
  }

  /* 🔹 DETALLE DE MOTO */
  .moto-title {
    font-size: 1.2rem;
    padding: 0 10px;
  }

  .moto-card-detail {
    padding: 15px;
    margin: 10px;
  }

  .contact-bar {
    gap: 18px;
    margin: 20px 0 10px;
  }

  .contact-icon {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .back-bar {
    margin-top: 15px;
  }

  .back-bar .back-btn {
    width: 100%;
    font-size: 1rem;
  }

  .header-logo-detail {
    height: 45px;
  }

  .detail-header {
    height: 80px;
    justify-content: center;
  }

  /* 🔹 FILTROS EN 2 COLUMNAS Y 2 FILAS */
  .filters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    justify-items: center;
    align-items: center;
    padding: 10px;
  }

  .filters select {
    width: 100%;
  }

  .filtro {
    width: 100%;
    text-align: center;
  }

  /* 🔹 FOOTER */
  footer {
    font-size: 0.85rem;
    padding: 15px 8px;
  }
}
/* ---------- LOADER / PANTALLA DE CARGA ---------- */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center; /* 👈 centra horizontalmente */
  flex-direction: column;
  z-index: 9999;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center; /* 👈 centra el logo y el texto */
  justify-content: center;
  gap: 10px;
  text-align: center; /* 👈 centra el texto */
  color: #023e8a;
}

.loader-logo {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.loader-text {
  font-size: 1rem;
  font-weight: 500;
}
/* ---------- PANEL DE ADMINISTRACIÓN ---------- */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.admin-table th {
  background: #023e8a;
  color: #fff;
  padding: 10px;
  text-align: left;
  font-weight: 600;
}

.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
}

.admin-table tr:hover {
  background: #f8f9fa;
}

.admin-table button {
  background: #0077b6;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin: 2px;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.2s;
}
.admin-table button:hover {
  background: #0096c7;
  transform: translateY(-2px);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-top: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: #023e8a;
  font-size: 0.9rem;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  resize: vertical;
}

.admin-form textarea {
  min-height: 80px;
}

.form-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.form-buttons button {
  flex: 1;
  padding: 10px;
  background: #0077b6;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.form-buttons button:hover {
  background: #0096c7;
}

#loginPanel {
  text-align: center;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-width: 320px;
}

#loginPanel input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#loginPanel button {
  background: #0077b6;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

#loginPanel button:hover {
  background: #0096c7;
}

@media (max-width: 600px) {
  .admin-table {
    font-size: 0.85rem;
  }
  .admin-form {
    padding: 15px;
  }
  .form-buttons {
    flex-direction: column;
  }
}
/* ---------- AJUSTE DE BOTONES EN LISTA (ADMIN) ---------- */
.admin-table td button {
  display: inline-block;
  margin: 2px 4px;
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 0.9rem;
}

.admin-table td {
  white-space: nowrap; /* evita que el texto o botones salten de línea */
}

.admin-table {
  table-layout: auto;
}
