/* ===========================================================================
   Trilogia — Favoris Livya
   ---------------------------------------------------------------------------
   The favorites popup, the selection bar, the header Favoris button and the
   favorites box above the contact form, in Trilogia's colours, Galano type
   and leaf-shaped corners (rounded top-left and bottom-right).

   The Elementor kit styles every <button> on the site (navy, uppercase, leaf
   corners). Rules inside the dialogs are scoped by ID so they win over the kit
   without !important; buttons we draw ourselves carry .tl-b and start from a
   clean slate.
   ========================================================================= */

:root {
  --tl-navy: #1c2b4d;
  --tl-blue: #0077c8;
  --tl-pink: #f4d7d8;
  --tl-ink: var(--e-global-color-primary, #1c2b4d);
  --tl-ink-soft: rgb(28 43 77 / .7);
  --tl-paper: #fff;
  --tl-paper-muted: #f6f4f2;
  --tl-paper-sunk: #eceef3;
  --tl-rule: rgb(28 43 77 / .14);
  --tl-accent: var(--e-global-color-secondary, #0077c8);
  --tl-heart: #e25563;
  --tl-font: "Galano", system-ui, sans-serif;
  --tl-leaf: 25px 0 25px 0;
  --tl-leaf-lg: 40px 0 40px 0;
  --tl-leaf-sm: 12px 0 12px 0;
  --tl-shadow-card: 0 1px 2px rgb(28 43 77 / .08), 0 6px 18px rgb(28 43 77 / .08);
  --tl-ease: cubic-bezier(.22, 1, .36, 1);
}

/* --- shared dialog shell -------------------------------------------------- */

body:has(.tl-dialog[open]) { overflow: hidden; }

#trilogia-favoris{
  box-sizing: border-box;
  display: none;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  overflow: hidden;
  border: 0;
  border-radius: var(--tl-leaf-lg);
  background: var(--tl-paper);
  color: var(--tl-ink);
  font-family: var(--tl-font);
  font-size: 16px;
  line-height: 1.5;
  box-shadow: 0 30px 80px rgb(10 20 40 / .35);
}
#trilogia-favoris[open]{ display: flex; }
#trilogia-favoris *{ box-sizing: border-box; }
#trilogia-favoris::backdrop{ background: rgb(18 27 48 / .62); }
#trilogia-favoris[open]{ animation: tl-in .35s var(--tl-ease); }
@keyframes tl-in { from { opacity: 0; translate: 0 12px; } }

/* A clean slate for our own buttons; the specific rules below restyle them. */
#trilogia-favoris .tl-b, .tl-form-favorites .tl-b {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  margin: 0; padding: 0; min-height: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  color: inherit; font: inherit; letter-spacing: normal; text-transform: none; line-height: 1.2;
  cursor: pointer;
}
#trilogia-favoris .tl-b:focus-visible, .tl-form-favorites .tl-b:focus-visible,
#trilogia-favoris a:focus-visible { outline: 2px solid var(--tl-accent); outline-offset: 3px; }

#trilogia-favoris h2, #trilogia-favoris h3, #trilogia-favoris h4, #trilogia-favoris p{ margin: 0; color: inherit; font-family: var(--tl-font); }
#trilogia-favoris .tl-dialog__title{
  font-size: clamp(1.75rem, 3.2vw, 2.6rem); font-weight: 500; line-height: 1.1; letter-spacing: -.01em; color: var(--tl-ink);
}
#trilogia-favoris .tl-eyebrow{
  margin: 0 0 .5rem; font-size: .72rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--tl-accent);
}

#trilogia-favoris .tl-close{
  flex: 0 0 44px; width: 44px; height: 44px;
  border: 1px solid var(--tl-rule); border-radius: var(--tl-leaf-sm); color: var(--tl-ink);
  transition: background-color .2s, border-color .2s;
}
#trilogia-favoris .tl-close:hover{ background: var(--tl-pink); border-color: var(--tl-pink); }
#trilogia-favoris .tl-close svg{ width: 20px; height: 20px; }

