/* =============================================================================
   Navarro Express — Components
   Buttons, badges, cards, header/nav, footer, forms, floating actions.
   ============================================================================= */

/* -------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-5);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  line-height: 1;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--grad-cta); color: var(--white); box-shadow: var(--sh-sm); }
.btn-primary:hover { color: var(--white); box-shadow: var(--sh-md); transform: translateY(-1px); }

.btn-secondary { background: var(--white); color: var(--navy); border-color: var(--gray-300); }
.btn-secondary:hover { color: var(--navy); border-color: var(--ocean-600); background: var(--ocean-100); }

.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { color: var(--ocean-700); background: var(--ocean-100); }

.btn-on-dark { background: rgba(255,255,255,0.1); color: var(--white); border-color: rgba(255,255,255,0.35); }
.btn-on-dark:hover { color: var(--navy); background: var(--white); border-color: var(--white); }

.btn-block { width: 100%; }
.btn-lg { min-height: 54px; padding: 0 var(--sp-6); font-size: var(--fs-md); }

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none;
}

.btn .spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: var(--white);
  animation: spin 0.7s linear infinite; display: none;
}
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.8; }
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------- Badges & pills */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  letter-spacing: 0.04em; border-radius: var(--r-full);
  background: var(--teal-100); color: var(--teal-600);
}
.badge-trust {
  background: rgba(255,255,255,0.12); color: var(--white);
  border: 1px solid rgba(255,255,255,0.25);
  padding: var(--sp-2) var(--sp-4); font-size: var(--fs-sm);
}
.badge-orange { background: var(--orange-100); color: var(--orange-700); }

/* -------------------------------------------------- Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--sh-sm);
  transition: transform var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
  height: 100%;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg);
  border-color: var(--ocean-100);
}

/* Full-bleed image header inside a card */
.card.has-media { overflow: hidden; }
.card-media {
  margin: calc(-1 * var(--sp-5)) calc(-1 * var(--sp-5)) var(--sp-5);
  height: 172px; overflow: hidden;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--gray-100);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform var(--dur-slow) var(--ease); }
.card-hover:hover .card-media img { transform: scale(1.06); }
/* When a card has media, lift the icon up to overlap the image edge */
.has-media .card-icon { margin-top: -52px; position: relative; background: var(--white); box-shadow: var(--sh-sm); }

.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: var(--r-md);
  background: var(--ocean-100); color: var(--ocean-600);
  margin-bottom: var(--sp-4);
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.card-hover:hover .card-icon { background: var(--grad-teal); color: var(--white); }
.card h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.card p { color: var(--color-text-muted); font-size: var(--fs-base); }

.card-link {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  margin-top: var(--sp-4); font-weight: var(--fw-semibold); color: var(--ocean-600);
}
.card-link .icon { transition: transform var(--dur-fast) var(--ease); }
.card-link:hover .icon { transform: translateX(4px); }

/* feature list inside cards */
.feature-list { list-style: none; padding: 0; margin: var(--sp-4) 0 0; display: grid; gap: var(--sp-2); }
.feature-list li { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--color-text); }
.feature-list .icon { color: var(--teal-600); }

/* -------------------------------------------------- Header / Nav */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); min-height: 72px;
}
.brand {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-heading); font-weight: var(--fw-bold);
  font-size: var(--fs-md); color: var(--navy); flex: none;
}
.brand:hover { color: var(--navy); }
.brand .brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--grad-navy); color: var(--white);
}
.brand .brand-mark .icon { color: var(--teal-600); }
.brand b { color: var(--ocean-600); }

/* Uploaded brand logos (from Settings → Brand assets) */
.brand--img { gap: 0; }
.brand-logo { display: block; max-height: 44px; max-width: 200px; width: auto; height: auto; }
.brand-logo--stacked { max-height: 72px; }
.footer-brand .brand-logo--stacked { max-height: 80px; }

.nav-links { display: none; }
.nav-actions { display: none; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--r-md); color: var(--navy);
}
.nav-toggle:hover { background: var(--ocean-100); }

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex; align-items: center; gap: var(--sp-2); flex: 1;
    justify-content: center;
  }
  .nav-actions { display: flex; align-items: center; gap: var(--sp-3); }

  .nav-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md);
    font-weight: var(--fw-medium); color: var(--navy-700);
    position: relative;
  }
  .nav-link:hover { color: var(--ocean-700); background: var(--ocean-100); }
  .nav-link.is-active { color: var(--ocean-700); }
  .nav-link.is-active::after {
    content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 2px;
    height: 2px; background: var(--orange-600); border-radius: var(--r-full);
  }

  /* mega dropdown */
  .nav-item { position: relative; }
  .nav-dropdown {
    position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(8px);
    min-width: 560px; background: var(--white); border: 1px solid var(--color-border);
    border-radius: var(--r-lg); box-shadow: var(--sh-lg); padding: var(--sp-4);
    opacity: 0; visibility: hidden; transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
    display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-1);
  }
  .nav-item:hover .nav-dropdown,
  .nav-item:focus-within .nav-dropdown {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
  }
  .nav-dropdown a {
    display: flex; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-md);
    color: var(--navy);
  }
  .nav-dropdown a:hover { background: var(--gray-50); }
  .nav-dropdown .dd-icon { color: var(--ocean-600); flex: none; }
  .nav-dropdown .dd-title { font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
  .nav-dropdown .dd-desc { font-size: var(--fs-xs); color: var(--color-text-muted); }
}

