body { font-family: Arial; background: #f4f4f4; margin: 0; padding: 0; }
main { padding: 30px; }
.listado {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 42px;
}

/* BARRA AZUL de lado a lado */
.barra-azul {
  width: 100%;
  background: #009ec3;
  min-height: 100px;
  padding: 0;
  box-sizing: border-box;
}
.barra-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 32px 0;
  box-sizing: border-box;
  width: 100%;
}
.cabecera-titulos {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 32px;
}
.cabecera-titulos h1 {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 0px;
  margin-top: 2px;
  letter-spacing: 0.03em;
  text-align: left;
  color: #fff;
}
.cabecera-titulos p {
  font-size: 1.14rem;
  margin-top: 7px;
  margin-bottom: 0px;
  font-weight: 400;
  text-align: left;
  letter-spacing: 0.01em;
  color: #fff;
}
/* Botón Publicar Clasificado */
.btn-publicar {
  display: inline-block;
  padding: 13px 44px;
  font-size: 1.18rem;
  background: #f6af2a;
  color: #fff !important;
  font-weight: bold;
  border: none;
  border-radius: 26px;
  box-shadow: 0 2px 15px #fff1c3aa;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, box-shadow 0.16s, color 0.12s;
  white-space: nowrap;
  letter-spacing: 0.04em;
  margin-right: 32px;
}
.btn-publicar:hover, .btn-publicar:focus {
  background: #d68f0a;
  color: #fff !important;
  box-shadow: 0 5px 18px #ffe8afbb;
}

/* Barra de categorías FULL WIDTH */
.categorias-barra {
  width: 100%;
  background: #eff6fd;
  padding: 18px 0 10px 0;
  text-align: center;
  border-bottom: 2px solid #009ec3;
  margin-bottom: 8px;
  box-shadow: 0 2px 12px #bde1eb15;
  z-index: 2;
}
.categorias-inner-scroll {
  max-width: 1400px; /* Aumentado de 1200px */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px; /* Reducido de 32px */
}
.categorias-titulo {
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 12px;
  color: #009ec3;
  flex-shrink: 0;
  display: block;
  width: 100%;
}
.categorias-scroll {
  display: flex;
  gap: 5px; /* Reducido de 7px */
  flex-wrap: nowrap; /* Forzar una sola línea */
  justify-content: center;
}
.btn-categoria {
  display: inline-block;
  background: #fff;
  color: #009ec3;
  font-weight: 600;
  border: 2px solid #009ec3;
  padding: 5px 18px; /* Reducido de 6px 22px */
  margin: 4px 0;
  border-radius: 18px;
  font-size: 16px; /* Reducido de 17px */
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  box-shadow: 0 1px 8px #c3e7f522;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-categoria:hover, .btn-categoria.active {
  background: #009ec3;
  color: #fff;
  border-color: #007294;
}

/* PUBLICACIÓN */
.producto-horizontal {
  background: white;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 1100px;
  height: 350px;
  max-width: 98vw;
  min-height: 350px;
  padding: 30px 24px;
  border-radius: 22px;
  box-shadow: 0 6px 36px #bbb;
  gap: 36px;
  margin-bottom: 14px;
  transition: box-shadow 0.18s;
  position: relative;
  overflow: hidden;
}
.producto-horizontal:hover {
  box-shadow: 0 10px 40px #888;
}

/* Elementos móviles ocultos por defecto */
.header-movil,
.info-movil {
  display: none;
}

