/* ==========================================================================
   ISIB Design System v2 — Components
   Buttons · Badges · Chips · Cards · Forms · Steps · Ratings · Alerts
   ========================================================================== */

/* ---------- OMR currency symbol ----------
   Inline sprite icon (#i-omr) — inherits the surrounding text color. */
svg.omr {
  display: inline-block;
  width: 1.4em;
  height: 0.74em;
  vertical-align: -0.04em;
  fill: currentColor;
}

/* ---------- Buttons ----------
   Hierarchy: primary (gold, one per view) → brand → outline → ghost      */
.btn {
  --btn-bg: var(--c-brand-600);
  --btn-fg: #fff;
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0 1.5rem;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  border-radius: var(--radius-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1.5px solid var(--btn-bd);
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

.btn--primary {
  --btn-bg: var(--c-accent-500);
  --btn-fg: var(--text-on-accent);
  box-shadow: var(--shadow-accent);
}

.btn--primary:hover {
  --btn-bg: var(--c-accent-400);
}

.btn--brand {
  --btn-bg: var(--c-brand-600);
}

.btn--brand:hover {
  --btn-bg: var(--c-brand-700);
}

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--c-brand-700);
  --btn-bd: var(--c-brand-300);
}

.btn--outline:hover {
  --btn-bg: var(--c-brand-50);
}

/* Outline that sits on dark surfaces */
.btn--outline-light {
  --btn-bg: transparent;
  --btn-fg: #fff;
  --btn-bd: rgba(255, 255, 255, 0.35);
}

.btn--outline-light:hover {
  --btn-bg: rgba(255, 255, 255, 0.08);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text-strong);
  --btn-bd: var(--border-default);
}

.btn--ghost:hover {
  --btn-bg: var(--bg-subtle);
}

.btn--on-dark {
  --btn-bg: #fff;
  --btn-fg: var(--c-brand-800);
}

.btn--on-dark:hover {
  --btn-bg: var(--c-brand-50);
}

.btn--whatsapp {
  --btn-bg: #22c55e;
  --btn-fg: #052e16;
}

.btn--whatsapp:hover {
  --btn-bg: #16a34a;
  --btn-fg: #fff;
}

.btn--sm {
  min-height: 40px;
  padding: 0 1.1rem;
  font-size: var(--fs-sm);
}

.btn--lg {
  min-height: 56px;
  padding: 0 2rem;
  font-size: var(--fs-md);
}

.btn--block {
  width: 100%;
}

/* ---------- Badges (labels on cards) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-default);
}

.badge--hot {
  background: var(--c-accent-50);
  color: var(--c-accent-700);
}

.badge--new {
  background: var(--c-brand-50);
  color: var(--c-brand-700);
}

.badge--b2b {
  background: #eef2ff;
  color: #4338ca;
}

/* ---------- Chips (trust points, hero proof) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-on-dark);
  color: var(--text-on-dark);
}

.chip svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--c-brand-300);
}

.chip--light {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-default);
}

.chip--light svg {
  color: var(--c-brand-600);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.card--interactive:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-brand);
}

.icon-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--c-brand-100), var(--c-brand-50) 60%);
  border: 1px solid var(--c-brand-100);
  color: var(--c-brand-600);
}

.icon-tile svg {
  width: 1.55rem;
  height: 1.55rem;
}

.icon-tile--accent {
  background: linear-gradient(160deg, var(--c-accent-100), var(--c-accent-50) 60%);
  border-color: var(--c-accent-100);
  color: var(--c-accent-600);
}

/* Small "verified" seal overlapping the tile corner */
.icon-tile .icon-tile__check {
  position: absolute;
  bottom: -0.3rem;
  inset-inline-end: -0.3rem;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--c-success);
  border-radius: 50%;
  box-shadow: 0 0 0 2.5px var(--c-white);
}

/* Arrow link used inside cards */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--c-brand-700);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
}

.link-arrow svg {
  width: 1.1rem;
  height: 1.1rem;
  transition: transform var(--dur) var(--ease);
}

a:hover .link-arrow svg,
.link-arrow:hover svg {
  transform: translateX(-4px);
}

html[dir="ltr"] a:hover .link-arrow svg,
html[dir="ltr"] .link-arrow:hover svg {
  transform: translateX(4px);
}

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.field-label .req {
  color: var(--c-danger);
}

.input,
.select {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 1rem;
  font-size: var(--fs-base);
  color: var(--text-strong);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.input::placeholder {
  color: var(--c-ink-400);
}

html[dir="ltr"] input[type="tel"] {
  text-align: left;
}

html[dir="rtl"] input[type="tel"] {
  text-align: right;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--c-brand-400);
  box-shadow: 0 0 0 4px var(--c-brand-50);
}

.input.is-invalid,
.select.is-invalid {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 4px var(--c-danger-soft);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.1rem;
  padding-inline-end: 2.6rem;
}

html[dir="ltr"] .select {
  background-position: right 1rem center;
}

html[dir="rtl"] .select {
  background-position: left 1rem center;
}

.field-error {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-danger);
}

/* Segmented control */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.3rem;
  padding: 0.3rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  text-align: center;
  padding: 0.6rem 0.75rem;
  border-radius: calc(var(--radius-md) - 4px);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.segmented input:checked+label {
  background: var(--c-brand-600);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.segmented input:focus-visible+label {
  box-shadow: var(--ring);
}

/* ---------- Tabs (pill filter) ---------- */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.3rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
}

.tabs button {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-pill);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.tabs button[aria-selected="true"] {
  background: var(--c-brand-600);
  color: #fff;
}

