/* components.css - estilos de componentes para Gopartrucks */

/* ========================= */
/* Tarjetas de camiones      */
/* ========================= */
.card-camion {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.card-camion:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.card-camion .card-img img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.card-body {
  padding: 1rem;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: .4rem;
}
.card-desc {
  font-size: .9rem;
  color: #64748b;
  margin-bottom: .6rem;
}
.card-info {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  font-size: .8rem;
  color: #475569;
  margin-bottom: .8rem;
}
.card-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e33b2f;
  margin-bottom: .4rem;
}
.card-status {
  display: inline-block;
  font-size: .85rem;
  font-weight: 600;
  margin-right: .6rem;
}
.card-status.disponible { color: #16a34a; }
.card-status.reservado { color: #eab308; }
.card-status.vendido { color: #dc2626; }
.card-ref {
  display: block;
  font-size: .75rem;
  color: #94a3b8;
  margin-top: .4rem;
}

/* ========================= */
/* Página detalle camión     */
/* ========================= */
.detalle-header h1 {
  font-size: 2rem;
  margin-bottom: .2rem;
}
.detalle-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
}

/* Galería detalle */
.galeria-detalle {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.galeria-detalle .galeria-principal img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: .5rem;
}
.galeria-detalle .galeria-miniaturas {
  display: flex;
  gap: .5rem;
}
.galeria-detalle .galeria-miniaturas img {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: .3rem;
  cursor: pointer;
  border: 2px solid transparent;
}
.galeria-detalle .galeria-miniaturas img:hover {
  border-color: var(--brand);
}

/* Info detalle */
.detalle-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 2rem;
}
.detalle-datos ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.detalle-datos li {
  margin-bottom: .5rem;
  font-size: 1rem;
}
.detalle-precio {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  padding: 1.5rem;
  text-align: center;
  flex: 0 0 260px;
}
.detalle-precio .precio {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 1rem;
}

/* ========================= */
/* Formulario Vender         */
/* ========================= */
.formulario {
  display: grid;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.form-group label {
  font-weight: 500;
}
.form-group input {
  padding: .6rem .8rem;
  border: 1px solid #cbd5e1;
  border-radius: .5rem;
  font-size: 1rem;
}
.form-group textarea {
  resize: vertical;
}
.confirmacion {
  background: #ecfdf5;
  border: 1px solid #10b981;
  padding: 1.5rem;
  border-radius: .5rem;
  margin-top: 2rem;
}
.confirmacion h2 {
  color: #065f46;
}
.confirmacion blockquote {
  background: #f1f5f9;
  border-left: 4px solid var(--brand);
  margin: 1rem 0;
  padding: .8rem 1rem;
  font-style: italic;
  color: #334155;
}

/* ========================= */
/* Blog                      */
/* ========================= */
.blog-listado {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}
.blog-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.blog-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.blog-img img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.blog-body { padding: 1rem; }
.blog-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: .5rem;
  color: #1e293b;
}
.blog-excerpt {
  font-size: .95rem;
  color: #475569;
  margin-bottom: .8rem;
}
.blog-meta {
  font-size: .8rem;
  color: var(--muted);
}

/* ========================= */
/* Artículo                  */
/* ========================= */
.articulo {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
}
.articulo-header h1 {
  font-size: 2rem;
  margin-bottom: .3rem;
}
.articulo-meta {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.articulo-imagen img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: .5rem;
  margin-bottom: 1.5rem;
}
.articulo-contenido p {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #334155;
}
.articulo-footer {
  margin-top: 2rem;
  text-align: left;
}

/* ========================= */
/* Contacto (detalle camión) */
/* ========================= */
#form-contacto-camion {
  max-width: 600px;
  margin: 2rem auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  animation: fadeIn 0.3s ease-in-out;
}
#form-contacto-camion h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--brand);
}
#form-contacto-camion .formulario {
  display: grid;
  gap: 1rem;
}
#form-contacto-camion .form-group {
  display: flex;
  flex-direction: column;
}
#form-contacto-camion label {
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: #374151;
}
#form-contacto-camion input,
#form-contacto-camion textarea {
  padding: 0.6rem 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#form-contacto-camion input:focus,
#form-contacto-camion textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(227,59,47,0.2);
}
#form-contacto-camion button.btn {
  width: fit-content;
  align-self: start;
  background-color: var(--brand);
  color: #fff;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
#form-contacto-camion button.btn:hover {
  background-color: #c5302a;
}

/* Animación de aparición */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Tarjeta de vehículo - catálogo público (rediseño 2026)
   Mantiene las clases existentes para no romper otras vistas.
   ========================================================= */
.card-camion {
  position: relative;
  background: #fff;
  border: 1px solid #e7eaee;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.card-camion:hover {
  transform: translateY(-4px);
  border-color: #d7dce2;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .11);
}

.card-camion .card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card-camion .card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eef1f4;
}

.card-camion .card-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.card-camion:hover .card-img img {
  transform: scale(1.025);
}

.card-status-badge,
.card-type-badge {
  position: absolute;
  top: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .02em;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.card-status-badge {
  left: 14px;
  color: #166534;
  background: rgba(240, 253, 244, .94);
  border: 1px solid rgba(187, 247, 208, .95);
}

.card-status-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.card-type-badge {
  right: 14px;
  max-width: 55%;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(18, 24, 32, .78);
  border: 1px solid rgba(255, 255, 255, .14);
}

.card-camion .card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 18px 16px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-camion .card-title {
  margin: 0;
  color: #171a1d;
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.015em;
}

.card-camion .card-ref {
  flex: 0 0 auto;
  margin: 2px 0 0;
  color: #9aa3ae;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}

.card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.card-spec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 29px;
  padding: 5px 8px;
  color: #4b5563;
  background: #f5f6f7;
  border: 1px solid #eceff2;
  border-radius: 7px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
}

.card-spec svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.card-secondary {
  display: -webkit-box;
  min-height: 38px;
  margin: 0 0 15px;
  overflow: hidden;
  color: #6b7280;
  font-size: .79rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-secondary-separator {
  margin: 0 5px;
  color: #c2c8d0;
}

.card-footer-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #eef0f2;
}

.card-camion .card-price {
  margin: 0;
  color: #e33b2f;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #374151;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color .2s ease;
}

.card-cta svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform .2s ease;
}

.card-camion:hover .card-cta {
  color: #e33b2f;
}

.card-camion:hover .card-cta svg {
  transform: translateX(2px);
}

@media (max-width: 520px) {
  .card-camion .card-body {
    padding: 15px;
  }

  .card-heading {
    margin-bottom: 11px;
  }

  .card-camion .card-title {
    font-size: 1rem;
  }

  .card-camion .card-price {
    font-size: 1.12rem;
  }

  .card-status-badge,
  .card-type-badge {
    top: 10px;
  }

  .card-status-badge { left: 10px; }
  .card-type-badge { right: 10px; }
}
