/* style.css - Estilos base para Gopartrucks */

/* ========================= */
/* Variables globales        */
/* ========================= */
:root {
  --brand: #e33b2f;
  --dark: #1e293b;
  --muted: #64748b;
  --bg: #f8fafc;
  --light: #ffffff;
}

/* ========================= */
/* Reset básico              */
/* ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
}

/* ========================= */
/* Links y botones           */
/* ========================= */
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: .5rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .2s;
}
.btn:hover { background: #c53027; }

.btn-secundario {
  background: white;
  color: var(--muted);
  border: 2px solid #e2e8f0;
}
.btn-secundario:hover {
  background: var(--bg);
  border-color: #cbd5e0;
  text-decoration: none;
}

/* ========================= */
/* Tipografía                */
/* ========================= */
h1, h2, h3 {
  color: var(--dark);
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ========================= */
/* Contenedor                */
/* ========================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ========================= */
/* Secciones genéricas       */
/* ========================= */
.section {
  padding: 2rem 1rem;
}

/* ========================= */
/* Categorías grid           */
/* ========================= */
.categorias-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
  gap: 20px; 
  text-align: center; 
}
.categoria {
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center;
  padding: 15px; 
  border: 1px solid #ddd; 
  border-radius: 8px; 
  background: #fafafa; 
  text-decoration: none;
  color: #333;
  transition: background 0.2s;
}
.categoria:hover { background: #f0f0f0; }
.categoria img {
  width: 60px; 
  height: 60px; 
  object-fit: contain; 
  margin-bottom: 10px;
}

/* ========================= */
/* Listado de camiones       */
/* ========================= */
.camiones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* ========================= */
/* Galería de imágenes       */
/* ========================= */
.galeria {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
}
.galeria img {
  max-height: 250px;
  border-radius: 6px;
  object-fit: cover;
}
.galeria img.principal { border: 3px solid #007bff; }

/* ========================= */
/* Hero                      */
/* ========================= */
.hero {
  width: 100%;
  max-width: 1200px;      /* límite de ancho */
  margin: 0 auto;         /* lo centra en la página */
  height: 40vh;
  background-size: cover;
  background-position: center;
  position: relative;
  border-radius: 0px;     /* opcional: esquinas suaves */
  overflow: hidden;       /* asegura que la imagen no se salga */
}

.hero-overlay {
  background: rgba(0,0,0,0.4);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-content {
  color: #fff;
  max-width: 800px;
  padding: 20px;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #FFF;
}

/* ========================= */
/* Header principal          */
/* ========================= */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 70px;
}

.logo img { height: 40px; display: block; }

.main-nav ul {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  text-decoration: none;
  color: #334155;
  font-weight: 500;
}
.main-nav a:hover {
  color: var(--brand);
}

/* Botón menú móvil */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .menu-toggle { display: block; }
}

.main-nav.open {
  display: block;
  position: absolute;
  top: 60px;
  right: 0;
  background: #fff;
  padding: 1rem;
  border: 1px solid #e5e7eb;
}

/* ========================= */
/* MENÚ MÓVIL DESDE ARRIBA   */
/* ========================= */
.mobile-nav {
  position: fixed;
  top: -260px; /* oculto al inicio */
  right: 20px;
  width: 220px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 15px;
  opacity: 0;
  pointer-events: none;
  transition: top 0.4s ease, opacity 0.3s ease;
  z-index: 10001;
}

.mobile-nav.open {
  top: 70px; /* baja desde arriba */
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav .close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #333;
  float: right;
  cursor: pointer;
}

.mobile-nav ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
}

.mobile-nav li {
  margin: 10px 0;
}

.mobile-nav a {
  text-decoration: none;
  color: #1e293b;
  font-weight: 500;
  display: block;
  padding: 5px 0;
}

.mobile-nav a:hover {
  color: var(--brand);
}

/* ========================= */
/* OVERLAY                   */
/* ========================= */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 10000;
}

#overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ========================= */
/* Filtros catálogo          */
/* ========================= */
.catalogo-layout { display: flex; gap: 20px; }
.listado-camiones { flex: 1; }

.filtros {
  flex: 0 0 280px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  padding: 0;
  height: fit-content; 
}

.filtros-header {
  background: var(--brand);
  padding: 12px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.filtros-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.filtros-form { padding: 12px; }
.grupo { margin-bottom: 12px; }
.grupo label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
}
.grupo select,
.grupo input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--dark);
  background: white;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
}
.grupo select:focus,
.grupo input[type="number"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(227, 59, 47, 0.1);
}

