/**
 * Viaje - Venta por Viaje
 * Estilos principales - Diseño responsive mobile-first
 */

/* ===== RESET Y VARIABLES ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #111827;
  --accent: #25D366;
  --accent-hover: #1fba59;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --price: #059669;
  --danger: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --transition: 0.2s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: #fff;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(37, 211, 102, 0.05) 0%, transparent 70%);
  animation: headerGlow 8s ease-in-out infinite alternate;
}

@keyframes headerGlow {
  from { transform: translate(0, 0); }
  to { transform: translate(5%, 5%); }
}

header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
  position: relative;
}

.btn-admin-header {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.3rem;
  text-decoration: none;
  z-index: 10;
  background: rgba(255, 255, 255, 0.15);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.btn-admin-header:hover {
  background: rgba(255, 255, 255, 0.3);
}

header p {
  font-size: 0.88rem;
  line-height: 1.6;
  opacity: 0.85;
  max-width: 650px;
  margin: 0 auto 1rem;
  position: relative;
}

.header-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.header-stat {
  font-size: 0.8rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-stat .stat-number {
  font-weight: 700;
  font-size: 1.1rem;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  position: relative;
}

.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

/* ===== TOOLBAR (Filtros y búsqueda) ===== */
.toolbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus { border-color: var(--accent); }

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
}

.filter-btn {
  padding: 0.6rem 1rem;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-light);
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { border-color: var(--accent); background: #ecfdf5; color: var(--price); font-weight: 600; }

.sort-select {
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.8rem;
  outline: none;
  background: var(--card-bg);
  cursor: pointer;
}

/* ===== GRID DE PRODUCTOS ===== */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .container { grid-template-columns: repeat(2, 1fr); padding: 1.5rem; gap: 1.5rem; }
}

@media (min-width: 1024px) {
  .container { grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
}

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  position: relative;
  animation: cardIn 0.4s ease;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card.hidden { display: none; }

/* Badges sobre la card */
.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-badge.vendido { background: var(--danger); color: white; }
.card-badge.reservado { background: var(--warning); color: white; }

/* Overlay diagonal para VENDIDO */
.card.status-sold {
  filter: grayscale(0.8);
  opacity: 0.75;
}

.card.status-sold::after {
  content: 'VENDIDO';
  position: absolute;
  top: 0;
  left: -20%;
  width: 140%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 900;
  color: rgba(220, 38, 38, 0.55);
  text-transform: uppercase;
  letter-spacing: 8px;
  transform: rotate(-30deg);
  z-index: 20;
  pointer-events: none;
}

.card.status-sold .buttons {
  pointer-events: none;
  opacity: 0.3;
}

.card.status-sold .price { display: none; }

/* Overlay diagonal para RESERVADO */
.card.status-reserved::after {
  content: 'RESERVADO';
  position: absolute;
  top: 0;
  left: -20%;
  width: 140%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 900;
  color: rgba(245, 158, 11, 0.55);
  text-transform: uppercase;
  letter-spacing: 6px;
  transform: rotate(-30deg);
  z-index: 20;
  pointer-events: none;
}

.card.status-reserved .price { display: none; }

/* Indicador de fotos */
.photo-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
}

/* ===== CARRUSEL (SWIPER) ===== */
.swiper {
  width: 100%;
  height: 250px;
  background: #000;
  flex-shrink: 0;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}

.swiper-slide img,
.swiper-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

