/* ============================================================
   BLOOPIN — HEADER PUBLIC AUTONOME V1
   ============================================================ */

/* Astra ne doit plus réapparaître en secours. */
.site-header,
.ast-mobile-popup-drawer,
.ast-mobile-header-wrap{
  display:none !important;
}

.bp-front-header{
  --bp-header-bg:#eef1f4;
  --bp-header-fg:#101828;
  --bp-adminbar-offset:0px;
  position:sticky;
  top:var(--bp-adminbar-offset);
  z-index:9990;
  width:100%;
  padding:0 12px;
  pointer-events:none;
}

/* En mode sombre, le header rejoint le shell Bloopin.
   Les couleurs personnalisées du restaurateur restent intactes en mode clair. */
body[data-mode="dark"] .bp-front-header{
  --bp-header-bg:var(--card-bg) !important;
  --bp-header-fg:var(--text) !important;
}


.bp-front-header__bar{
  position:relative;
  width:min(100%, 1480px);
  min-height:72px;
  margin:0 auto;
  padding:0 clamp(18px, 3vw, 34px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  background:var(--bp-header-bg);
  color:var(--bp-header-fg);
  pointer-events:auto;
  transition:background .2s ease, border-radius .2s ease;
}

.bp-front-header--rounded .bp-front-header__bar{
  border-radius:0 0 36px 36px;
}

.bp-front-header--square .bp-front-header__bar{
  border-radius:0;
}

.bp-front-header__brand{
  position:relative;
  z-index:2;
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  min-width:0;
  color:var(--bp-header-fg) !important;
  text-decoration:none !important;
}

.bp-front-header__logo{
  display:block;
  width:auto;
  max-width:min(250px, 36vw);
  object-fit:contain;
  object-position:left center;
  transition:height .2s ease;
}

.bp-front-header--logo-standard .bp-front-header__logo{ height:42px; }
.bp-front-header--logo-large .bp-front-header__logo{ height:54px; }

.bp-front-header__brand-text{
  overflow:hidden;
  color:var(--bp-header-fg);
  font-size:18px;
  font-weight:850;
  line-height:1.1;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.bp-front-header--logo-center .bp-front-header__brand{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  justify-content:center;
  max-width:44%;
}

.bp-front-header--logo-center .bp-front-header__logo{
  max-width:100%;
  object-position:center;
}

.bp-front-header__actions{
  position:relative;
  z-index:3;
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:12px;
}

.bp-front-header__burger{
  width:48px;
  height:48px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:14px;
  background:transparent;
  color:var(--bp-header-fg);
  cursor:pointer;
  transition:transform .18s ease, opacity .18s ease;
}

.bp-front-header__burger:hover{ opacity:.72; }
.bp-front-header__burger:active{ transform:scale(.96); }

.bp-front-header__burger:focus-visible{
  outline:2px solid color-mix(in srgb, var(--bp-header-fg) 42%, transparent);
  outline-offset:2px;
}

.bp-front-header__burger-icon{
  display:block;
  width:28px;
  height:28px;
  background:currentColor;
  -webkit-mask:url('../icons/menu-2.svg') center / contain no-repeat;
  mask:url('../icons/menu-2.svg') center / contain no-repeat;
}

.bp-front-header__reservation-wrap{ position:relative; }

.bp-front-header__reservation{
  min-height:46px;
  padding:0 22px;
  border:0;
  border-radius:var(--radius-button);
  background:var(--action-primary-bg);
  color:var(--action-primary-text);
  font-size:var(--text-body);
  font-weight:800;
  cursor:pointer;
  transition:transform .18s ease, filter .18s ease;
}

.bp-front-header__reservation:hover{
  transform:translateY(-1px);
  background:var(--action-primary-hover-bg);
  color:var(--action-primary-hover-text);
}
.bp-front-header__reservation:active{ transform:none; }
.bp-front-header__reservation:focus-visible{ outline:2px solid color-mix(in srgb, var(--accent) 42%, transparent); outline-offset:3px; }

.bp-front-header__reservation-popover{
  position:absolute;
  top:calc(100% + 12px);
  right:0;
  z-index:10020;
  width:max-content;
  min-width:230px;
  max-width:min(320px, calc(100vw - 32px));
  padding:16px;
  border:0;
  border-radius:var(--radius-panel);
  background:var(--card-bg-strong);
  color:var(--text);
  box-shadow:0 18px 42px rgba(0,0,0,.16);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

.bp-front-header__reservation-popover[hidden]{ display:none !important; }
.bp-front-header__reservation-popover strong{ display:block; margin:0 0 8px; font-size:var(--text-body); }
.bp-front-header__reservation-popover a{ display:block; color:var(--text) !important; font-size:18px; font-weight:900; text-decoration:none !important; }
.bp-front-header__reservation-popover a:hover{ color:var(--accent) !important; }
.bp-front-header__reservation-popover span{ display:block; margin-top:6px; color:var(--text-soft); font-size:11px; font-weight:600; }

/* Drawer ---------------------------------------------------- */
.bp-front-drawer-overlay{
  position:fixed;
  inset:0;
  z-index:9997;
  background:rgba(15,23,42,.18);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  transition:opacity .24s ease, visibility .24s ease;
}

.bp-front-drawer{
  position:fixed;
  inset:0 0 0 auto;
  z-index:9999;
  width:min(92vw, 410px);
  height:100dvh;
  /* 24px de respiration + 64px réservés au footer public fixe. */
  padding:84px 18px 88px;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  overscroll-behavior:contain;
  background:color-mix(in srgb, var(--surface) 96%, transparent);
  color:var(--text);
  border-left:0;
  box-shadow:-18px 0 42px rgba(0,0,0,.16);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  transform:translate3d(100%,0,0);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:transform .42s cubic-bezier(.22,1,.36,1), opacity .22s ease, visibility .22s ease;
}

body.bp-front-drawer-open .bp-front-drawer{
  transform:translate3d(0,0,0);
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

body.bp-front-drawer-open .bp-front-drawer-overlay{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

body.bp-front-drawer-open{ overflow:hidden; }

.bp-front-drawer__controls{
  position:absolute;
  inset:14px 18px auto 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.bp-front-drawer__close{
  position:relative;
  width:42px;
  height:42px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  cursor:pointer;
  color:var(--text);
}

.bp-front-drawer__close::before,
.bp-front-drawer__close::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:2px;
  height:19px;
  border-radius:999px;
  background:currentColor;
  transform-origin:center;
  transition:transform .36s cubic-bezier(.22,1,.36,1), opacity .18s ease;
}
.bp-front-drawer__close::before{ transform:translate(-50%,-50%) rotate(45deg); }
.bp-front-drawer__close::after{ transform:translate(-50%,-50%) rotate(-45deg); }
.bp-front-drawer__close:hover{ background:transparent !important; box-shadow:none; color:var(--text) !important; }
.bp-front-drawer__close:hover::before{ transform:translate(-50%,-50%) rotate(135deg); }
.bp-front-drawer__close:hover::after{ transform:translate(-50%,-50%) rotate(45deg); }
.bp-front-drawer__close:active::before,
.bp-front-drawer__close:active::after{ opacity:.62; }
.bp-front-drawer__close:focus-visible{ outline:2px solid color-mix(in srgb, var(--text) 28%, transparent); outline-offset:2px; color:var(--text) !important; }

.bp-front-theme-toggle{ position:relative; display:inline-flex; margin:0; }
.bp-front-theme-toggle input{ position:absolute; inset:0; opacity:0; cursor:pointer; }
.bp-front-theme-toggle__button{
  width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:50%;
  background:var(--action-secondary-bg);
  color:var(--action-secondary-text);
  box-shadow:var(--outline-control), var(--shadow-sm);
}
.bp-front-theme-toggle input:focus-visible + .bp-front-theme-toggle__button{
  box-shadow:var(--outline-control-strong), var(--focus-ring), var(--shadow-sm);
}
.bp-front-theme-toggle__icon{ display:none; width:20px; height:20px; }
.bp-front-theme-toggle__icon svg{ display:block; width:20px; height:20px; }
body[data-mode="light"] .bp-front-theme-toggle__icon--moon{ display:block; }
body[data-mode="dark"] .bp-front-theme-toggle__icon--sun{ display:block; }

.bp-front-drawer__hello{
  display:inline-flex;
  margin:0 0 20px;
  color:var(--text) !important;
  font-size:15px;
  font-weight:800;
  text-decoration:none !important;
}

.bp-front-drawer__nav{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.bp-front-drawer__link{
  min-height:56px;
  padding:0 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:0;
  border-radius:18px;
  color:var(--text-soft) !important;
  background:color-mix(in srgb, var(--text) 5%, transparent);
  font-size:var(--text-control);
  font-weight:800;
  text-decoration:none !important;
  transition:background .18s ease, color .18s ease, transform .18s ease;
}

.bp-front-drawer__link:hover{
  color:var(--text) !important;
  background:color-mix(in srgb, var(--text) 7%, transparent);
  transform:translateY(-1px);
}

.bp-front-drawer__link--menu{
  color:var(--accent) !important;
  background:color-mix(in srgb, var(--accent) 14%, var(--surface));
}

/* Accès professionnel : toujours repoussé en bas du drawer.
   Si le contenu dépasse la hauteur disponible, il reste simplement
   à la fin du flux et devient accessible par scroll, sans chevauchement. */
.bp-front-drawer__professional-access{
  margin-top:auto;
  padding-top:18px;
  border-top:1px solid var(--border-subtle);
}

.bp-front-drawer__link--restaurant{
  border-radius:18px;
}

.bp-front-drawer__account-icon{
  width:24px;
  height:24px;
  flex:0 0 24px;
  background:currentColor;
  -webkit-mask:url("../icons/user-square-rounded.svg") center/contain no-repeat;
  mask:url("../icons/user-square-rounded.svg") center/contain no-repeat;
}

/* Mode de consultation -------------------------------------- */
.bp-front-drawer__service-mode{
  position:relative;
  width:100%;
  min-height:66px;
  margin:14px 0 0;
  padding:11px 86px 11px 14px;
  display:flex;
  align-items:center;
  overflow:hidden;
  border:0;
  border-radius:var(--radius-control);
  background:var(--action-secondary-bg) !important;
  background-image:none !important;
  color:var(--text) !important;
  font:inherit;
  text-align:left;
  cursor:pointer;
  box-shadow:var(--outline-control);
  transition:box-shadow .18s ease, transform .18s ease;
}

.bp-front-drawer__service-mode:hover{
  transform:translateY(-1px);
  background:var(--action-secondary-hover-bg) !important;
  box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--accent) 34%,var(--border-subtle));
  background-image:none !important;
  color:var(--text) !important;
}

.bp-front-drawer__service-mode:focus-visible{
  outline:2px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset:2px;
}

.bp-front-drawer__service-mode-icon{
  position:absolute;
  right:8px;
  bottom:-13px;
  width:76px;
  height:76px;
  pointer-events:none;
  opacity:.10;
  background-color:var(--accent);
  -webkit-mask:url("../icons/building-store.svg") center/contain no-repeat;
  mask:url("../icons/building-store.svg") center/contain no-repeat;
}

.bp-front-drawer__service-mode[data-service-mode="takeaway"] .bp-front-drawer__service-mode-icon{
  -webkit-mask-image:url("../icons/shopping-bag.svg");
  mask-image:url("../icons/shopping-bag.svg");
}

.bp-front-drawer__service-mode[data-service-mode="unset"] .bp-front-drawer__service-mode-icon{
  opacity:.58;
}

.bp-front-drawer__service-mode-copy{
  position:relative;
  z-index:1;
  min-width:0;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  gap:3px;
}

.bp-front-drawer__service-mode-copy strong{
  color:var(--text);
  font-size:var(--text-control);
  line-height:1.15;
}

.bp-front-drawer__service-mode-copy small{
  color:var(--text-soft);
  font-size:var(--text-micro);
  font-weight:650;
  line-height:1.25;
}

.bp-front-drawer__reservation{
  min-height:66px;
  margin:14px 0 0;
  padding:11px 14px;
  display:flex;
  align-items:center;
  gap:12px;
  border-radius:var(--radius-button);
  background:var(--action-primary-bg);
  color:var(--action-primary-text) !important;
  text-decoration:none !important;
  box-shadow:0 12px 26px color-mix(in srgb,var(--primary) 18%,transparent);
}

.bp-front-drawer__reservation-icon{
  width:42px;
  height:42px;
  flex:0 0 42px;
  border-radius:14px;
  background:color-mix(in srgb, currentColor 14%, transparent);
  position:relative;
}

.bp-front-drawer__reservation-icon::before{
  content:"";
  position:absolute;
  inset:10px;
  background:currentColor;
  -webkit-mask:url("../icons/phone-check.svg") center/contain no-repeat;
  mask:url("../icons/phone-check.svg") center/contain no-repeat;
}

.bp-front-drawer__reservation-copy{ min-width:0; display:flex; flex-direction:column; gap:3px; }
.bp-front-drawer__reservation-copy strong{ font-size:var(--text-control); line-height:1.15; }
.bp-front-drawer__reservation-copy small{ overflow:hidden; font-size:var(--text-micro); font-weight:650; line-height:1.2; opacity:.78; text-overflow:ellipsis; white-space:nowrap; }

.bp-front-drawer__location{
  margin:12px 0 0;
  padding:14px 16px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:5px;
  border:0;
  border-radius:18px;
  background:color-mix(in srgb, var(--text) 3%, transparent);
  color:var(--text) !important;
  text-decoration:none !important;
  transition:background .18s ease, transform .18s ease;
}

.bp-front-drawer__location:hover{
  transform:translateY(-1px);
  background:color-mix(in srgb, var(--accent) 5%, transparent);
}

.bp-front-drawer__location strong{
  font-size:var(--text-body);
  font-weight:850;
  line-height:1.2;
}

.bp-front-drawer__location small{
  color:var(--text-soft);
  font-size:var(--text-micro);
  font-weight:650;
  line-height:1.35;
}

.bp-front-drawer__location-route{
  margin-top:3px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:var(--accent);
  font-size:var(--text-micro);
  font-weight:850;
  line-height:1.2;
}

.bp-front-drawer__location-route-icon{
  width:15px;
  height:15px;
  flex:0 0 15px;
  display:block;
  object-fit:contain;
}

.bp-front-drawer__account-box{
  margin:22px 0 0;
  padding:16px;
  border-top:1px solid var(--border-subtle);
  border-radius:0 0 18px 18px;
}
.bp-front-drawer__account-box strong{ display:block; margin:0 0 10px; font-size:var(--text-body); }
.bp-front-drawer__account-box a{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--radius-button);
  background:var(--action-primary-bg);
  color:var(--action-primary-text) !important;
  font-size:var(--text-body);
  font-weight:800;
  text-decoration:none !important;
}

/* Auth et panel conservent leurs écrans dédiés. */
body.bp-auth-page .bp-front-header,
body.bp-auth-page .bp-front-drawer,
body.bp-auth-page .bp-front-drawer-overlay,
body.page-panel .bp-front-header,
body.page-panel .bp-front-drawer,
body.page-panel .bp-front-drawer-overlay{
  display:none !important;
}

@media (max-width:1024px){
  .bp-front-header{ padding:0; }

  /* Le footer mobile public est fixe en bas de l'écran.
     On réserve sa hauteur dans le drawer pour que l'accès
     restaurateur reste entièrement visible au-dessus. */
  .bp-front-drawer{
    padding-bottom:calc(96px + env(safe-area-inset-bottom));
  }
  .bp-front-header__bar{
    width:100%;
    min-height:68px;
    padding:0 18px;
  }
  .bp-front-header--rounded .bp-front-header__bar{ border-radius:0 0 28px 28px; }
  .bp-front-header__reservation-wrap{ display:none; }
  .bp-front-header__burger{ width:44px; height:44px; border-radius:12px; }
  .bp-front-header--logo-standard .bp-front-header__logo{ height:38px; }
  .bp-front-header--logo-large .bp-front-header__logo{ height:48px; }
  .bp-front-header__logo{ max-width:44vw; }
  .bp-front-header--logo-center .bp-front-header__brand{ max-width:52%; }
  .bp-front-drawer{ width:min(92vw, 380px); }
}


@media (max-width:480px){
  .bp-front-header__bar{ min-height:64px; padding:0 14px 0 20px; }
  .bp-front-header--rounded .bp-front-header__bar{ border-radius:0 0 24px 24px; }
  .bp-front-header--logo-standard .bp-front-header__logo{ height:34px; }
  .bp-front-header--logo-large .bp-front-header__logo{ height:44px; }
  .bp-front-drawer{ width:min(100vw, 380px); padding-left:14px; padding-right:14px; }
}

/* ============================================================
   FINAL UX — Burger neutre + réservation intégrée au header
============================================================ */

.bp-front-header__burger:hover,
.bp-front-header__burger:focus,
.bp-front-header__burger:focus-visible{
  opacity:1 !important;
  transform:none !important;
  outline:0 !important;
  background:transparent !important;
  color:var(--bp-header-fg) !important;
  box-shadow:none !important;
}

.bp-front-header__reservation{
  min-height:44px;
  padding:0 18px;
  border:0 !important;
  border-radius:var(--radius-control);
  background:color-mix(in srgb, var(--bp-header-fg) 10%, transparent) !important;
  color:var(--bp-header-fg) !important;
  box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--bp-header-fg) 20%, transparent);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  transition:background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.bp-front-header__reservation:hover{
  transform:translateY(-1px);
  background:color-mix(in srgb, var(--bp-header-fg) 16%, transparent) !important;
  color:var(--bp-header-fg) !important;
  box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--bp-header-fg) 30%, transparent);
}

.bp-front-header__reservation:focus-visible{
  outline:0;
  background:color-mix(in srgb, var(--bp-header-fg) 14%, transparent) !important;
  color:var(--bp-header-fg) !important;
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--bp-header-fg) 34%, transparent),
    0 0 0 3px color-mix(in srgb, var(--bp-header-fg) 12%, transparent);
}
