:root {
  --fav-orange: #ff7a00;
  --fav-pink: #ff2d55;
  --fav-blue: #2878ff;
  --fav-navy: #08162d;
  --fav-navy-soft: #132441;
  --fav-text: #111827;
  --fav-muted: #64748b;
  --fav-line: #e4ebf4;
  --fav-bg: #eef4fb;
}

body.page-template-page-favoris-php,
body.page-template-favoris,
body.page-template-page-favoris {
  margin: 0 !important;
  background: var(--fav-bg) !important;
}

body.page-template-page-favoris-php header:not(.fav-header):not(.nt-account-subpage-header):not(.nt-space-header),
body.page-template-favoris header:not(.fav-header):not(.nt-account-subpage-header):not(.nt-space-header),
body.page-template-page-favoris header:not(.fav-header):not(.nt-account-subpage-header):not(.nt-space-header),
body.page-template-page-favoris-php .site-header,
body.page-template-favoris .site-header,
body.page-template-page-favoris .site-header,
body.page-template-page-favoris-php .site-footer,
body.page-template-favoris .site-footer,
body.page-template-page-favoris .site-footer,
body.page-template-page-favoris-php .ast-builder-grid-row-container,
body.page-template-favoris .ast-builder-grid-row-container,
body.page-template-page-favoris .ast-builder-grid-row-container,
body.page-template-page-favoris-php .ast-primary-header-bar,
body.page-template-favoris .ast-primary-header-bar,
body.page-template-page-favoris .ast-primary-header-bar,
body.page-template-page-favoris-php .ast-mobile-header-wrap,
body.page-template-favoris .ast-mobile-header-wrap,
body.page-template-page-favoris .ast-mobile-header-wrap {
  display: none !important;
}

.fav-app,
.fav-app * {
  box-sizing: border-box;
}

.fav-app {
  width: 100%;
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 0 max(104px, calc(86px + env(safe-area-inset-bottom)));
  overflow-x: hidden;
  color: var(--fav-text);
  background:
    radial-gradient(circle at 12% 0%, rgba(40, 120, 255, 0.11), transparent 28%),
    linear-gradient(180deg, #f6f9ff 0%, var(--fav-bg) 58%, #edf3fa 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Noto Sans Khmer", "Segoe UI", sans-serif;
}

/* Header premium cohérent avec les autres espaces Novtinis. */
.fav-header {
  position: relative;
  isolation: isolate;
  min-height: 164px;
  padding: 20px 22px 45px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 122, 0, 0.28), transparent 32%),
    radial-gradient(circle at 12% 110%, rgba(40, 120, 255, 0.30), transparent 42%),
    linear-gradient(145deg, #10264a 0%, var(--fav-navy) 72%);
  border-radius: 0 0 32px 32px;
  box-shadow: 0 20px 42px rgba(8, 22, 45, 0.22);
}

.fav-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -56px;
  bottom: -78px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.035);
}

.fav-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fav-brand-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: block;
  object-fit: contain;
  border-radius: 13px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.fav-logo {
  display: block;
  width: auto;
  height: 26px;
  max-width: 132px;
  object-fit: contain;
}

.fav-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin-top: 16px;
}

.fav-title-block {
  min-width: 0;
}

.fav-title-block h1 {
  margin: 0;
  color: #fff;
  font-size: calc(clamp(30px, 8vw, 38px) + var(--nt-km-font-boost, 0px));
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 900;
  overflow-wrap: anywhere;
}

html[lang^="km"] .fav-title-block h1,
.nt-lang-km .fav-title-block h1 {
  line-height: 1.22;
  letter-spacing: 0;
  font-weight: 800;
}

.fav-title-block p {
  max-width: 365px;
  margin: 8px 0 0;
  color: rgba(231, 239, 253, 0.84);
  font-size: calc(14px + var(--nt-km-font-boost, 0px));
  line-height: 1.45;
  font-weight: 650;
}

.fav-header-heart {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 54px;
  color: #fff;
  font-size: calc(25px + var(--nt-km-font-boost, 0px));
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 122, 0, 0.92), rgba(255, 45, 85, 0.94));
  box-shadow: 0 14px 28px rgba(255, 45, 85, 0.22);
}

/* Onglets en chevauchement léger sous le hero. */
.fav-tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: -24px 16px 18px;
  padding: 6px;
  border: 1px solid rgba(221, 230, 241, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
}

.fav-tab {
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: calc(14px + var(--nt-km-font-boost, 0px));
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.16s ease, color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.fav-tab span {
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #64748b;
  background: #edf2f8;
  font-size: calc(12px + var(--nt-km-font-boost, 0px));
  font-weight: 900;
}

.fav-tab.is-active {
  color: #fff;
  background:
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.28), transparent 28%),
    linear-gradient(135deg, var(--fav-orange), var(--fav-pink));
  box-shadow: 0 12px 24px rgba(255, 45, 85, 0.24);
}

