/* =========================================================================
   Docteure Apple — application (PWA)
   1. Bannière d'application · 2. Fiches (installation, notifications, conseiller)
   3. Application installée : lancement, accueil, barre d'onglets, en-tête, gestes
   ========================================================================= */

:root { --da-tab-h: 50px; --da-app-radius: 22px; }

/* ---------- 1. Bannière d'application (mobile, navigateur) ---------- */
.da-smartbar { display: none; align-items: center; gap: 10px; padding: 9px 12px 9px 8px; background: #f6f6f8; border-bottom: 1px solid rgba(0, 0, 0, .06); font-family: var(--da-font); position: relative; z-index: 1001; }
html.da-sb .da-smartbar { display: flex; animation: da-sb-in .5s var(--da-ease) both; }
html.da-sb-out .da-smartbar { animation: da-sb-out .35s ease forwards; }
@keyframes da-sb-in { from { opacity: 0; margin-top: -58px; } }
@keyframes da-sb-out { to { opacity: 0; margin-top: -58px; } }
.da-smartbar img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12); flex: none; background: #fff; }
.da-smartbar__txt { flex: 1; min-width: 0; line-height: 1.2; }
.da-smartbar__txt strong { display: block; font-size: 14px; font-weight: 600; color: var(--da-text); }
.da-smartbar__txt span { font-size: 12px; color: var(--da-text-2); }
.da-smartbar__x { width: 26px; height: 26px; border: 0; background: none; padding: 0; display: grid; place-items: center; color: #8e8e93; flex: none; cursor: pointer; }
.da-smartbar__x svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.da-smartbar__get { border: 0; background: var(--da-teal); color: #fff; font: 600 14px var(--da-font); padding: 7px 18px; border-radius: 999px; cursor: pointer; flex: none; transition: transform .15s; }
.da-smartbar__get:active { transform: scale(.95); }
@media (min-width: 822px) { html.da-sb .da-smartbar { display: none; } }
/* Accueil : l'en-tête est fixe, il se place sous la bannière tant qu'elle est visible */
html.da-sb body.da-home .da-header, html.da-sb body.da-overlay-header .da-header { top: var(--da-sb-off, 0px); }
@media (min-width: 822px) { html.da-sb body .da-header { top: 0; } }

/* ---------- 2. Fiches ---------- */
.da-app-sheet .da-modal__dialog { max-width: 440px; padding: 34px 28px 26px; text-align: center; }
@media (max-width: 734px) { .da-app-sheet .da-modal__dialog { padding: 26px 22px calc(22px + var(--da-safe-b)); } }
.da-app-panel[hidden] { display: none !important; }
.da-app-panel { animation: da-panel-in .45s var(--da-ease) both; }
@keyframes da-panel-in { from { opacity: 0; transform: translateX(18px); } }

.da-app-hero { margin-bottom: 22px; }
.da-app-hero h3 { font-size: 26px !important; line-height: 1.15 !important; letter-spacing: -.02em; margin: 16px 0 8px !important; font-weight: 700 !important; }
.da-app-hero p { margin: 0; color: var(--da-text-2); font-size: 15px; line-height: 1.45; }
.da-app-hero--sm h3 { font-size: 22px !important; margin-top: 12px !important; }
.da-app-hero--left { text-align: left; }
.da-app-hero--left h3 { margin-top: 0 !important; }

.da-app-icon { display: block; margin: 0 auto; width: 96px; height: 96px; border-radius: 22.5%; background: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .1), 0 10px 30px rgba(0, 24, 114, .16); }
.da-app-icon--sm { width: 64px; height: 64px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .1), 0 6px 18px rgba(0, 24, 114, .14); }
.da-app-icon--xl { width: 128px; height: 128px; }
.da-app-sheet .is-open .da-app-icon, .da-app-sheet.is-open [data-da-app-panel="intro"] .da-app-icon { animation: da-icon-pop .7s var(--da-ease) .1s both; }
@keyframes da-icon-pop { from { transform: scale(.6) translateY(10px); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } }

