/* ============================================
   Estilos específicos - Explorar Restaurantes
   El Carboncito Food Guide
   ============================================ */

:root {
  --explorar-primary: #e74c3c;
  --explorar-primary-dark: #c0392b;
  --explorar-primary-light: #ff6b6b;
}

/* ─── Hero ──────────────────────────────────── */

.explorar-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 60px 20px 40px;
  text-align: center;
}

.explorar-header h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.explorar-header p {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Contenedor principal ──────────────────── */

.explorar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 80px;
}

/* ─── Barra de búsqueda y filtros ──────────── */

.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1;
  min-width: 200px;
  padding: 14px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--explorar-primary);
  box-shadow: 0 0 0 3px rgba(231,76,60,0.1);
}

.search-bar select {
  padding: 14px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1rem;
  background: white;
  min-width: 180px;
  cursor: pointer;
}

.search-bar select:focus {
  outline: none;
  border-color: var(--explorar-primary);
}

/* Botón "Cerca de mí" */
#btn-cerca-de-mi {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  background: white;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}

#btn-cerca-de-mi:hover {
  border-color: var(--explorar-primary);
  background: #fff5f5;
  color: var(--explorar-primary);
}

#btn-cerca-de-mi:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Filtros rápidos */
.filtros-rapidos {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filtro-rapido {
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid #e0e0e0;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  font-family: inherit;
}

.filtro-rapido:hover {
  border-color: var(--explorar-primary);
  color: var(--explorar-primary);
}

.filtro-rapido.activo {
  background: var(--explorar-primary);
  color: white;
  border-color: var(--explorar-primary);
}

/* ─── Geo Status ────────────────────────────── */

#geo-status {
  display: none;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Grid de restaurantes ──────────────────── */

.restaurantes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* ─── Tarjetas de restaurante (rediseñadas) ── */

.rest-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
  animation: fadeInUp 0.5s ease both;
}

.rest-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.rest-card-header {
  height: 140px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.rest-card-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.15));
}

.rest-card-header img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.rest-card:hover .rest-card-header img {
  transform: scale(1.05);
}

.rest-card-header .no-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border: 4px solid white;
}

/* Badge de estado (abierto/cerrado) */
.rest-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.rest-card-badge.abierto {
  background: rgba(39, 174, 96, 0.9);
  color: white;
}

.rest-card-badge.cerrado {
  background: rgba(231, 76, 60, 0.9);
  color: white;
}

.rest-card-body {
  padding: 20px;
}

.rest-card-body h3 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  color: #1a1a2e;
  font-weight: 700;
}

.rest-card-body .desc {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.rest-card-body .info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #555;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.rest-card-body .info-row svg {
  flex-shrink: 0;
}