#trilogia-favoris .tl-text-button, .tl-form-favorites .tl-text-button,
#trilogia-favoris .tl-text-link {
  padding: .35rem 0; border-bottom: 1px solid currentColor; color: var(--tl-ink);
  font-size: .95rem; font-weight: 500; text-decoration: none; white-space: nowrap;
}
#trilogia-favoris .tl-text-link:hover, #trilogia-favoris .tl-text-button:hover, .tl-form-favorites .tl-text-button:hover { color: var(--tl-accent); }

/* ==========================================================================
   Favorites popup — the selection and the form side by side
   ======================================================================= */

#trilogia-favoris { width: min(1320px, calc(100vw - 48px)); }
#trilogia-favoris [hidden] { display: none !important; }
#trilogia-favoris .tl-dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex: 0 0 auto; padding-bottom: 1.25rem; border-bottom: 1px solid var(--tl-rule); }

#trilogia-favoris .tl-columns { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; gap: 1.5rem; padding-top: 1.5rem; }
#trilogia-favoris .tl-dialog__body { min-width: 0; }
/* The form keeps the pink panel it sits on in the Contact page and on Home:
   its white, borderless fields are drawn for that background. */
#trilogia-favoris .tl-contact { min-width: 0; padding: clamp(1.25rem, 2.5vw, 2rem); border-radius: var(--tl-leaf); background: var(--tl-pink); }

@media (min-width: 64rem) {
  #trilogia-favoris .tl-columns { flex-direction: row; align-items: stretch; overflow: hidden; gap: clamp(1.5rem, 3vw, 2.5rem); }
  #trilogia-favoris .tl-dialog__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding-right: .25rem; }
  #trilogia-favoris .tl-contact { flex: 0 0 clamp(22rem, 38%, 30rem); overflow-y: auto; overscroll-behavior: contain; }
}

#trilogia-favoris .tl-dialog__foot { display: flex; flex-wrap: wrap; gap: .75rem 2rem; flex: 0 0 auto; padding-top: 1.25rem; margin-top: 1.25rem; border-top: 1px solid var(--tl-rule); }

#trilogia-favoris .tl-intro { margin-bottom: 1.25rem; color: var(--tl-ink-soft); font-size: .95rem; max-width: 60ch; }
#trilogia-favoris .tl-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding: 1.25rem; background: var(--tl-paper-muted); border-radius: var(--tl-leaf-sm); color: var(--tl-ink-soft); font-size: .9rem; }
#trilogia-favoris .tl-module { margin-top: 0; }
#trilogia-favoris .tl-module .livya-bricks-module, #trilogia-favoris .tl-module [class^="livya-module-container"] { width: 100%; }
#trilogia-favoris .tl-module [class^="livya-module-container"] { height: min(62dvh, 680px); max-height: none; min-height: 360px; aspect-ratio: auto; border-radius: var(--tl-leaf-sm); }
#trilogia-favoris .livya-integration-iframe { border-radius: var(--tl-leaf-sm); }

/* The contact column. */
#trilogia-favoris .tl-contact__title { font-size: 1.35rem; font-weight: 500; line-height: 1.2; }
#trilogia-favoris .tl-contact__copy { margin: .5rem 0 1.25rem; color: var(--tl-ink-soft); font-size: .9rem; }
/* The selection is on screen beside it: no need to repeat the count. */
#trilogia-favoris .tl-form-favorites { display: none; }

@media (max-width: 40rem) {
  #trilogia-favoris{ width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 1.15rem; border-radius: 28px 0 28px 0; }
  #trilogia-favoris .tl-module [class^="livya-module-container"] { height: 70dvh; min-height: 320px; }
  #trilogia-favoris .tl-dialog__foot { gap: .5rem 1.25rem; margin-top: .75rem; padding-top: .85rem; }
  #trilogia-favoris .tl-text-link { font-size: .88rem; }
}

/* ==========================================================================
   Contact form (Gravity Forms 1) inside the popup
   ======================================================================= */