/* ===== CONTENIDO DE CARD ===== */
.content {
  padding: 1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price {
  font-size: 1.35rem;
  color: var(--price);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.price.price-hidden {
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
}

.category-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.category-toolbar {
  padding-top: 0.5rem;
}

.category-btn.category-active {
  border-color: #4338ca;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
}

.description {
  color: var(--text-light);
  line-height: 1.5;
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.description.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.btn-ver-mas {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
  text-align: left;
}

.btn-ver-mas:hover { text-decoration: underline; }

/* ===== BOTONES DE CARD ===== */
.buttons {
  padding: 0 1.25rem 1rem;
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}


/* ===== SEPARADORES DE CATEGORÍA ===== */
.category-separator {
  grid-column: 1 / -1;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--primary), #374151);
  color: white;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.category-separator .cat-count {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.7;
  margin-left: auto;
}

.category-separator.sold-section {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  margin-top: 2rem;
}

/* ===== BOTONES DE CARD ===== */
.buttons {
  padding: 0.5rem 1rem 1rem;
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.4rem;
}

.btn-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-card:active { transform: scale(0.95); }

.btn-buy {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}
.btn-buy:hover { background: #e0e7ff; border-color: #818cf8; }

.btn-reserve {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}
.btn-reserve:hover { background: #fde68a; border-color: #f59e0b; }

.btn-wa {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: var(--price);
}
.btn-wa:hover { background: #dcfce7; border-color: var(--accent); }

.btn-share-card {
  background: #f9fafb;
  border-color: var(--border);
  color: var(--text-light);
  padding: 8px 10px;
}
.btn-share-card:hover { border-color: var(--accent); color: var(--accent); }

/* ===== BOTÓN FLOTANTE WHATSAPP ===== */
.wa-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  z-index: 9999;
  transition: var(--transition);
}

.wa-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.wa-float svg {
  width: 28px;
  height: 28px;
}

/* Nequi link clickeable */
.pay-method-link {
  display: inline-block;
  transition: var(--transition);
}
.pay-method-link:hover { transform: scale(1.05); }
.pay-method-img { height: 36px; border-radius: 6px; }

/* ===== PANEL DE PAGO (MODAL) ===== */
.payment-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99998;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.payment-modal.open { display: flex; }

.payment-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: cardIn 0.3s ease;
}

.payment-box h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.payment-box p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.payment-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  background: #f3f4f6;
  border-radius: 10px 10px 0 0;
}

.payment-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  padding: 0.5rem 0.75rem;
  background: #f3f4f6;
  border-radius: 0 0 10px 10px;
  margin-bottom: 1rem;
}

.payment-methods {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

.payment-methods img {
  height: 36px;
  border-radius: 6px;
}

.payment-box .btn-wa-confirm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  transition: var(--transition);
}

.payment-box .btn-wa-confirm:hover { background: var(--accent-hover); }

.payment-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

/* ===== ESTADOS ===== */
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
  font-size: 1rem;
}

.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--danger);
  font-size: 0.9rem;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

/* ===== TOAST (notificaciones) ===== */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 99999;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 99999;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 999999;
  background: none;
  border: none;
  line-height: 1;
}

.modal-close:hover { opacity: 0.7; }

.modal-swiper-container {
  width: 95%;
  height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-swiper { width: 100%; height: 100%; background: transparent; }
.modal-swiper .swiper-slide { display: flex; align-items: center; justify-content: center; background: transparent; }
.modal-swiper .swiper-slide img { max-width: 100%; max-height: 90vh; object-fit: contain; }
.modal-swiper .swiper-slide video { max-width: 100%; max-height: 90vh; object-fit: contain; }
.modal-nav { color: white !important; }
.modal-nav::after { font-size: 28px !important; }
.modal-pagination .swiper-pagination-bullet { background: white; opacity: 0.6; }
.modal-pagination .swiper-pagination-bullet-active { opacity: 1; }

/* ===== FOOTER ===== */
footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  margin-top: 2rem;
}

footer strong { color: white; }

/* ===== RESPONSIVE ===== */
@media (max-width: 599px) {
  header { padding: 1.75rem 1rem 1.5rem; }
  header h1 { font-size: 1.35rem; }
  header p { font-size: 0.8rem; }
  .header-stats { gap: 1rem; }
  .toolbar { padding: 0.75rem 1rem 0; }
  .swiper { height: 220px; }
  .title { font-size: 0.9rem; }
  .price { font-size: 1.15rem; }
}
