/* =========================================================
   NOCHISGO - CORE STYLESHEET
   Aesthetic: Apple Glassmorphism / Deluxe Theme
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* --- 1. RESET Y BASE --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Poppins", sans-serif;
  /* Fondo característico Apple: Gris perla con sutiles destellos radiales */
  background-color: #f5f5f7;
  background-image:
    radial-gradient(
      circle at 15% 20%,
      rgba(230, 126, 34, 0.06),
      transparent 30%
    ),
    radial-gradient(
      circle at 85% 80%,
      rgba(10, 132, 255, 0.06),
      transparent 30%
    );
  background-attachment: fixed;
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ocultar barra de scroll global en navegadores Webkit para un look más "App" */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* --- 1.5 ACCESIBILIDAD GLOBAL (WCAG AAA) --- */
/* Indicadores de foco de alto contraste exclusivos para navegación por teclado */
:focus-visible {
  outline: 3px solid #0a84ff !important;
  outline-offset: 4px !important;
  border-radius: 6px;
}

/* Evitar outline genérico en elementos que ya tienen foco personalizado abajo */
.tarjeta:focus-visible,
.negocio-item:focus-visible,
.input-glass:focus-visible {
  outline: none !important;
}

/* --- 2. TARJETAS Y GRID (GLASSMORPHISM) --- */
.contenedor-categorias,
.grid-negocios {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
  padding: 20px;
  max-width: 1050px;
  margin: 0 auto;
}

.grid-negocios {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.tarjeta,
.negocio-item {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  text-decoration: none;
  color: #1d1d1f;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  overflow: hidden;
}

.tarjeta {
  padding: 25px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tarjeta:hover,
.tarjeta:active,
.negocio-item:hover,
.negocio-item:active {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 1);
}

/* ACCESIBILIDAD: Foco brillante adaptado a la forma de la tarjeta */
.tarjeta:focus-visible,
.negocio-item:focus-visible {
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.5) !important;
  border-color: #0a84ff !important;
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-4px);
}

.tarjeta .icono {
  font-size: 3rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.tarjeta:hover .icono,
.tarjeta:focus-visible .icono {
  transform: scale(1.1);
}

.tarjeta h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.tarjeta p {
  font-size: 0.8rem;
  color: #86868b;
  line-height: 1.2;
}

/* --- 3. BOTONES PREMIUM --- */
.btn-moderno,
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}

.btn-moderno:active,
.btn-action:active {
  transform: scale(0.96);
}

/* Variantes de Botones */
.btn-black {
  background: linear-gradient(135deg, #1d1d1f 0%, #434345 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.btn-black:hover,
.btn-black:focus-visible {
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, #000000 0%, #2c2c2e 100%);
}

.btn-blue {
  background: #0a84ff;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(10, 132, 255, 0.3);
}
.btn-blue:hover,
.btn-blue:focus-visible {
  background: #0071e3;
  box-shadow: 0 12px 25px rgba(10, 132, 255, 0.4);
}

.btn-green {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}
.btn-green:hover,
.btn-green:focus-visible {
  background: linear-gradient(135deg, #20c35b 0%, #0e7b6d 100%);
  box-shadow: 0 12px 25px rgba(37, 211, 102, 0.4);
}

/* --- 4. ESTADOS Y BADGES --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.status-open {
  background-color: rgba(48, 209, 88, 0.15);
  color: #248a3d;
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.status-closed {
  background-color: rgba(255, 69, 58, 0.15);
  color: #c93429;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.dot {
  height: 8px;
  width: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-open .dot {
  background-color: #30d158;
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.5);
}
.status-closed .dot {
  background-color: #ff453a;
  box-shadow: 0 0 8px rgba(255, 69, 58, 0.5);
}

/* --- 5. BUSCADORES E INPUTS (SPOTLIGHT) --- */
.input-glass {
  width: 100%;
  padding: 16px 20px 16px 50px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 500;
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  outline: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-sizing: border-box;
}

.input-glass:focus,
.input-glass:focus-visible {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 32px rgba(10, 132, 255, 0.25) !important;
  border-color: #0a84ff !important;
  transform: translateY(-2px);
}

/* --- 6. MODALES Y BOTTOM SHEETS --- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  align-items: flex-end; /* En móvil sale desde abajo */
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-glass {
  background: rgba(245, 245, 247, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  border-radius: 30px 30px 0 0;
  overflow-y: auto;
  position: relative;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  padding-bottom: 30px;
}

.modal-drag-handle {
  width: 40px;
  height: 5px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  margin: 15px auto;
}

/* --- 7. RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
  .modal-overlay {
    align-items: flex-end;
  }
  .modal-glass {
    border-radius: 25px 25px 0 0;
  }
}

@media (min-width: 769px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-glass {
    border-radius: 30px;
    transform: scale(0.9);
  }
  .modal-drag-handle {
    display: none;
  }
}

@media (max-width: 480px) {
  .contenedor-categorias {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 15px;
  }
  .tarjeta {
    padding: 20px 10px;
    border-radius: 20px;
  }
  .tarjeta .icono {
    font-size: 2.5rem;
  }
  .tarjeta h2 {
    font-size: 0.95rem;
  }
  .input-glass {
    font-size: 16px; /* Previene zoom automático en iOS */
  }
}
