/* assets/css/styles.css */

/* 🎨 Paleta base (modo oscuro por defecto) */
:root {
  /* Fondo: Tonos oscuros profundos */
  --bg-dark: oklch(0.12 0.01 260);
  --bg: oklch(0.19 0.02 260); /* Un poco más claro que el fondo base */
  --bg-light: oklch(0.25 0.03 260);

  /* Acento: Naranja Energético (User Preference) */
  --primary: #fe8505;
  --primary-hover: #e52e01;

  --text: oklch(0.98 0 0);
  --text-muted: oklch(0.7 0.02 260);

  /* Bordes sutiles para separar en modo oscuro (donde la sombra se pierde) */
  --border-subtle: 1px solid rgba(255, 255, 255, 0.08);

  /* Sombras: Mucho más agresivas en oscuridad para notarse */
  --shadow-small: 0 2px 4px rgba(0, 0, 0, 0.6);
  --shadow-medium:
    0 8px 20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05); /* Truco: borde luz sutil */
  --shadow-large:
    0 15px 35px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ☀️ Modo claro */
body.light-mode {
  /* Fondo crema "principal" solicitado */
  --bg-dark: #fffdef;
  --bg: #ffffff; /* Tarjetas blancas para resaltar sobre el crema */
  --bg-light: #f7f7f7; /* Inputs un poco más grises */

  /* Acento se mantiene igual en ambos modos para identidad de marca */
  --primary: #fe8505;
  --primary-hover: #e52e01;

  --text: oklch(0.15 0.02 260);
  --text-muted: oklch(0.45 0.04 260);

  /* Sombras para modo claro: sutiles pero presentes */
  --border-subtle: 1px solid rgba(0, 0, 0, 0.05);
  --shadow-small:
    0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-medium:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-large:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 🌐 Estilos generales */
* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centrar contenido por defecto */
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}

/* Contenedores */
.container {
  width: 100%;
  max-width: 400px; /* Perfecto para móviles y formularios de login */
  padding: 20px;
  margin-top: 50px;
  background-color: var(--bg);
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
}

h1,
h2,
h3 {
  text-align: center;
  margin-bottom: 20px;
}

/* Formularios */
.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid transparent; /* Para evitar saltos en focus */
  background-color: var(--bg-light);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: 0.3s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-hover);
}

/* Botones */
.btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition:
    transform 0.2s,
    background-color 0.3s;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-small);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.link-text {
  display: block;
  text-align: center;
  margin-top: 15px;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.link-text:hover {
  text-decoration: underline;
}

/* Responsive & Mobile First Tweaks */

/* Hamburger Menu */
.menu-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}

.nav-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

@media (max-width: 768px) {
  header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-actions {
    position: fixed;
    top: 60px; /* Altura del header aprox */
    right: -100%;
    width: 250px;
    height: calc(100vh - 60px);
    background-color: var(--bg);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    padding: 20px;
    transition: right 0.3s ease;
    border-left: 1px solid var(--border-subtle);
  }

  .nav-actions.active {
    right: 0;
  }

  .nav-actions button,
  .nav-actions a {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }

  /* Grid Adjustments for Mobile */
  .business-grid,
  .product-grid {
    grid-template-columns: 1fr !important; /* Una sola columna en móvil */
    gap: 15px;
  }

  .container {
    padding: 15px;
  }

  /* Make buttons bigger for touch */
  .btn {
    padding: 12px 20px;
    font-size: 1rem;
  }

  /* Product Item in Business Detail */
  .product-item {
    flex-direction: row; /* Mantener row si cabe, o column si es muy chico */
  }

  .product-img {
    width: 120px;
    height: 120px;
  }
}

/* 🔔 Toasts Notifications */
/* 🔔 Toasts Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none; /* Allow clicks through container */
}

.toast {
  background-color: #ffffff; /* Fallback */
  background-color: var(--bg);
  color: #333; /* Fallback */
  color: var(--text);
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Stronger shadow */
  border-left: 5px solid var(--primary);
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  min-width: 280px;
  font-size: 0.95rem;
  pointer-events: auto; /* Enable clicks on toasts */
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-left-color: #2ecc71;
}
.toast-error {
  border-left-color: #e74c3c;
}
.toast-info {
  border-left-color: var(--primary);
}

/* ℹ️ Tooltips Helpers */
.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; /* Slightly larger */
  height: 24px;
  background-color: #333 !important; /* Force dark background */
  color: #fff !important;
  border-radius: 50% !important; /* Force circle */
  font-size: 0.85rem;
  margin-left: 8px;
  cursor: pointer;
  font-weight: bold;
  user-select: none;
  border: 2px solid rgba(255, 255, 255, 0.5); /* Cleaner border */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  line-height: 1; /* Center text vertically */
}

.tooltip-icon:active,
.tooltip-icon:hover {
  transform: scale(1.1);
  background-color: #000 !important;
  border-color: var(--primary);
}
