/*
 * Estilos globales para SkyMarket.ar
 * Inspirados en la estética limpia y llamativa de sitios de comercio
 * como Mercado Libre, pero adaptados a la temática de paracaidismo.
 */

/*
 * Paleta de colores actualizada para alinearse con el logotipo de SkyMarket.
 * Definimos variables CSS para reutilizar los colores primarios (azul) y
 * secundarios (verde). Esto nos permitirá actualizar fácilmente la
 * estética de todos los elementos interactivos (botones, tarjetas, etc.)
 * sin necesidad de repetir valores en varias reglas.
 */
:root {
  --primary: #4b70ff; /* azul principal inspirado en la primera palabra del logo */
  --secondary: #a4fc3f; /* verde luminoso inspirado en la segunda palabra del logo */
  --primary-dark: #364fb6;
  --secondary-dark: #7cc830;
  --bg-light: #f5f7fb;
  --text-dark: #333;
  --text-light: #fff;
  --card-bg: #ffffff;
  --shadow-sm: rgba(0, 0, 0, 0.05);
  --shadow-md: rgba(0, 0, 0, 0.1);
}

/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
}

/* Centrar el contenido principal en todas las páginas para mejorar la
 * lectura. Limitar el ancho y centrar el bloque. Las páginas que
 * necesiten ocupar todo el ancho (por ejemplo, la hero) pueden
 * sobrescribir esta regla usando estilos en línea o reglas más
 * específicas. */
main {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Navegación */
/* Barra de navegación
 * Se adapta al logotipo con fondo oscuro provisto por el usuario.
 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 2rem;
  background-color: #000; /* fondo negro para armonizar con el logo */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

/* El logo se mostrará a través de una imagen, ajustar su tamaño */
.logo img {
  height: 44px;
  width: auto;
  display: block;
}

.search-bar {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 500px;
  margin: 0 1rem;
}
.search-bar input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 4px 0 0 4px;
  font-size: 0.9rem;
  outline: none;
  background: #fff;
  color: #333;
}
.search-bar .search-button {
  padding: 0.5rem 0.75rem;
  border: none;
  border-left: 1px solid #ddd;
  background: #fff;
  border-radius: 0 4px 4px 0;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  color: #333;
}
.search-bar .search-button:hover {
  background: #e6e6e6;
}

.nav-links a {
  margin-left: 1rem;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover {
  text-decoration: underline;
  color: #b3b3b3;
}

/* Sección hero */
.hero {
  position: relative;
  width: 100%;
  /* Aumentamos la altura mínima del banner para mostrar mejor las imágenes completas */
  min-height: 80vh;
  /* El banner ahora contendrá un slider con imágenes de paracaidismo.
     La imagen de fondo original se elimina para dejar paso al slider. */
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 4rem; /* espacio para la navbar */
  margin-bottom: 2rem;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
}
.hero .hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 600px;
  padding: 2rem;
}

/* Slider de imágenes en la portada */
.hero .slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}
.hero .slider img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Ajustamos la posición del objeto para mostrar mejor el logo y el contenido de la imagen. */
  object-position: center bottom;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.hero .slider img.active {
  opacity: 1;
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.hero p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.cta-button {
  display: inline-block;
  /* Utiliza un color sólido basado en el azul del logo para mayor coherencia */
  background: var(--primary);
  color: var(--text-light);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 2px 4px var(--shadow-md);
  transition: filter 0.3s ease;
}
.cta-button:hover {
  filter: brightness(1.1);
}

/* Categorías */
.categories {
  padding: 2rem;
  background: var(--card-bg);
  border-top: 2px solid var(--primary);
  box-shadow: 0 1px 3px var(--shadow-sm);
  max-width: 1200px;
  margin: 0 auto;
}
.categories h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: #333;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.category-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  border: 1px solid #e9eefc;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px var(--shadow-md);
  /* Al pasar el ratón por la categoría, resaltarla con un color sólido y
     cambiar el color del texto para mejorar la legibilidad. */
  background: var(--primary);
  color: var(--text-light);
}
.category-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.category-card h3 {
  font-size: 1rem;
  color: var(--text-dark);
}

/* Productos */
.listings {
  padding: 2rem;
  background: #f5f5f5;
  max-width: 1200px;
  margin: 0 auto;
}
.listings h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: #333;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.product-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.product-image {
  height: 140px;
  /* Utilizamos un degradado que mezcla nuestros colores principales y
     secundarios para crear tarjetas más vibrantes. */
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.product-info {
  padding: 1rem;
}
.product-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: var(--text-dark);
}
.price {
  color: var(--secondary-dark);
  font-weight: bold;
  margin-bottom: 0.2rem;
}
.location {
  font-size: 0.85rem;
  color: #777;
}