#trilogia-favoris .tl-contact .gform_wrapper { margin: 0; }
#trilogia-favoris .tl-contact .gform_heading { display: none; }
/* One column: the panel is narrow. */
#trilogia-favoris .tl-contact .gform_fields { grid-template-columns: 1fr; row-gap: 1rem; }
#trilogia-favoris .tl-contact .gfield { grid-column: 1 / -1; }
#trilogia-favoris .tl-contact .ginput_complex { flex-wrap: wrap; row-gap: 1rem; }
#trilogia-favoris .tl-contact .ginput_complex > span { flex: 1 1 100%; max-width: 100%; }
#trilogia-favoris .tl-contact textarea { height: 8rem; min-height: 0; }
/* The page draws the fields white and borderless on pink; so does the popup. */
#trilogia-favoris .tl-contact input[type="text"], #trilogia-favoris .tl-contact input[type="email"],
#trilogia-favoris .tl-contact input[type="tel"], #trilogia-favoris .tl-contact textarea {
  border: 1px solid transparent; border-radius: 6px; background: #fff; box-shadow: none; font-family: var(--tl-font);
}
#trilogia-favoris .tl-contact :is(input, textarea):focus { border-color: var(--tl-navy); outline: none; }
#trilogia-favoris .tl-contact .gfield_label, #trilogia-favoris .tl-contact legend { font-family: var(--tl-font); }
/* The Trilogia 1 / 2 logos (drawn by the site's custom CSS) fit the column. */
#trilogia-favoris .tl-contact .sc-custom-checkbox label::after { width: 104px; height: 28px; }
#trilogia-favoris .tl-contact .sc-custom-checkbox .gfield_checkbox { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; }
#trilogia-favoris .tl-contact .tl-livya-visit, #trilogia-favoris .tl-contact .gform_validation_container { display: none; }
.tl-livya-visit { display: none !important; }

/* Admin preview: until go-live the header still has its old button. */
.tl-preview-launcher { position: fixed; left: 16px; bottom: 16px; z-index: 9990; }
.tl-preview-launcher .livya-favorites-button { display: inline-flex; align-items: center; gap: .5em; box-shadow: 0 8px 24px rgb(0 0 0 / .25); }
.tl-preview-launcher .livya-favorites-button__icon svg { width: 1.1em; height: 1.1em; display: block; }

/* What travels with the request, above the form on Contact, on Home and in
   the popup (where the selection is already beside it, so it is hidden). */
.tl-form-favorites {
  margin: 0 0 1.75rem; padding: 1.25rem 1.35rem;
  border: 1px solid var(--tl-navy); border-radius: var(--tl-leaf-sm); background: rgb(255 255 255 / .7);
  color: var(--tl-navy); font-family: var(--tl-font); text-align: left;
}
.tl-form-favorites__summary { display: flex; gap: 1rem; align-items: flex-start; }
.tl-form-favorites__icon { display: grid; place-items: center; flex: 0 0 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--tl-navy); color: var(--tl-pink); }
.tl-form-favorites__icon svg { width: 1.35rem; height: 1.35rem; }
.tl-form-favorites.has-favorites .tl-form-favorites__icon svg { fill: currentColor; }
.tl-form-favorites__title { margin: .1rem 0 0; color: inherit; font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
.tl-form-favorites__description { margin: .35rem 0 0; color: var(--tl-ink-soft); font-size: .92rem; line-height: 1.5; }
.tl-form-favorites[aria-busy="true"] .tl-form-favorites__title { color: var(--tl-ink-soft); }
/* Gravity Forms' theme styles every button in its wrapper; the ID wins. */
#gform_wrapper_1 .tl-form-favorites .tl-b.tl-form-favorites__manage, .tl-form-favorites .tl-b.tl-form-favorites__manage {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; height: auto; min-height: 44px;
  margin: 1.1rem 0 0; padding: .85rem 0 0; border: 0; border-top: 1px solid var(--tl-rule); border-radius: 0;
  background: none; box-shadow: none; color: var(--tl-navy); font-family: var(--tl-font); font-size: .95rem; font-weight: 600; text-transform: none; text-align: left;
}
#gform_wrapper_1 .tl-form-favorites .tl-b.tl-form-favorites__manage:hover { background: none; color: var(--tl-accent); }
#trilogia-favoris .tl-form-favorites { display: none; }