.tabs button:not([aria-selected="true"]):hover {
  background: var(--bg-subtle);
  color: var(--text-strong);
}

/* ---------- Stars & rating ---------- */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--c-accent-500);
}

.stars svg {
  width: 1.1rem;
  height: 1.1rem;
}

.avatar {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--c-brand-100);
  color: var(--c-brand-800);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.alert svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.alert--success {
  background: var(--c-success-soft);
  color: var(--c-success);
  border: 1px solid #bbf7d0;
}

.alert--error {
  background: var(--c-danger-soft);
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ---------- Nav dropdown (insurances menu) ---------- */
.nav-links .dropdown {
  position: relative;
}

.nav-links .dropdown-menu li {
  position: relative;
}

.nav-links .dropdown-menu {
  overflow: visible;
  box-shadow: var(--shadow-lg);
}

.nav-links .dropdown-submenu>.dropdown-menu {
  display: none;
  position: absolute;
  top: -7px;
  left: 100%;
  max-height: calc(71vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

html[dir="rtl"] .nav-links .dropdown-submenu>.dropdown-menu {
  left: auto;
  right: 100%;
}

.nav-links .dropdown-submenu:hover>.dropdown-menu {
  display: block;
}

@media (max-width: 1020px) {
  .nav-links .dropdown-submenu>.dropdown-menu {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    margin-left: 1rem;
    max-height: none;
    overflow-y: visible;
  }
}

/* ---------- Page hero (compact banner for inner content/funnel pages) ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 85% -20%, rgba(26, 102, 214, 0.35), transparent 60%),
    linear-gradient(165deg, var(--c-deep-800) 0%, var(--c-deep-950) 78%);
  color: var(--text-on-dark);
  padding-block: clamp(2.25rem, 6vh, 3.75rem);
  text-align: center;
}

.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-on-dark-muted);
  margin-bottom: var(--space-3);
}

.page-hero__eyebrow svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.page-hero h1 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: #fff;
  margin: 0;
}

.page-hero p {
  margin-top: var(--space-3);
  color: var(--text-on-dark-muted);
  max-width: 40rem;
  margin-inline: auto;
}

/* ---------- Prose (readable long-form text: About / Terms / Privacy) ---------- */
.prose {
  max-width: 46rem;
  margin-inline: auto;
  color: var(--text-default);
  line-height: 1.75;
}

.prose p {
  margin-bottom: var(--space-4);
}

.prose h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.prose ul,
.prose ol {
  margin-bottom: var(--space-4);
  padding-inline-start: 1.4rem;
}

.prose li {
  margin-bottom: var(--space-2);
}

/* ---------- Value cards (About: Practical / Efficient / Caring) ---------- */
.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 820px) {
  .value-grid {
    grid-template-columns: 1fr;
  }
}

.value-card {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.value-card__icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-inline: auto;
  margin-bottom: var(--space-4);
  border-radius: 50%;
  background: var(--bg-brand-soft);
  color: var(--c-brand-600);
}

.value-card__icon svg {
  width: 1.6rem;
  height: 1.6rem;
}

.value-card h3 {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  margin-bottom: var(--space-2);
}

.value-card p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ---------- Simple content forms (Contact / Other Insurance) ---------- */
.simple-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.simple-form textarea.input {
  min-height: 8rem;
  resize: vertical;
}

/* ---------- Simple accordion (FAQs), matches quote-card__terms <details> pattern ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 46rem;
  margin-inline: auto;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-weight: var(--fw-bold);
  color: var(--c-brand-600);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item p {
  margin-top: var(--space-3);
  color: var(--text-muted);
}

/* ---------- Comparison table (Travel Insurance class-type x trip-duration pricing grid) ---------- */
.compare-table-wrap {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  border: 1px solid var(--border-subtle);
  padding: var(--space-3);
  text-align: center;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.compare-table th {
  background: var(--bg-subtle);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.compare-table .price-btn {
  background: none;
  border: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: var(--space-2);
  font-weight: var(--fw-semibold);
  color: var(--c-brand-700);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.compare-table .price-btn:hover {
  background: var(--bg-brand-soft);
}

.compare-table .price-btn svg {
  width: 1rem;
  height: 1rem;
}

/* ============ WHATSAPP FLOATING WIDGET ============ */
.wa-widget {
  position: fixed;
  inset-inline-end: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.wa-widget__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background-color: #25d366;
  color: #ffffff;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.wa-widget__toggle:hover {
  background-color: #20bd5a;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.5);
}

.wa-widget__toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.wa-widget__popup {
  position: absolute;
  bottom: calc(100% + 14px);
  inset-inline-end: 0;
  width: 310px;
  background: #ffffff;
  border-radius: 24px;
  padding: 22px 20px 20px;
  box-shadow: 0 16px 40px rgba(6, 21, 39, 0.18), 0 2px 10px rgba(6, 21, 39, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

html[dir="rtl"] .wa-widget__popup {
  transform-origin: bottom left;
}

.wa-widget__popup.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.wa-widget__popup::after {
  content: "";
  position: absolute;
  bottom: -7px;
  inset-inline-end: 28px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  transform: rotate(45deg);
  box-shadow: 3px 3px 5px rgba(6, 21, 39, 0.04);
}

.wa-widget__close {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wa-widget__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.wa-widget__title {
  margin: 0 0 8px 0;
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  padding-inline-start: 20px;
}

.wa-widget__desc {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.wa-widget__btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 50px;
  background-color: #25d366;
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none !important;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.wa-widget__btn:hover {
  background-color: #20bd5a;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.wa-widget__btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@media (max-width: 640px) {
  .wa-widget {
    display: none !important;
  }
}