/* =====================================================================
   FarmaAhorro Colombia — estilos
   Replica el mockup: header blanco, buscador central en píldora azul,
   badges de ciudad, tarjeta "Mejor Opción" destacada, lista de opciones
   económicas y sidebar de promociones del día.
   ===================================================================== */

:root {
  --fa-blue: #1B5FAE;
  --fa-blue-dark: #14497f;
  --fa-blue-light: #EAF2FB;
  --fa-green: #2FA84F;
  --fa-green-dark: #23843e;
  --fa-text: #1F2937;
  --fa-text-muted: #6B7280;
  --fa-border: #E3E8EF;
  --fa-bg: #F4F7FB;
  --fa-white: #FFFFFF;
  --fa-radius: 12px;
  --fa-shadow: 0 2px 10px rgba(20, 40, 80, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--fa-bg);
  color: var(--fa-text);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Top bar ---------- */
.fa-topbar {
  background: var(--fa-white);
  border-bottom: 1px solid var(--fa-border);
}
.fa-topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.fa-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 19px;
  color: var(--fa-blue);
  white-space: nowrap;
}
.fa-logo__text small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--fa-green);
  letter-spacing: .3px;
}
.fa-nav {
  display: flex;
  gap: 22px;
  flex: 1;
}
.fa-nav__link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fa-text-muted);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.fa-nav__link.is-active {
  color: var(--fa-blue);
  font-weight: 700;
  border-bottom-color: var(--fa-blue);
}
.fa-topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  white-space: nowrap;
}
.fa-btn--sm { padding: 8px 14px; font-size: 13.5px; }
.fa-btn--outline {
  background: var(--fa-white);
  color: var(--fa-blue);
  border: 1.5px solid var(--fa-blue);
}
.fa-btn--outline:hover { background: var(--fa-blue-light); }
.fa-btn--primary { background: var(--fa-blue); color: var(--fa-white); }
.fa-btn--primary:hover { background: var(--fa-blue-dark); }
.fa-btn--green { background: var(--fa-green); color: var(--fa-white); }
.fa-btn--green:hover { background: var(--fa-green-dark); }
.fa-btn--block { width: 100%; justify-content: center; }
.fa-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--fa-border);
  background: var(--fa-white);
  color: var(--fa-blue);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.fa-icon-btn--alert::after {
  content: '';
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #E4573D; border: 1.5px solid var(--fa-white);
}

/* ---------- Search ---------- */
.fa-main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 48px; }
.fa-search-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; }
.fa-search-form {
  width: 100%; max-width: 640px;
  display: flex; align-items: center;
  background: var(--fa-white);
  border: 2px solid var(--fa-blue);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  box-shadow: var(--fa-shadow);
}
.fa-search-form__icon { color: var(--fa-blue); flex-shrink: 0; }
.fa-search-form__input {
  flex: 1; border: none; outline: none; font-size: 15px;
  padding: 10px 12px; background: transparent; color: var(--fa-text);
}
.fa-search-form__submit {
  background: var(--fa-blue); border: none; border-radius: 999px;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.fa-filters {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 16px;
}
.fa-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--fa-white); border: 1px solid var(--fa-border);
  border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 500;
  color: var(--fa-text);
}
.fa-chip svg { color: var(--fa-blue); }
.fa-chip.is-active { border-color: var(--fa-blue); background: var(--fa-blue-light); color: var(--fa-blue); font-weight: 700; }
.fa-chip--ghost { color: var(--fa-text-muted); }
.fa-chip--ghost svg { color: var(--fa-text-muted); }

/* ---------- Results layout ---------- */
.fa-results-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 880px) {
  .fa-results-grid { grid-template-columns: 1fr; }
}