.foto-producto {
  flex: 0 0 430px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.foto-producto img,
.slider .slide-img {
  width: 420px;
  height: 330px;
  object-fit: cover;
  border-radius: 15px;
  background: #eee;
  box-shadow: 0 4px 20px #ddd;
  transition: transform 0.13s;
  display: block;
}
.foto-producto img:hover,
.slider .slide-img:hover {
  transform: scale(1.04);
}
.info-producto {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 6px 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.badge-categoria {
  display: inline-block;
  background: #009ec3;
  color: #fff;
  font-weight: 600;
  padding: 5px 22px;
  border-radius: 18px;
  font-size: 16px;
  margin-bottom: 12px;
  margin-top: 2px;
  box-shadow: 0 2px 10px #bde1eb;
  letter-spacing: 0.5px;
  align-self: flex-start;
}
.info-producto h2, .titulo-desktop { 
  margin: 0 0 10px; 
  font-size: 21px; 
  color: #333;
}
.info-producto h4, .descripcion {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: normal;
  color: #222;
  line-height: 1.35;
  max-height: 85px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.info-producto p { 
  margin: 6px 0; 
  font-size: 17px; 
}
.info-producto p strong {
  font-size: 20px;
  color: #e20a17;
}

/* Botón Comprar */
.btn-comprar {
  display: inline-block;
  margin: 12px 0 0 0;
  padding: 10px 30px;
  background: #e20a17;
  color: #fff;
  font-weight: bold;
  border-radius: 30px;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.18s, box-shadow 0.15s;
  box-shadow: 0 3px 10px #fbbaba;
  border: none;
  cursor: pointer;
  align-self: flex-start;
}
.btn-comprar:hover {
  background: #b30912;
  color: #fff;
  box-shadow: 0 6px 18px #e2a3a3;
}

/* Slider nav */
.slider {
  position: relative;
  width: 420px;
  height: 330px;
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #009ec3dd;
  border: none;
  color: white;
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px #bde1eb55;
  transition: background 0.15s, box-shadow 0.18s;
}
.slider-btn:active,
.slider-btn:focus {
  background: #007294ee;
}
.slider-btn.prev { left: 12px; }
.slider-btn.next { right: 12px; }

.footer-bar {
  width: 100%;
  background: #009ec3;
  color: #e9f4f7;
  text-align: center;
  padding: 28px 0 24px 0;
  font-size: 1.04rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-top: 48px;
  box-shadow: 0 -1px 18px #bde1eb18;
  border-top: 1px solid #25b7d9;
  font-family: inherit;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  main { padding: 20px 10px; }
  
  .barra-inner {
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    gap: 15px;
  }
  .cabecera-titulos {
    margin-left: 0;
    align-items: center;
    text-align: center;
  }
  .cabecera-titulos h1 { 
    font-size: 1.8rem; 
  }
  .cabecera-titulos p { 
    font-size: 1rem; 
  }
  .btn-publicar {
    margin-right: 0;
    width: 90%;
    max-width: 300px;
    text-align: center;
    font-size: 1rem;
    padding: 12px 30px;
  }
  
  /* Restaurar diseño horizontal para móvil */
  .categorias-inner-scroll {
    flex-direction: row;
    align-items: center;
    padding: 0 15px;
  }
  .categorias-titulo {
    font-size: 18px;
    margin-right: 12px;
    margin-bottom: 0;
    width: auto;
  }
  .categorias-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #009ec3 #eff6fd;
  }
  .categorias-scroll::-webkit-scrollbar {
    height: 6px;
  }
  .categorias-scroll::-webkit-scrollbar-track {
    background: #eff6fd;
  }
  .categorias-scroll::-webkit-scrollbar-thumb {
    background: #009ec3;
    border-radius: 3px;
  }
  .btn-categoria {
    font-size: 15px;
    padding: 5px 18px;
  }
}

@media (max-width: 768px) {
  .listado {
    gap: 20px;
  }
  
  /* REORGANIZACIÓN MÓVIL */
  .producto-horizontal {
    flex-direction: column;
    width: 95vw;
    height: auto;
    padding: 20px;
    gap: 0;
  }
  
  /* Mostrar elementos móviles */
  .header-movil {
    display: block;
    width: 100%;
    margin-bottom: 15px;
  }
  
  .badge-movil {
    display: inline-block;
    font-size: 14px;
    padding: 4px 16px;
    margin-bottom: 8px;
  }
  
  .titulo-movil {
    font-size: 19px;
    color: #333;
    margin: 0;
    line-height: 1.3;
  }
  
  /* Ocultar elementos desktop */
  .info-producto {
    display: none;
  }
  
  /* Foto */
  .foto-producto {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    margin-bottom: 15px;
  }
  
  .foto-producto img,
  .slider,
  .slider .slide-img {
    width: 100%;
    height: 250px;
    max-width: 400px;
    margin: 0 auto;
  }
  
  .slider {
    margin: 0 auto;
  }
  
  /* Mostrar info móvil */
  .info-movil {
    display: block;
    width: 100%;
  }
  
  .descripcion-movil {
    font-size: 13px;
    line-height: 1.4;
    color: #222;
    margin: 0 0 15px 0;
    font-weight: normal;
  }
  
  .precio-movil {
    font-size: 16px;
    margin: 10px 0 !important;
  }
  
  .precio-movil strong {
    font-size: 18px;
    color: #e20a17;
  }
  
  .btn-comprar-movil {
    font-size: 14px;
    padding: 8px 25px;
    margin: 10px 0;
    display: inline-block;
  }
  
  .vendedor-movil {
    font-size: 12px;
    color: #666;
    margin-top: 10px !important;
  }
  
  .vendedor-movil small {
    font-size: 12px;
  }
  
  .slider-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  .categorias-barra {
    padding: 12px 0 8px 0;
  }
  
  .categorias-titulo {
    font-size: 16px;
  }
  
  .btn-categoria {
    font-size: 14px;
    padding: 4px 14px;
  }
}

@media (max-width: 480px) {
  main { padding: 15px 5px; }
  
  .cabecera-titulos h1 { 
    font-size: 1.5rem; 
  }
  .cabecera-titulos p { 
    font-size: 0.9rem; 
  }
  .btn-publicar {
    width: 95%;
    font-size: 0.95rem;
    padding: 10px 20px;
  }
  
  .producto-horizontal {
    padding: 15px;
    border-radius: 15px;
  }
  
  .titulo-movil {
    font-size: 17px;
  }
  
  .foto-producto img,
  .slider .slide-img {
    height: 200px;
  }
  
  .descripcion-movil {
    font-size: 12px;
  }
  
  .badge-movil {
    font-size: 13px;
    padding: 3px 12px;
  }
  
  .btn-comprar-movil {
    font-size: 13px;
    padding: 7px 20px;
  }
  
  .categorias-titulo {
    font-size: 14px;
    margin-right: 8px;
  }
  
  .btn-categoria {
    font-size: 13px;
    padding: 3px 12px;
  }
  
  .footer-bar {
    font-size: 0.9rem;
    padding: 20px 10px;
  }
}