/* Pie de página */
footer {
  background: #333;
  color: #fff;
  padding: 1rem 2rem;
  text-align: center;
}
footer p {
  font-size: 0.85rem;
}

/* ---------- Sugerencias de búsqueda ---------- */
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.suggestion-item {
  padding: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.suggestion-item:hover {
  background: #f0f0f0;
}

/* ---------- Barra de filtros para listado de productos ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="checkbox"] {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Ajuste para select de idioma en la navbar */
#lang-select {
  margin-left: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: none;
  background: #333;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

/* ---------- Tarjetas de eventos y trabajos ---------- */
.event-card,
.job-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ---------- Reseñas ---------- */
.review {
  margin-bottom: 1rem;
}

.review .stars {
  color: #ffb400;
  margin-left: 0.25rem;
  font-size: 0.9rem;
}

/* ---------- Detalle de producto ---------- */
.product-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.product-detail-image {
  flex: 1 1 300px;
  height: 280px;
  background: linear-gradient(135deg, #00a6fb, #0077be);
  border-radius: 8px;
}

.product-detail-info {
  flex: 1 1 300px;
}
.product-detail-info p {
  margin-bottom: 0.5rem;
}

.reviews-section h2 {
  margin-bottom: 0.5rem;
}
.review-form label {
  font-weight: 600;
}

/* ---------- Tablas básicas ---------- */
table {
  border: 1px solid #e0e0e0;
}
table th, table td {
  border-bottom: 1px solid #e0e0e0;
}

/* Adaptaciones responsivas */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .nav-links a {
    margin-left: 0.5rem;
    font-size: 0.8rem;
  }
  .search-bar input {
    max-width: 180px;
  }
}

@media (max-width: 480px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-bar {
    width: 100%;
    margin: 0.5rem 0;
  }
  .nav-links {
    display: flex;
    flex-wrap: wrap;
  }
  .nav-links a {
    margin: 0.25rem 0.5rem;
  }
  .hero {
    min-height: 50vh;
  }
}

/* ---------- Planes de suscripción ---------- */
.subscriptions {
  background: var(--bg-light);
  max-width: 1200px;
  margin: 0 auto;
}

.plans-grid .plan-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 6px var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.plans-grid .plan-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 14px var(--shadow-md);
}
.plans-grid .plan-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  color: var(--primary-dark);
}
.plans-grid .plan-card .price {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: var(--primary-dark);
}
.plans-grid .plan-card p {
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

/* ---------- Soporte flotante ---------- */
.support-chat-button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  background: var(--primary);
  color: var(--text-light);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 8px var(--shadow-md);
  cursor: pointer;
  transition: filter 0.3s ease;
}
.support-chat-button:hover {
  filter: brightness(1.1);
}

/* Etiqueta para productos marcados como vendidos */
.sold-badge {
  display: inline-block;
  background: #f44336;
  color: #fff;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Estilos para enlaces de compartir */
.share-section {
  font-size: 0.9rem;
}
.share-link {
  color: var(--primary-dark);
  text-decoration: underline;
  cursor: pointer;
}
.share-link:hover {
  color: var(--primary);
}

#support-chat {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 320px;
  max-height: 400px;
  display: none;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--shadow-md);
  z-index: 2000;
}
#support-chat .chat-header {
  padding: 0.75rem;
  background: var(--primary);
  color: var(--text-light);
  font-weight: bold;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
#support-chat .chat-messages {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
  font-size: 0.9rem;
}
#support-chat .chat-messages .msg {
  margin-bottom: 0.5rem;
}
#support-chat .chat-messages .msg.support {
  color: var(--primary-dark);
}
#support-chat .chat-messages .msg.user {
  color: var(--secondary-dark);
  text-align: right;
}
#support-chat form {
  padding: 0.75rem;
  border-top: 1px solid #eee;
  display: flex;
}
#support-chat input[type="text"] {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}
#support-chat button {
  margin-left: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#support-chat button:hover {
  filter: brightness(1.1);
}

/* ---------- Secciones extra en la portada ---------- */
.home-extras {
  padding: 2rem;
  background: var(--card-bg);
  border-top: 2px solid var(--primary);
  box-shadow: 0 2px 4px var(--shadow-sm);
  max-width: 1200px;
  margin: 0 auto;
}
.home-extras h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.events-grid .event-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px var(--shadow-sm);
}
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.quick-links a {
  flex: 1;
  min-width: 120px;
  background: var(--primary);
  color: var(--text-light);
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 2px 4px var(--shadow-md);
  transition: filter 0.2s ease;
}
.quick-links a:hover {
  filter: brightness(1.1);
}

/* Ajuste de ancho para la sección informativa */
.info {
  max-width: 1200px;
  margin: 0 auto;
}