/* Best option card */
.fa-best {
  position: relative;
  background: var(--fa-white);
  border: 2px solid var(--fa-blue);
  border-radius: var(--fa-radius);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--fa-shadow);
}
.fa-best__badge {
  position: absolute; top: -14px; left: 20px;
  background: var(--fa-blue); color: var(--fa-white);
  font-size: 12.5px; font-weight: 700;
  padding: 5px 14px; border-radius: 999px;
  display: flex; align-items: center; gap: 6px;
}
.fa-best__body { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.fa-logo-box {
  width: 96px; height: 64px; border-radius: 8px; border: 1px solid var(--fa-border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--fa-white);
  font-weight: 800; overflow: hidden;
}
.fa-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fa-best__info { flex: 1; min-width: 200px; }
.fa-best__title { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.fa-best__price { font-size: 22px; font-weight: 800; color: var(--fa-text); margin: 4px 0 0; }
.fa-best__actions { display: flex; flex-direction: column; gap: 8px; min-width: 190px; }

/* Otras opciones */
.fa-section-title { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.fa-option {
  display: flex; align-items: center; gap: 16px;
  background: var(--fa-white); border: 1px solid var(--fa-border); border-radius: var(--fa-radius);
  padding: 14px 18px; margin-bottom: 12px;
}
.fa-option__logo {
  width: 76px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid var(--fa-border); font-weight: 800; flex-shrink: 0; overflow: hidden;
}
.fa-option__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fa-option__info { flex: 1; }
.fa-option__name { font-size: 14.5px; margin: 0 0 4px; color: var(--fa-text-muted); }
.fa-option__price { font-size: 16px; font-weight: 700; margin: 0; }
.fa-option__action { flex-shrink: 0; }

/* Sidebar promos */
.fa-promo-card {
  background: var(--fa-white); border: 1px solid var(--fa-border); border-radius: var(--fa-radius);
  padding: 18px;
}
.fa-promo-card__title { font-size: 15px; font-weight: 700; margin: 0 0 14px; }
.fa-promo-item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--fa-border); }
.fa-promo-item:first-of-type { border-top: none; }
.fa-promo-item__icon {
  width: 38px; height: 38px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--fa-blue-light);
  font-size: 18px;
}
.fa-promo-item__title { font-size: 13.5px; font-weight: 600; margin: 0 0 4px; line-height: 1.3; }
.fa-promo-item__link { font-size: 13px; color: var(--fa-blue); font-weight: 600; }

/* Empty / info states */
.fa-empty { text-align: center; padding: 60px 20px; color: var(--fa-text-muted); }

/* ---------- Footer ---------- */
.fa-footer { border-top: 1px solid var(--fa-border); background: var(--fa-white); margin-top: 40px; }
.fa-footer__inner {
  max-width: 1200px; margin: 0 auto; padding: 18px 24px;
  display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--fa-text-muted);
}

/* ---------- Admin ---------- */
.fa-admin-shell { display: flex; min-height: 100vh; background: var(--fa-bg); }
.fa-admin-sidebar { width: 240px; background: var(--fa-blue-dark); color: #fff; padding: 20px 16px; flex-shrink: 0; }
.fa-admin-sidebar a { display: block; padding: 10px 12px; border-radius: 8px; color: #DCE8F7; font-size: 14px; margin-bottom: 4px; }
.fa-admin-sidebar a:hover, .fa-admin-sidebar a.is-active { background: rgba(255,255,255,.12); color: #fff; }
.fa-admin-content { flex: 1; padding: 28px; }
.fa-card { background: var(--fa-white); border: 1px solid var(--fa-border); border-radius: var(--fa-radius); padding: 22px; margin-bottom: 20px; }
.fa-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fa-table th, .fa-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--fa-border); }
.fa-table th { color: var(--fa-text-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; }
.fa-form-group { margin-bottom: 14px; }
.fa-form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.fa-form-group input, .fa-form-group select, .fa-form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--fa-border); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.fa-login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.fa-login-card { width: 100%; max-width: 380px; background: var(--fa-white); border-radius: var(--fa-radius); padding: 32px; box-shadow: var(--fa-shadow); }
.fa-alert { padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px; }
.fa-alert--error { background: #FDECEC; color: #C0392B; }
.fa-alert--success { background: #E9F9EF; color: #1E7E42; }

/* ---------- Detalle de farmacia ---------- */
.fa-detail-hero { display: flex; gap: 20px; align-items: center; background: var(--fa-white); border: 1px solid var(--fa-border); border-radius: var(--fa-radius); padding: 22px; margin-bottom: 20px; }
#fa-map { width: 100%; height: 380px; border-radius: var(--fa-radius); overflow: hidden; border: 1px solid var(--fa-border); }
.fa-sucursal-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--fa-border); cursor: pointer; }
.fa-sucursal-item:hover { background: var(--fa-blue-light); }
.fa-sucursal-item:last-child { border-bottom: none; }