/* Mobile drawer */
.mobile-menu {
  position: fixed; inset: 0; z-index: var(--z-modal);
  visibility: hidden; pointer-events: none;
}
.mobile-menu.is-open { visibility: visible; pointer-events: auto; }
.mobile-menu__scrim {
  position: absolute; inset: 0; background: rgba(6,26,46,0.5);
  opacity: 0; transition: opacity var(--dur-base) var(--ease);
}
.mobile-menu.is-open .mobile-menu__scrim { opacity: 1; }
.mobile-menu__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(86vw, 360px);
  background: var(--white); box-shadow: var(--sh-xl);
  transform: translateX(100%); transition: transform var(--dur-base) var(--ease-out);
  display: flex; flex-direction: column; padding: var(--sp-4);
  overflow-y: auto;
}
.mobile-menu.is-open .mobile-menu__panel { transform: translateX(0); }
.mobile-menu__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.mobile-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--sp-4); }
.mobile-nav a {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3); border-radius: var(--r-md);
  color: var(--navy); font-weight: var(--fw-medium); min-height: 48px;
}
.mobile-nav a:hover, .mobile-nav a.is-active { background: var(--ocean-100); color: var(--ocean-700); }
.mobile-menu__actions { display: grid; gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-4); }

/* -------------------------------------------------- Footer */
.site-footer { background: var(--navy-900); color: var(--gray-300); padding-block: var(--sp-8) var(--sp-5); }
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
@media (min-width: 640px)  { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.6fr repeat(3, 1fr); } }
.footer-brand .brand { color: var(--white); }
.footer-brand p { color: var(--gray-400); margin-top: var(--sp-4); font-size: var(--fs-sm); max-width: 34ch; }
.footer-col h4 { color: var(--white); font-size: var(--fs-base); margin-bottom: var(--sp-4); }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: var(--sp-2); }
.footer-col a { color: var(--gray-300); font-size: var(--fs-sm); }
.footer-col a:hover { color: var(--teal-600); }
.footer-contact li { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.footer-contact .icon { color: var(--teal-600); flex: none; margin-top: 2px; }
.footer-bottom {
  margin-top: var(--sp-7); padding-top: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between;
  font-size: var(--fs-xs); color: var(--gray-500);
}

/* -------------------------------------------------- Forms */
.form-grid { display: grid; gap: var(--sp-4); }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field.span-2 { grid-column: 1 / -1; }
.field label { font-weight: var(--fw-medium); font-size: var(--fs-sm); color: var(--navy); }
.field .req { color: var(--color-error); }
.field .hint { font-size: var(--fs-xs); color: var(--color-text-muted); }

.input, .select, .textarea {
  width: 100%; min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--white);
  border: 1.5px solid var(--gray-300); border-radius: var(--r-md);
  font-size: var(--fs-base); color: var(--color-text);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.textarea { min-height: 120px; resize: vertical; padding-top: var(--sp-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--ocean-600);
  box-shadow: 0 0 0 3px var(--ocean-100);
}
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea { border-color: var(--color-error); }
.field-error {
  display: none; align-items: center; gap: 6px;
  font-size: var(--fs-xs); color: var(--color-error);
}
.field.has-error .field-error { display: flex; }

/* alert / flash */
.alert {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4); border-radius: var(--r-md); margin-bottom: var(--sp-4);
  font-size: var(--fs-sm); border: 1px solid transparent;
}
.alert .icon { flex: none; margin-top: 1px; }
.alert-success { background: var(--color-success-bg); color: var(--color-success); border-color: #bbf7d0; }
.alert-error   { background: var(--color-error-bg);   color: var(--color-error);   border-color: #fecaca; }

/* -------------------------------------------------- Floating actions (WhatsApp / chat) */
.fab-stack {
  position: fixed; right: var(--sp-4); bottom: var(--sp-4);
  z-index: var(--z-sticky); display: flex; flex-direction: column; gap: var(--sp-3);
}
.fab {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: var(--r-full);
  color: var(--white); box-shadow: var(--sh-lg);
  transition: transform var(--dur-fast) var(--ease);
}
.fab:hover { transform: scale(1.06); color: var(--white); }
.fab-whatsapp { background: #25D366; }
.fab-chat { background: var(--navy); position: relative; }
.fab-chat .fab-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--orange-600); color: var(--white);
  font-size: 10px; font-weight: var(--fw-bold);
  padding: 2px 6px; border-radius: var(--r-full); border: 2px solid var(--bg-light);
}