/* Checkbox list */
.checkbox-list {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  max-height: 180px;
  overflow-y: auto;
}
.checkbox-list::-webkit-scrollbar { width: 6px; }
.checkbox-list::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 3px;
}
.checkbox-list::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}
.checkbox-list::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease;
  font-size: 14px;
  color: var(--muted);
}
.checkbox-item:hover { background: white; }
.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
  accent-color: var(--brand);
}

/* Rango inputs */
.rango-inputs { display: flex; gap: 8px; }
.rango-inputs input { flex: 1; }

/* Acciones */
.acciones {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--bg);
}

/* Badge contador */
.filtro-badge {
  display: inline-block;
  background: var(--brand);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 600;
}

/* ========================= */
/* Responsive filtros (slide)*/
/* ========================= */
@media (max-width: 992px) {
  .catalogo-layout { flex-direction: column; }
  .filtros {
    display: block;
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    z-index: 9998;
    transition: left 0.3s ease;
    overflow-y: auto;
  }
  .filtros.activo { left: 0; }
  .filtros-toggle {
    display: block;
    margin-bottom: 15px;
    background: var(--brand);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
  }
}

@media (min-width: 993px) {
  .filtros-toggle { display: none; }
}
/* Barra superior de filtros responsive */
.filtros-barra {
  position: sticky;
  top: 70px; /* debajo del header */
  z-index: 9997;
  background: var(--light);
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;

  /* que ocupe toda la pantalla como el header */
  width: 100vw;
  margin-left: calc(-50vw + 50%); /* truco para romper el ancho del .container */
  
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Lengüeta lateral para abrir filtros en móvil */
.filtros-pestana {
  position: relative;
  left: -16px; /* sobresale del borde */
  background: var(--brand);
  color: #fff;
  padding: 10px 18px 10px 12px;
  border-radius: 0 8px 8px 0;  /* forma de pestaña */
  font-weight: 600;
  cursor: pointer;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.15);
  white-space: nowrap;
  z-index: 10;
}

.filtros-pestana:hover {
  background: #c53027;
}

/* Etiquetas filtros activos en barra móvil */
.filtros-activos-mobile {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.filtros-activos-mobile .tag {
  background: #f0f0f0;
  color: var(--dark);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
}
.filtros-activos-mobile .tag a {
  margin-left: 6px;
  color: var(--brand);
  font-weight: bold;
  text-decoration: none;
  font-size: 14px;
}

/* Solo mostrar en móvil */
@media (min-width: 993px) {
  .filtros-barra { display: none; }
}

.filtros-cerrar {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
  padding: 0;
}

@media (min-width: 993px) {
  .filtros-cerrar { display: none; }
}

/* ========================= */
/* Sección confianza         */
/* ========================= */
.section.confianza {
  padding: 60px 20px;
  background: #f8f9fa;
  text-align: center;
}
.confianza-heading {
  font-size: 2rem;
  margin-bottom: 40px;
  color: #222;
}
.trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}
.trust .item {
  background: #fff;
  border-radius: 12px;
  padding: 25px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.trust .item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.trust-title {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #1e293b;
}
.trust-text {
  font-size: 1rem;
  color: #555;
  line-height: 1.5;
}

/* ========================= */
/* Páginas legales           */
/* ========================= */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  line-height: 1.6;
  color: #334155;
}
.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--brand);
  text-align: center;
}
.legal-page h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: #1e293b;
}
.legal-page p,
.legal-page li { margin-bottom: 1rem; }
.legal-page ul {
  list-style: disc;
  margin: 1rem 0 1rem 1.5rem;
}
.legal-page strong { color: #000; }

/* Responsive legales */
@media (max-width: 768px) {
  .legal-page { padding: 1.5rem 1rem; }
  .legal-page h1 { font-size: 1.6rem; }
  .legal-page h2 { font-size: 1.1rem; }
}

/* ========================= */
/* Footer                    */
/* ========================= */
.site-footer {
  background: #1e293b;
  color: #f8fafc;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  color: #fbbf24;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col ul li { margin-bottom: 0.5rem; }

.footer-col a {
  color: #f8fafc;
  text-decoration: none;
}

.footer-col a:hover { text-decoration: underline; }

.social-links a {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.2rem;
  color: #f8fafc;
}
.social-links a:hover { color: var(--brand); }

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.legal-links {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.legal-links a {
  color: #94a3b8;
  font-size: 0.85rem;
}
.legal-links a:hover { color: #f8fafc; }

/* ========================= */
/* Layout con barra lateral  */
/* ========================= */
.camiones-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}
@media (max-width: 900px) {
  .camiones-layout { grid-template-columns: 1fr; }
  .filtros { order: -1; }
}