.da-app-perks { list-style: none; margin: 0 0 26px; padding: 0; text-align: left; display: grid; gap: 16px; }
.da-app-perks li { display: flex; gap: 14px; align-items: flex-start; }
.da-app-perks strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.da-app-perks span:not(.da-app-perk__ic) { display: block; font-size: 14px; color: var(--da-text-2); line-height: 1.4; }
.da-app-perk__ic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.da-app-perk__ic svg { width: 21px; height: 21px; }
.da-app-perk__ic--bell { background: linear-gradient(160deg, #ff6a5a, #ff2d55); }
.da-app-perk__ic--bolt { background: linear-gradient(160deg, #1aa3ff, #001872); }
.da-app-perk__ic--chat, .da-app-perk__ic--wa { background: linear-gradient(160deg, #3ddc84, #1f9d55); }
.da-app-perk__ic--tel { background: linear-gradient(160deg, #34c759, #248a3d); }
.da-app-perk__ic--map { background: linear-gradient(160deg, #5ac8fa, #00a3ae); }
.da-app-perk__ic--lg { width: 56px; height: 56px; border-radius: 15px; margin: 0 auto; }
.da-app-perk__ic--lg svg { width: 28px; height: 28px; }

.da-app-cta { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: var(--da-navy); color: #fff !important; font: 600 17px var(--da-font); letter-spacing: -.01em; cursor: pointer; text-decoration: none !important; transition: transform .15s, opacity .2s, background .2s; }
.da-app-cta:active { transform: scale(.98); opacity: .9; }
.da-app-cta.is-loading { opacity: .6; pointer-events: none; }
.da-app-cta--soft { background: rgba(0, 24, 114, .07); color: var(--da-navy) !important; margin-top: 10px; }
.da-app-cta[hidden] { display: none; }
.da-app-later { display: block; width: 100%; border: 0; background: none; padding: 14px 0 2px; font: 500 16px var(--da-font); color: var(--da-teal); cursor: pointer; }
.da-app-err { margin: 12px 0 0; color: #d70015; font-size: 14px; }
.da-app-h { font-size: 24px !important; margin: 8px 0 8px !important; letter-spacing: -.02em; }
.da-app-p { margin: 0 0 22px; color: var(--da-text-2); font-size: 15px; line-height: 1.45; }

/* Étapes « Ajouter à l'écran d'accueil » */
.da-app-steps { list-style: none; margin: 0 0 24px; padding: 0; text-align: left; border-radius: 16px; background: var(--da-bg); overflow: hidden; }
.da-app-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 15px 16px; position: relative; }
.da-app-steps li + li::before { content: ""; position: absolute; top: 0; left: 54px; right: 0; height: 1px; background: rgba(0, 0, 0, .07); }
.da-app-step__n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--da-navy); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.da-app-steps strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.da-app-steps div > span { display: block; font-size: 13px; color: var(--da-text-2); margin-top: 4px; line-height: 1.4; }
.da-app-key { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .06); color: #007aff; font-weight: 600; font-size: 14px; }
.da-app-key svg { width: 17px; height: 17px; }
.da-app-key--sm { padding: 0 7px; font-size: 12px; letter-spacing: 1px; color: var(--da-text); }
.da-app-key--wide { color: var(--da-text); }
.da-app-key--blue { color: #007aff; }
.da-app-steps li:first-child .da-app-key:first-of-type { animation: da-key-pulse 1.8s ease-in-out infinite; }
@keyframes da-key-pulse { 50% { box-shadow: 0 0 0 4px rgba(0, 122, 255, .18), 0 1px 2px rgba(0, 0, 0, .06); } }

/* Aperçu de notification */
.da-notif-demo { position: relative; margin: 6px auto 22px; width: 100%; max-width: 340px; height: 92px; }
.da-notif-demo__card { position: absolute; inset: 0 0 auto; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: start; text-align: left; padding: 12px 14px; border-radius: 18px; background: rgba(245, 245, 247, .95); box-shadow: 0 10px 30px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .06); z-index: 2; animation: da-notif-drop .9s var(--da-ease) .25s both; }
.da-notif-demo__card img { width: 38px; height: 38px; border-radius: 9px; background: #fff; }
.da-notif-demo__card b { display: block; font-size: 14px; }
.da-notif-demo__card span { display: block; font-size: 13.5px; line-height: 1.3; color: var(--da-text); }
.da-notif-demo__card time { font-size: 12px; color: #8e8e93; }
.da-notif-demo__card--back { top: 14px; left: 14px; right: 14px; height: 70px; z-index: 1; opacity: .55; transform: scale(.96); animation-delay: .4s; }
@keyframes da-notif-drop { from { opacity: 0; transform: translateY(-26px) scale(.96); } }
.da-notif-demo--lg { max-width: 360px; }

/* Listes réglages façon iOS */
.da-app-group { text-align: left; margin-bottom: 18px; }
.da-app-group__title { margin: 0 0 8px 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--da-text-2); }
.da-app-list { border-radius: 14px; background: var(--da-bg); overflow: hidden; text-align: left; }
.da-app-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 14px; border: 0; background: none; font: 500 15px var(--da-font); color: var(--da-text); text-decoration: none !important; cursor: pointer; position: relative; text-align: left; }
.da-app-row + .da-app-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: rgba(0, 0, 0, .07); }
.da-app-list--actions .da-app-row + .da-app-row::before { left: 66px; }
.da-app-row > span:not(.da-app-perk__ic) { flex: 1; min-width: 0; }
.da-app-row strong { display: block; font-weight: 600; }
.da-app-row small { display: block; font-size: 13px; color: var(--da-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.da-app-row:active { background: rgba(0, 0, 0, .05); }
html .da-app-row, html .da-app-row strong { color: var(--da-text) !important; }
.da-app-row__chev { width: 14px; height: 14px; color: #c7c7cc; flex: none; }
.da-app-list--actions .da-app-perk__ic { width: 38px; height: 38px; border-radius: 10px; }
.da-switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 999px; background: #e9e9eb; position: relative; cursor: pointer; transition: background .25s; margin: 0; }
.da-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .3s var(--da-ease); }
.da-switch:checked { background: #34c759; }
.da-switch:checked::after { transform: translateX(20px); }
.da-help-status { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #d70015; }
.da-help-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.da-help-status.is-open { color: #1f9d55; }

/* ---------- 3. Application installée ---------- */
.da-launch, .da-onboard, .da-tabbar, .da-ptr, .da-navbar-progress { display: none; }

/* Rien de la boutique ne s'affiche avant l'écran de lancement / l'écran de bienvenue */
html.da-launching, html.da-onboard-pending, html.da-launching body, html.da-onboard-pending body { background: #fff !important; }
html.da-launching body *, html.da-onboard-pending body * { visibility: hidden; }
html.da-launching .da-launch, html.da-launching .da-launch *, html.da-onboard-pending .da-onboard, html.da-onboard-pending .da-onboard *, html.da-onboard-pending .da-launch, html.da-onboard-pending .da-launch * { visibility: visible; }
html.da-onboard-pending .da-onboard { display: flex !important; position: fixed; inset: 0; z-index: 2500; background: #fff; flex-direction: column; justify-content: center; padding: calc(24px + env(safe-area-inset-top)) 28px calc(28px + var(--da-safe-b)); text-align: center; }

/* Écran de lancement : prolonge l'écran système, puis s'efface */
html.da-launching .da-launch { display: grid; position: fixed; inset: 0; z-index: 3000; place-items: center; background: #fff; }
html.da-launching .da-launch img { width: 120px; height: 120px; border-radius: 22.5%; animation: da-launch-in .9s var(--da-ease) both; }
html.da-launched .da-launch { display: grid; position: fixed; inset: 0; z-index: 3000; place-items: center; background: #fff; animation: da-launch-out .45s ease forwards; pointer-events: none; }
html.da-launched .da-launch img { width: 120px; height: 120px; border-radius: 22.5%; animation: da-launch-zoom .45s var(--da-ease) forwards; }
@keyframes da-launch-in { from { transform: scale(.92); opacity: .6; } }
@keyframes da-launch-out { to { opacity: 0; visibility: hidden; } }
@keyframes da-launch-zoom { to { transform: scale(1.25); opacity: 0; } }

/* Accueil au premier lancement */
html.da-standalone .da-onboard:not([hidden]) { display: flex; position: fixed; inset: 0; z-index: 2500; background: #fff; flex-direction: column; justify-content: center; padding: calc(24px + env(safe-area-inset-top)) 28px calc(28px + var(--da-safe-b)); text-align: center; animation: da-fade .4s ease both; }
.da-onboard__step { display: none; flex-direction: column; align-items: center; max-width: 420px; margin: 0 auto; width: 100%; flex: 1; justify-content: center; }
.da-onboard__step.is-on { display: flex; animation: da-step-in .55s var(--da-ease) both; }
@keyframes da-step-in { from { opacity: 0; transform: translateX(30px); } }
@keyframes da-fade { from { opacity: 0; } }
.da-onboard__art { min-height: 150px; display: grid; place-items: center; width: 100%; margin-bottom: 26px; }
.da-onboard__art .da-app-icon--xl { animation: da-icon-pop .8s var(--da-ease) .1s both; }
.da-onboard h2 { font-size: 30px !important; line-height: 1.12 !important; letter-spacing: -.025em; margin: 0 0 12px !important; font-weight: 700 !important; }
.da-onboard p { color: var(--da-text-2); font-size: 17px; line-height: 1.45; margin: 0; }
.da-onboard__actions { width: 100%; margin-top: auto; padding-top: 30px; }
.da-onboard__dots { display: flex; gap: 7px; justify-content: center; padding-top: 18px; }
.da-onboard__dots i { width: 7px; height: 7px; border-radius: 50%; background: #d1d1d6; transition: all .3s; }
.da-onboard__dots i.is-on { background: var(--da-navy); width: 20px; border-radius: 4px; }
.da-onboard__check svg { width: 110px; height: 110px; fill: none; stroke: #34c759; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.da-onboard__check circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: da-draw .7s ease .1s forwards; }
.da-onboard__check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: da-draw .4s ease .7s forwards; }
@keyframes da-draw { to { stroke-dashoffset: 0; } }

html.da-onboarding .da-cotis-overlay { display: none !important; }

/* Barre d'onglets */
html.da-standalone .da-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 990; height: calc(var(--da-tab-h) + var(--da-safe-b)); padding-bottom: var(--da-safe-b); background: rgba(250, 250, 252, .86); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid rgba(0, 0, 0, .14); transition: transform .35s var(--da-ease); }
.da-tabbar a, .da-tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: #8e8e93; font: 500 10.5px var(--da-font); text-decoration: none !important; cursor: pointer; position: relative; padding: 4px 0 0; -webkit-tap-highlight-color: transparent; transition: color .2s; }
.da-tabbar svg { width: 25px; height: 25px; transition: transform .25s var(--da-ease); }
.da-tabbar a:active svg, .da-tabbar button:active svg { transform: scale(.86); }
html .da-tabbar a, html .da-tabbar button { color: #8e8e93 !important; }
html .da-tabbar .is-active { color: var(--da-navy) !important; }
.da-tabbar .is-active svg { stroke-width: 2; }
.da-tabbar__badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px rgba(250, 250, 252, .95); }
.da-tabbar__badge.is-bump { animation: da-bump .5s var(--da-ease); }
@keyframes da-bump { 40% { transform: scale(1.35); } }
html.da-standalone body { padding-bottom: calc(var(--da-tab-h) + var(--da-safe-b)); }
html.da-standalone .da-fab { display: none !important; }
html.da-standalone .da-sticky-buy { bottom: calc(var(--da-tab-h) + var(--da-safe-b)); padding-bottom: 10px; }
html.da-standalone .da-toasts { top: calc(var(--da-nav-h) + 12px + env(safe-area-inset-top)); }
html.da-standalone .da-modal { z-index: 1010; }
@media (min-width: 822px) {
  html.da-standalone .da-tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 480px; bottom: 16px; height: 58px; padding: 0; border-radius: 20px; border: .5px solid rgba(0, 0, 0, .1); box-shadow: 0 10px 40px rgba(0, 0, 0, .12); }
  html.da-standalone body { padding-bottom: 90px; }
  html.da-standalone .da-sticky-buy { bottom: 0; }
}
/* Tunnel de commande : on se concentre sur la commande */
html.da-standalone body#module-dashowroom-checkout .da-tabbar, html.da-standalone body#order .da-tabbar { transform: translateY(110%); }

/* En-tête : retour + partage */
.da-nav__back, .da-nav__share { display: none; }
html.da-standalone .da-nav__back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 8px 8px 8px 0; margin-right: 4px; color: var(--da-teal); font: 400 17px var(--da-font); cursor: pointer; }
html.da-standalone .da-nav__back svg { width: 22px; height: 22px; }
html.da-standalone body.da-home .da-nav__back { display: none; }
html.da-standalone .da-nav__share { display: inline-flex; }
html.da-standalone .da-nav [data-da-offcanvas-open].da-nav__icon { display: none; }
body.da-xp-dark .da-nav__back { color: #fff; }

/* Tirer pour actualiser */
html.da-standalone .da-ptr { display: grid; place-items: center; position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; background: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .14); z-index: 1200; transform: translateY(-80px); opacity: 0; pointer-events: none; }
.da-ptr svg { width: 20px; height: 20px; fill: none; stroke: var(--da-navy); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.da-ptr.is-ready svg { stroke: var(--da-teal); }
.da-ptr.is-loading svg { animation: da-spin .8s linear infinite; }
@keyframes da-spin { to { transform: rotate(360deg); } }

/* Indicateur de chargement (l'app n'a pas de barre d'adresse) */
html.da-standalone .da-navbar-progress { display: block; position: fixed; top: env(safe-area-inset-top); left: 0; height: 2.5px; width: 0; background: linear-gradient(90deg, var(--da-teal), var(--da-navy)); z-index: 3001; opacity: 0; transition: width .3s ease, opacity .3s; }
.da-navbar-progress.is-on { opacity: 1; width: 82%; transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .2s; }

/* Sensation d'application native */
html.da-standalone { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
html.da-standalone body { -webkit-touch-callout: none; }
html.da-standalone .da-header, html.da-standalone .da-tabbar, html.da-standalone .da-btn, html.da-standalone button { -webkit-user-select: none; user-select: none; }
html.da-standalone a:active img { opacity: .85; }

/* Transitions entre les pages (navigateurs compatibles) */
@media (display-mode: standalone) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: da-vt-out .22s ease both; }
  ::view-transition-new(root) { animation: da-vt-in .32s var(--da-ease, cubic-bezier(.25, .1, .25, 1)) both; }
  .da-header { view-transition-name: da-header; }
  .da-tabbar { view-transition-name: da-tabbar; }
}
@keyframes da-vt-out { to { opacity: 0; transform: translateX(-24px); } }
@keyframes da-vt-in { from { opacity: 0; transform: translateX(32px); } }

@media (prefers-reduced-motion: reduce) {
  .da-app-panel, .da-onboard__step.is-on, .da-notif-demo__card, .da-app-icon, html.da-sb .da-smartbar { animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
