/**
 * Estilos para el catálogo de vehículos
 * 
 * Este archivo contiene todos los estilos específicos para el catálogo
 * de vehículos que antes estaban en el plugin y ahora están integrados
 * directamente en el tema.
 */

/* Estilos para la grilla de vehículos */
.ays-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Tarjeta de vehículo */
.ays-theme-card {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ays-theme-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Contenedor de imagen del vehículo */
.ays-theme-image-container {
  position: relative;
  padding-top: 56.25%;
  /* Proporción 16:9 */
  overflow: hidden;
  background-color: #f9fafb;
}

.ays-theme-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Etiqueta de estado (nuevo/usado) */
.ays-theme-estado {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 9999px;
}

.ays-theme-estado-nuevo {
  background-color: #10b981;
  color: white;
}

.ays-theme-estado-usado {
  background-color: #f59e0b;
  color: white;
}

/* Contenido de la tarjeta */
.ays-theme-content {
  padding: 1rem;
}

.ays-theme-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1f2937;
}

.ays-theme-marca {
  display: inline-block;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.ays-theme-precio {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0ea5e9;
  margin-top: 0.5rem;
}

.ays-theme-precio-anterior {
  font-size: 0.875rem;
  text-decoration: line-through;
  color: #9ca3af;
  margin-right: 0.5rem;
}

/* Botones de acción */
.ays-theme-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Filtros de vehículos */
.ays-filtros-container {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 0.5rem;
  background-color: #f9fafb;
}

.ays-filtros-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1f2937;
}

.ays-filtros-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.ays-filtro-grupo {
  margin-bottom: 1rem;
}

.ays-filtro-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #4b5563;
}

.ays-filtro-select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  background-color: white;
}

.ays-filtro-submit {
  padding: 0.5rem 1rem;
  font-weight: 500;
  color: white;
  background-color: #0ea5e9;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
}

.ays-filtro-submit:hover {
  background-color: #0284c7;
}

.ays-filtro-reset {
  padding: 0.5rem 1rem;
  font-weight: 500;
  color: #4b5563;
  background-color: #e5e7eb;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
}

.ays-filtro-reset:hover {
  background-color: #d1d5db;
}

/* Estilos para detalles de vehículo */
.ays-theme-detalles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .ays-theme-detalles {
    grid-template-columns: 1fr 1fr;
  }
}

.ays-theme-galeria {
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
}

.ays-theme-datos {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ays-theme-datos-section {
  border-radius: 0.5rem;
  background-color: #f9fafb;
  padding: 1.5rem;
}

.ays-theme-datos-titulo {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1f2937;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.ays-theme-datos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.ays-theme-dato {
  margin-bottom: 0.5rem;
}

.ays-theme-dato-label {
  font-size: 0.75rem;
  color: #6b7280;
}

.ays-theme-dato-valor {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1f2937;
}

/* Estilos para catálogos */
.ays-catalogos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.ays-catalogo-card {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ays-catalogo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.ays-catalogo-image-container {
  position: relative;
  padding-top: 141.42%;
  /* Proporción aproximada de un documento A4 */
  background-color: #f9fafb;
}

.ays-catalogo-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ays-catalogo-content {
  padding: 1rem;
}

.ays-catalogo-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1f2937;
}

.ays-catalogo-descripcion {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.ays-catalogo-actions {
  display: flex;
  justify-content: space-between;
}

.ays-catalogo-button {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  background-color: #0ea5e9;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
}

.ays-catalogo-button:hover {
  background-color: #0284c7;
}

.ays-catalogo-button svg {
  margin-right: 0.25rem;
  width: 1rem;
  height: 1rem;
}

/* Botones genéricos */
.ays-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.ays-button-primary {
  color: white;
  background-color: #0ea5e9;
}

.ays-button-primary:hover {
  background-color: #0284c7;
}

.ays-button-secondary {
  color: #1f2937;
  background-color: #e5e7eb;
}

.ays-button-secondary:hover {
  background-color: #d1d5db;
}

.ays-button-success {
  color: white;
  background-color: #10b981;
}

.ays-button-success:hover {
  background-color: #059669;
}

.ays-button-danger {
  color: white;
  background-color: #ef4444;
}

.ays-button-danger:hover {
  background-color: #dc2626;
}

.ays-button svg {
  margin-right: 0.25rem;
  width: 1rem;
  height: 1rem;
}

.ays-button-block {
  display: flex;
  width: 100%;
}

/* Paginación */
.ays-pagination {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  gap: 0.25rem;
}

.ays-pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  color: #4b5563;
  background-color: #f9fafb;
  transition: all 0.2s ease;
}

.ays-pagination-item:hover {
  background-color: #e5e7eb;
}

.ays-pagination-item.active {
  color: white;
  background-color: #0ea5e9;
}

.ays-pagination-arrow {
  color: #4b5563;
}

.ays-pagination-arrow:hover {
  color: #0ea5e9;
}

.ays-pagination-arrow svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Mensajes de alerta */
.ays-alert {
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.ays-alert-info {
  background-color: #e0f2fe;
  border-left: 4px solid #0ea5e9;
  color: #0c4a6e;
}

.ays-alert-success {
  background-color: #d1fae5;
  border-left: 4px solid #10b981;
  color: #065f46;
}

.ays-alert-warning {
  background-color: #fef3c7;
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

.ays-alert-error {
  background-color: #fee2e2;
  border-left: 4px solid #ef4444;
  color: #b91c1c;
}

/* Mejoras para tablas en Descripción Larga */
.prose table {
  width: 100%;
  margin-top: 2em;
  margin-bottom: 2em;
  border-collapse: collapse;
  font-size: 0.875em;
  line-height: 1.7142857;
}

.prose table thead th {
  padding-right: 0.5714286em;
  padding-bottom: 0.5714286em;
  padding-left: 0.5714286em;
  font-weight: 600;
  color: #111827;
  text-align: left;
  border-bottom-width: 1px;
  border-bottom-color: #d1d5db;
}

.prose table tbody td {
  padding-top: 1em;
  padding-right: 0.5714286em;
  padding-bottom: 1em;
  padding-left: 0.5714286em;
  border-bottom-width: 1px;
  border-bottom-color: #e5e7eb;
}

.prose table tbody tr:last-child td {
  border-bottom: 0;
}

/* Estilo específico para tablas con bordes (como en tu ejemplo) */
.prose table[style*="border"],
.prose table td[style*="border"] {
  padding: 12px 16px !important;
  /* Más espacio interno */
}

/* Ajustes para listas y tipografía */
.prose ul,
.prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.prose h2,
.prose h3,
.prose h4 {
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3333333;
}

/* Wrapper responsivo para tablas en móvil */
.ays-table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 2em;
}

/* Evitar doble margen si el wrapper ya lo tiene y forzar ancho mínimo */
.ays-table-responsive table {
  margin-top: 0;
  margin-bottom: 0;
  min-width: 600px;
  /* Forzar scroll en pantallas pequeñas para legibilidad */
}