.rest-card-body .categorias {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.rest-card-body .categoria-tag {
  background: #f0f0f0;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #555;
  transition: background 0.2s;
}

.rest-card-body .categoria-tag:hover {
  background: #e0e0e0;
}

/* Precio promedio */
.precio-promedio {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.85rem;
  color: #888;
  font-weight: 500;
}

.precio-promedio .dolar {
  color: var(--explorar-primary);
}

/* Botón Ver Menú */
.rest-card-body .btn-ver-menu {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 24px;
  background: var(--explorar-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  text-decoration: none;
}

.rest-card-body .btn-ver-menu:hover {
  background: var(--explorar-primary-dark);
  transform: translateY(-1px);
}

/* Botón compartir */
.btn-compartir {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-left: 8px;
}

.btn-compartir:hover {
  border-color: #25D366;
  color: #25D366;
  background: #f0fdf4;
}

/* ─── Skeleton Loading ──────────────────────── */

.skeleton-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.skeleton-header {
  height: 140px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-body {
  padding: 20px;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  margin-bottom: 10px;
}

.skeleton-line:first-child {
  width: 70%;
  height: 18px;
}

.skeleton-line:nth-child(2) {
  width: 90%;
}

.skeleton-line:nth-child(3) {
  width: 50%;
}

.skeleton-line:nth-child(4) {
  width: 60%;
  height: 30px;
  margin-top: 14px;
  margin-bottom: 0;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─── Estados vacíos ────────────────────────── */

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #999;
  grid-column: 1 / -1;
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  color: #666;
  margin-bottom: 8px;
}

.loading {
  text-align: center;
  padding: 60px;
  color: #999;
  grid-column: 1 / -1;
}

.loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f0f0f0;
  border-top-color: var(--explorar-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Animaciones ───────────────────────────── */

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

/* ─── Paginación ────────────────────────────── */

.paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 20px 0;
}

.paginacion button {
  padding: 10px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}

.paginacion button:hover:not(:disabled) {
  border-color: var(--explorar-primary);
  color: var(--explorar-primary);
}

.paginacion button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.paginacion button.activo {
  background: var(--explorar-primary);
  color: white;
  border-color: var(--explorar-primary);
}

.paginacion .info-pagina {
  font-size: 0.85rem;
  color: #888;
  padding: 0 12px;
}

/* ─── Modal de vista rápida del menú ────────── */

.modal-overlay-explorar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 10001;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-overlay-explorar.open {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content-explorar {
  background: white;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-explorar {
  position: sticky;
  top: 0;
  background: white;
  padding: 24px 24px 16px;
  border-bottom: 1px solid #f0f0f0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header-explorar h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #1a1a2e;
}

.modal-header-explorar .rest-info {
  font-size: 0.85rem;
  color: #888;
  margin-top: 4px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.modal-body-explorar {
  padding: 16px 24px 24px;
}

.modal-categoria {
  margin-bottom: 20px;
}

.modal-categoria h4 {
  font-size: 1rem;
  color: var(--explorar-primary);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #f0f0f0;
}

.modal-producto-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f8f8f8;
}

.modal-producto-item:last-child {
  border-bottom: none;
}

.modal-producto-item .prod-nombre {
  font-size: 0.9rem;
  color: #333;
  font-weight: 500;
}

.modal-producto-item .prod-precio {
  font-size: 0.9rem;
  color: var(--explorar-primary);
  font-weight: 700;
}

.modal-producto-item .prod-desc {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

.modal-footer-explorar {
  padding: 16px 24px 24px;
  border-top: 1px solid #f0f0f0;
  text-align: center;
}

.modal-footer-explorar .btn-pedir-ahora {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--explorar-primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.modal-footer-explorar .btn-pedir-ahora:hover {
  background: var(--explorar-primary-dark);
}

/* ─── Vista de Mapa ─────────────────────────── */

.vista-mapa-container {
  display: none;
  height: 500px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 24px;
}

.vista-mapa-container.open {
  display: block;
}

#explorar-mapa {
  width: 100%;
  height: 100%;
}

.toggle-vista-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}

.toggle-vista-btn:hover {
  border-color: var(--explorar-primary);
  color: var(--explorar-primary);
}

.toggle-vista-btn.activo {
  background: var(--explorar-primary);
  color: white;
  border-color: var(--explorar-primary);
}

/* ─── Responsive ────────────────────────────── */

@media (max-width: 768px) {
  .explorar-header {
    padding: 50px 16px 30px;
  }
  .explorar-header h1 {
    font-size: 1.8rem;
  }
  .explorar-header p {
    font-size: 0.95rem;
  }
  .restaurantes-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .search-bar {
    flex-direction: column;
  }
  .search-bar input,
  .search-bar select,
  #btn-cerca-de-mi {
    width: 100%;
    min-width: unset;
  }
  .filtros-rapidos {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .filtro-rapido {
    flex-shrink: 0;
  }
  .modal-content-explorar {
    width: 95%;
    max-height: 90vh;
    border-radius: 16px;
  }
  .vista-mapa-container {
    height: 350px;
  }
}

@media (max-width: 480px) {
  .explorar-header h1 {
    font-size: 1.4rem;
  }
  .explorar-header p {
    font-size: 0.88rem;
  }
  .rest-card-header {
    height: 120px;
  }
  .rest-card-header img,
  .rest-card-header .no-logo {
    width: 64px;
    height: 64px;
  }
  .rest-card-body {
    padding: 16px;
  }
  .rest-card-body h3 {
    font-size: 1.1rem;
  }
  .modal-header-explorar {
    padding: 16px 16px 12px;
  }
  .modal-body-explorar {
    padding: 12px 16px 16px;
  }
  .modal-footer-explorar {
    padding: 12px 16px 16px;
  }
}

@media (max-width: 400px) {
  .explorar-header h1 {
    font-size: 1.2rem;
  }
  .rest-card-header {
    height: 100px;
  }
}