/* ==========================================================================
   Favorites bar — fixed at the bottom once something is saved
   ======================================================================= */

:root { --tl-bar-height: 0px; }
body.tl-has-bar { padding-bottom: var(--tl-bar-height); }
html:has(body.tl-has-bar) { scroll-padding-bottom: calc(var(--tl-bar-height) + 1rem); }
/* The site's back-to-top button moves above it. The Complianz consent tab
   stays where it is, under the bar: folding the bar uncovers it. */
body.tl-has-bar .elementor-12 .elementor-element.elementor-element-500ccda { bottom: var(--tl-bar-height); }
/* Complianz places its consent tab from this variable (peeking at -35px). */
body.tl-has-bar .tl-preview-launcher { bottom: calc(var(--tl-bar-height) + 16px); }

.tl-bar {
  position: fixed; inset: auto 0 0; z-index: 9999; box-sizing: border-box; width: 100%;
  padding: .9rem clamp(1rem, 2.2vw, 30px) calc(.9rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--tl-rule); background: #fff; color: var(--tl-navy); font-family: var(--tl-font);
  box-shadow: 0 -8px 32px rgb(28 43 77 / .1); animation: tl-bar-in .45s var(--tl-ease);
  transition: transform .35s var(--tl-ease), box-shadow .35s;
}
.tl-bar.is-collapsed { transform: translateY(100%); box-shadow: none; }

/* The fold tab, centred on the top edge so it never covers the consent tab
   (bottom left) or the back-to-top button (bottom right). */