.fav-tab.is-active span {
  color: #fff;
  background: rgba(255, 255, 255, 0.20);
}

.fav-tab:active {
  transform: scale(0.985);
}

.fav-list-wrap {
  padding: 0 16px 24px;
}

.fav-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fav-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(222, 231, 242, 0.96);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.fav-card[hidden] {
  display: none !important;
}

.fav-card-link {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 12px;
  color: inherit;
  text-decoration: none !important;
}

.fav-card-image {
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 18px;
  background: #e5e7eb;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.fav-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.fav-card-body {
  min-width: 0;
  padding-top: 2px;
}

.fav-card-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  min-width: 0;
}

.fav-card-title-row h2 {
  margin: 0;
  overflow: hidden;
  color: #111827;
  font-size: calc(19px + var(--nt-km-font-boost, 0px));
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 900;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.fav-distance {
  max-width: 76px;
  overflow: hidden;
  color: #182235;
  font-size: calc(13px + var(--nt-km-font-boost, 0px));
  font-weight: 900;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-meta-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fav-rating {
  color: #16213a;
  font-size: calc(13px + var(--nt-km-font-boost, 0px));
  font-weight: 900;
}

.fav-verified {
  min-height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #15803d;
  background: #eafaf0;
  font-size: calc(12px + var(--nt-km-font-boost, 0px));
  font-weight: 850;
  white-space: nowrap;
}

.fav-sub-row {
  margin-top: 10px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--fav-muted);
  font-size: calc(13px + var(--nt-km-font-boost, 0px));
  font-weight: 750;
}

.fav-sub-row span + span::before {
  content: "•";
  margin-right: 7px;
  color: #a3afbf;
}

.fav-remove {
  width: calc(100% - 24px);
  min-height: 40px;
  margin: 0 12px 12px;
  border: 1px solid #ffe1e6;
  border-radius: 999px;
  color: #c73551;
  background: #fff5f7;
  font: inherit;
  font-size: calc(12px + var(--nt-km-font-boost, 0px));
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.fav-remove:hover {
  color: #a91f3a;
  background: #ffeef2;
}

.fav-remove:active {
  transform: scale(0.985);
}

.fav-empty {
  width: 100%;
  margin: 14px 0 0;
  padding: 34px 20px;
  border: 1px solid rgba(255, 122, 0, 0.16);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 122, 0, 0.10), transparent 34%),
    linear-gradient(180deg, #fff 0%, #fffaf5 100%);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.fav-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--fav-orange), var(--fav-pink));
  font-size: calc(38px + var(--nt-km-font-boost, 0px));
  font-weight: 900;
}

.fav-empty h2 {
  margin: 0;
  font-size: calc(27px + var(--nt-km-font-boost, 0px));
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 900;
}

.fav-empty p {
  max-width: 320px;
  margin: 12px auto 0;
  color: var(--fav-muted);
  font-size: calc(14px + var(--nt-km-font-boost, 0px));
  line-height: 1.52;
  font-weight: 650;
}

.fav-empty-cta {
  min-height: 50px;
  margin-top: 18px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff !important;
  background: linear-gradient(135deg, var(--fav-orange), var(--fav-pink));
  text-decoration: none !important;
  font-size: calc(14px + var(--nt-km-font-boost, 0px));
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(255, 45, 85, 0.18);
}

@media (min-width: 768px) {
  .fav-app {
    max-width: 560px;
    min-height: 100vh;
    border-left: 1px solid #dce6f1;
    border-right: 1px solid #dce6f1;
    box-shadow: 0 0 42px rgba(15, 23, 42, 0.10);
  }
}

@media (max-width: 430px) {
  .fav-header {
    min-height: 158px;
    padding: 18px 18px 43px;
    border-radius: 0 0 28px 28px;
  }

  .fav-brand-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .fav-logo {
    height: 24px;
    max-width: 122px;
  }

  .fav-heading-row {
    gap: 12px;
    margin-top: 14px;
  }

  .fav-title-block h1 {
    font-size: calc(31px + var(--nt-km-font-boost, 0px));
  }

  .fav-title-block p {
    font-size: calc(13.5px + var(--nt-km-font-boost, 0px));
  }

  .fav-header-heart {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 16px;
    font-size: calc(22px + var(--nt-km-font-boost, 0px));
  }

  .fav-tabs {
    margin-right: 14px;
    margin-left: 14px;
  }

  .fav-list-wrap {
    padding-right: 14px;
    padding-left: 14px;
  }

  .fav-card-link {
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 12px;
  }

  .fav-card-image {
    width: 98px;
    height: 98px;
    border-radius: 17px;
  }

  .fav-card-title-row h2 {
    font-size: calc(18px + var(--nt-km-font-boost, 0px));
  }

  .fav-distance {
    max-width: 64px;
  }
}

@media (max-width: 340px) {
  .fav-header-heart {
    display: none;
  }

  .fav-heading-row {
    grid-template-columns: 1fr;
  }

  .fav-card-link {
    grid-template-columns: 1fr;
  }

  .fav-card-image {
    width: 100%;
    height: 180px;
  }

  .fav-distance {
    max-width: none;
  }
}


/* ==========================================================
   LOT 358 V1.21 — Favoris appelé depuis Mon compte
   - retour contextuel visible ;
   - accents bleus plus sobres, moins de orange/rose.
========================================================== */
.fav-context-back {
  width: max-content;
  min-height: 38px;
  margin: 0 0 14px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px;
  background: rgba(255, 255, 255, .10);
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: calc(13px + var(--nt-km-font-boost, 0px));
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.fav-context-back:focus-visible {
  outline: 3px solid rgba(147, 197, 253, .55);
  outline-offset: 3px;
}

.fav-header {
  background:
    radial-gradient(circle at 88% 0%, rgba(59, 130, 246, .20), transparent 34%),
    radial-gradient(circle at 12% 110%, rgba(37, 99, 235, .24), transparent 42%),
    linear-gradient(145deg, #10264a 0%, var(--fav-navy) 72%) !important;
}

.fav-header-heart {
  background: linear-gradient(145deg, #2563eb, #3b82f6) !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .22) !important;
}

.fav-tab.is-active {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .20) !important;
}

.fav-empty-cta {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18) !important;
}

/* ==========================================================
   LOT 358 V1.23 — Favoris intégré visuellement à Mon compte
   lorsqu'il est ouvert depuis le hub / sous-menu Membre.
========================================================== */
.nt-favorites-account-context {
  background: #edf3fb !important;
}

.nt-favorites-account-context .seva-account-shell {
  min-height: 100svh;
  padding-bottom: max(104px, calc(86px + env(safe-area-inset-bottom)));
}

.nt-favorites-account-context .nt-favorites-account-body {
  padding: 20px 18px 34px;
  background: #edf3fb;
}

.nt-favorites-account-context .nt-favorites-account-back {
  margin: 0 0 18px;
}

.nt-favorites-account-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  padding: 0 2px;
}

.nt-favorites-account-heading h1 {
  margin: 7px 0 3px;
  color: #08162d;
  font-size: calc(30px + var(--nt-km-font-boost, 0px));
  line-height: 1.05;
  letter-spacing: -.035em;
  font-weight: 900;
}

.nt-favorites-account-heading p {
  margin: 0;
  color: #64748b;
  font-size: calc(14px + var(--nt-km-font-boost, 0px));
  line-height: 1.4;
  font-weight: 650;
}

.nt-favorites-account-heart {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #2563eb;
  background: #eaf2ff;
  border: 1px solid #d8e6fb;
  font-size: 22px;
}

.nt-favorites-account-context .fav-tabs {
  margin: 0 0 18px;
}

.nt-favorites-account-context .fav-list-wrap {
  padding-left: 0;
  padding-right: 0;
}

.nt-favorites-account-context .fav-empty {
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 390px) {
  .nt-favorites-account-context .nt-favorites-account-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .nt-favorites-account-heading h1 {
    font-size: calc(27px + var(--nt-km-font-boost, 0px));
  }
}


/* ==========================================================
   LOT 358 — candidat 57
   Favoris : le filtre qui masque le header Astra ne doit jamais
   masquer le header compact du sous-menu Membre.
========================================================== */
.nt-favorites-account-context.nt-account-subview-compact .nt-account-subpage-header {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}


/* =========================================================
   LOT 358 — C94
   Liste personnelle unifiée : Favoris + Suivis
   ========================================================= */
.nt-favorites-account-context[data-favorites-mode="combined"] .fav-list-wrap {
  padding-top: 14px;
}

.nt-favorites-account-context[data-favorites-mode="combined"] .fav-empty {
  margin-top: 8px;
  padding: 30px 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.nt-favorites-account-context[data-favorites-mode="combined"] .fav-empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 20px;
  font-size: calc(34px + var(--nt-km-font-boost, 0px));
}

.nt-favorites-account-context[data-favorites-mode="combined"] .fav-remove[hidden] {
  display: none !important;
}