.tl-bar .tl-b.tl-bar__toggle {
  position: absolute; bottom: 100%; left: 50%; translate: -50% 0;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  height: 30px; min-width: 56px; margin: 0; padding: 0 .9rem;
  border: 1px solid var(--tl-rule); border-bottom: 0; border-radius: 14px 14px 0 0;
  background: #fff; color: var(--tl-navy); box-shadow: 0 -6px 14px rgb(28 43 77 / .08);
  font-family: var(--tl-font); font-size: .8rem; font-weight: 600; line-height: 1; text-transform: none; cursor: pointer;
}
.tl-bar .tl-b.tl-bar__toggle:hover { background: var(--tl-pink); }
.tl-bar .tl-bar__toggle svg { width: 18px; height: 18px; }
.tl-bar__toggle-collapsed { display: none; align-items: center; gap: .35rem; }
.tl-bar__toggle-expanded { display: inline-flex; }
.tl-bar.is-collapsed .tl-bar__toggle-collapsed { display: inline-flex; }
.tl-bar.is-collapsed .tl-bar__toggle-expanded { display: none; }
.tl-bar.is-collapsed .tl-b.tl-bar__toggle { height: 36px; padding: 0 1rem; border-color: var(--tl-navy); background: var(--tl-navy); color: var(--tl-pink); }
.tl-bar.is-collapsed .tl-bar__toggle-collapsed svg:first-child { fill: currentColor; width: 16px; height: 16px; }
.tl-bar[hidden] { display: none; }
@keyframes tl-bar-in { from { translate: 0 100%; } }
.tl-bar *, .tl-bar *::before, .tl-bar *::after { box-sizing: border-box; }
.tl-bar__inner { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; max-width: 1380px; margin: 0 auto; }
.tl-bar__selection { display: flex; align-items: center; gap: 1.15rem; min-width: 0; }
.tl-bar__thumbs { display: flex; align-items: center; flex-shrink: 0; }
.tl-bar__thumb, .tl-bar__more { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 56px; height: 56px; overflow: hidden; border: 3px solid #fff; border-radius: 10px 0 10px 0; background: var(--tl-paper-muted); }
.tl-bar__thumb + .tl-bar__thumb, .tl-bar__more { margin-left: -10px; }
.tl-bar__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-bar__thumb-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--tl-heart); }
.tl-bar__thumb-fallback[hidden] { display: none; }
.tl-bar__thumb-fallback svg { width: 22px; height: 22px; }
.tl-bar__more { background: var(--tl-pink); font-size: .8rem; font-weight: 600; }
.tl-bar__copy { min-width: 0; }
.tl-bar p { margin: 0; }
.tl-bar__count { font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
.tl-bar__description { margin-top: .15rem !important; color: var(--tl-ink-soft); font-size: .85rem; line-height: 1.45; }
.tl-bar__actions { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
/* Both are <button>s, which the Elementor kit restyles; three classes outrank
   .elementor-kit-7 button and its :hover. */
.tl-bar .tl-b.tl-bar__manage, .tl-bar .tl-b.tl-bar__brochure {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px; margin: 0;
  border: 1px solid var(--tl-navy); border-radius: var(--tl-leaf); box-shadow: none;
  font-family: var(--tl-font); font-size: .9rem; font-weight: 500; letter-spacing: .02em; line-height: 1.2; text-transform: uppercase; white-space: nowrap; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.tl-bar .tl-b.tl-bar__manage { padding: .8rem 1.2rem; background: transparent; color: var(--tl-navy); }
.tl-bar .tl-b.tl-bar__manage:hover { background: var(--tl-pink); border-color: var(--tl-pink); color: var(--tl-navy); }
.tl-bar .tl-b.tl-bar__brochure { padding: .8rem 1.4rem; background: var(--tl-navy); color: var(--tl-pink); }
.tl-bar .tl-b.tl-bar__brochure:hover { background: var(--tl-accent); border-color: var(--tl-accent); color: #fff; }
.tl-bar .tl-b:focus-visible { outline: 2px solid var(--tl-accent); outline-offset: 3px; }
.tl-bar svg { flex-shrink: 0; width: 20px; height: 20px; }

@media (max-width: 52rem) {
  .tl-bar__inner { flex-wrap: wrap; gap: .75rem; }
  .tl-bar__actions { display: grid; grid-template-columns: 1fr 1.2fr; width: 100%; gap: .5rem; }
  .tl-bar .tl-b.tl-bar__manage, .tl-bar .tl-b.tl-bar__brochure { min-height: 44px; padding: .65rem .5rem; font-size: .72rem; gap: .4rem; white-space: normal; text-align: center; }
  .tl-bar svg { width: 17px; height: 17px; }
}
@media (max-width: 40rem) {
  .tl-bar { padding-top: .7rem; padding-bottom: calc(.7rem + env(safe-area-inset-bottom, 0px)); }
  .tl-bar__selection { gap: .7rem; }
  .tl-bar__thumb, .tl-bar__more { width: 42px; height: 42px; border-width: 2px; }
  .tl-bar__count { font-size: .9rem; }
  .tl-bar__description { font-size: .72rem; }
  .tl-form-favorites { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .tl-bar, #trilogia-favoris[open] { animation: none; } .tl-bar { transition: none; } }

/* ==========================================================================
   Header: the Favoris button that replaces « Réservez maintenant »
   It carries .elementor-button, so the kit and the header's own rules
   (scrolled sticky header, navy header on inner pages) draw it like the old CTA.
   ======================================================================= */

.livya-favorites-button.tl-favorites-header { position: relative; display: inline-flex; align-items: center; gap: .55em; line-height: 1.2; cursor: pointer; }
.livya-favorites-button.tl-favorites-header .livya-favorites-button__icon svg { display: block; width: 1.15em; height: 1.15em; }
.livya-favorites-button.tl-favorites-header .livya-favorites-count {
  top: -9px; right: -9px; min-width: 22px; height: 22px; padding: 0 6px;
  border: 2px solid #fff; font-size: 12px; font-weight: 600; line-height: 1;
}
@media (max-width: 767px) {
  .livya-favorites-button.tl-favorites-header { padding: 12px 18px; font-size: 14px; }
}

/* Livya modules in the pages keep a frame that fits the site. */
.elementor-widget-shortcode .livya-shortcode-module [class^="livya-module-container"] { border-radius: var(--tl-leaf-sm); }
