/* =========================================================
   SAVORY — Design tokens
   ========================================================= */
:root{
  --color-primary: #FF6A1A;
  --color-primary-dark: #E8570D;
  --color-primary-tint: #FFF1E7;
  --color-accent-green: #1FAA59;
  --color-star: #FFB800;

  --ink-900: #1E2130;
  --ink-600: #565B6E;
  --ink-400: #9296A6;
  --line: #EEF0F3;

  --bg-app: #FAFAFA;
  --bg-card: #FFFFFF;

  --font-display: "Poppins", sans-serif;
  --font-body: "Inter", sans-serif;

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;

  --shadow-card: 0 6px 18px rgba(30, 33, 48, 0.06);
  --shadow-fab: 0 10px 24px rgba(255, 106, 26, 0.28);
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }

body{
  background: #E9EAEE;
  font-family: var(--font-body);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain; /* Empêche le pull-to-refresh */
}

button{ font-family: inherit; cursor: pointer; }
a{ text-decoration: none; color: inherit; }

img{ display:block; max-width:100%; }

/* App shell — full width on mobile, phone-like column on wider screens */
.app{
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-app);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0,0,0,0.08);
}

@media (min-width: 481px){
  body{ display:flex; }
  .app{ min-height: 100vh; }
}

/* =========================================================
   TOP BAR (header + recherche) — fixe en haut, comme le footer
   ========================================================= */
.top-bar{
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-app);
  padding-top: env(safe-area-inset-top);
}

/* =========================================================
   HEADER
   ========================================================= */
.header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 4px 20px 12px;
  gap: 20px;
}

/* LOGO — barre fine au-dessus du header, identique sur toutes les tailles */
.brand-bar{ padding: 16px 20px 2px; }
.brand{
  display:inline-flex;
  align-items:center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--color-primary);
  letter-spacing: -0.2px;
}
.brand__mark{ font-size: 19px; }

.header__user{ display:flex; align-items:center; gap: 12px; }

.avatar{
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow-card);
}

.header__text{ display:flex; flex-direction:column; gap: 3px; }

.hello{
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
}

.location{
  display:flex; align-items:center; gap: 4px;
  background:none; border:none; padding:0;
  color: var(--ink-600);
  font-size: 12.5px;
}
.location svg:first-child{ color: var(--color-primary); }
.location svg:last-child{ color: var(--ink-400); }

.icon-btn{
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card);
  display:flex; align-items:center; justify-content:center;
  color: var(--ink-900);
  box-shadow: var(--shadow-card);
  position: relative;
}

.notif-dot{
  position:absolute;
  top: 10px; right: 11px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--bg-card);
}

/* =========================================================
   SEARCH
   ========================================================= */
.search-wrap{
  padding: 4px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.search-bar{
  display:flex; align-items:center; gap: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-m);
  padding: 13px 16px;
  box-shadow: var(--shadow-card);
}
.search-bar svg:first-child{ color: var(--ink-400); flex-shrink:0; }

.search-bar input{
  flex:1; border:none; outline:none; background:none;
  font-size: 14.5px; color: var(--ink-900); font-family: var(--font-body);
}
.search-bar input::placeholder{ color: var(--ink-400); }

.mic-btn{
  border:none; background: var(--color-primary-tint);
  width: 30px; height: 30px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  color: var(--color-primary); flex-shrink:0;
}

/* =========================================================
   CONTENU — conteneur générique rempli par router.js.
   Les styles propres à chaque page (hero, categories, rest-list…)
   vivent dans leur propre css/<page>/<page>.css, pas ici.
   ========================================================= */
.content{ padding-bottom: 10px; flex:1; }

.section{ padding: 6px 20px 22px; }

.section__head{
  display:flex; align-items:baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.section__head h2{
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; margin:0;
}
.see-all{
  font-size: 12.5px; font-weight: 600; color: var(--color-primary);
}

/* =========================================================
   BOTTOM NAV
   ========================================================= */
.bottom-nav{
  position: sticky; bottom:0; left:0; right:0;
  background: var(--bg-card);
  border-top: 1px solid var(--line);
  display:flex; justify-content: space-between;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
}
.footer-icon-left-btn{
  background:none; border:none;
  display:flex; flex-direction:column; align-items:center; gap:4px;
  color: var(--ink-400); font-size: 10px; font-weight:600;
  padding: 4px 6px;
  flex: 1;
}
.footer-icon-left-btn i{ font-size: 19px; }
.footer-icon-left-btn.active{ color: var(--color-primary); }
.footer-icon-left-btn:focus-visible{ outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 8px; }

/* Onglet réservé aux comptes "restaurateur" — masqué tant que le rôle
   de l'utilisateur connecté n'a pas été vérifié côté JS (voir global.js) */
.footer-icon-left-btn--owner-only{ display: none; }

/* =========================================================
   EMPTY STATE — utilisé par le JS des pages quand une liste est vide
   ========================================================= */
.empty-state{
  text-align:center; padding: 24px 12px;
  color: var(--ink-400); font-size: 13px;
}

/* =========================================================
   MODAL GÉNÉRIQUE — "Tout voir" (catégories, restaurants populaires...)
   Autonome, indépendant du système de popup existant (#popup / popup.css)
   pour ne pas dépendre d'une API que je ne connais pas encore.
   ========================================================= */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.is-open{ opacity: 1; pointer-events: auto; }

.modal-panel{
  background: var(--bg-card);
  width: 100%;
  max-width: 480px;
  max-height: 78vh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(16px);
  transition: transform .2s ease;
}
.modal-overlay.is-open .modal-panel{ transform: translateY(0); }

.modal-panel__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-panel__head h3{
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.modal-panel__close{
  border: none;
  background: var(--bg-app);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-600);
  flex-shrink: 0;
}

.modal-panel__body{
  padding: 16px 18px 24px;
  overflow-y: auto;
}

.modal-loading{
  text-align: center;
  color: var(--ink-400);
  padding: 24px 0;
}

@media (min-width: 700px){
  .modal-overlay{ align-items: center; }
  .modal-panel{ border-radius: 20px; max-height: 70vh; }
}

/* =========================================================
   RESPONSIVE — GRAND ÉCRAN / ORDINATEUR (≥ 1024px)
   Concerne la coquille (.app) uniquement : ces règles doivent
   s'appliquer sur TOUTES les pages, donc elles restent ici et
   pas dans le css d'une page en particulier (ex: home.css).
   ========================================================= */
@media (min-width: 1024px){
  .app{
    max-width: 640px;
    box-shadow: 0 0 60px rgba(0,0,0,0.08);
  }
}



/* ---------------------------------------------------------
   STICKY HEADER
   --------------------------------------------------------- */
.page-sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-page, #ffffff);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 4px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 4px;
  gap: 12px;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--bg-card, #f5f6fa);
  color: var(--ink-700, #2d3436);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.back-btn:hover {
  background: var(--color-primary, #FF6B35);
  color: #fff;
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.back-btn:active {
  transform: scale(0.92);
}

.page-header__title {
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-900, #2d3436);
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-header__spacer {
  width: 40px;
  flex-shrink: 0;
}



/* =========================================================
   CART NOTIFICATION — Banniére flottante en haut
   ========================================================= */

.cart-notification {
  position: sticky;
  top: 0;
  z-index: 25;
  padding: 8px 16px;
  background: var(--color-primary, #FF6B35);
  background: linear-gradient(135deg, #FF6B35, #FF8F65);
  margin: 0;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
  animation: slideDown 0.3s ease;
}

.cart-notification.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cart-notification__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cart-notification__btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.01);
}

.cart-notification__btn:active {
  transform: scale(0.98);
}

.cart-notification__icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.cart-notification__badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #fff;
  color: #FF6B35;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cart-notification__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 12px;
}

.cart-notification__label {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
}

.cart-notification__total {
  font-size: 16px;
  font-weight: 700;
}

.cart-notification__arrow {
  font-size: 14px;
  opacity: 0.8;
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (min-width: 700px) {
  .cart-notification {
    padding: 10px 32px;
  }

  .cart-notification__btn {
    padding: 12px 20px;
  }

  .cart-notification__total {
    font-size: 18px;
  }

  .cart-notification__label {
    font-size: 14px;
  }
}

@media (max-width: 400px) {
  .cart-notification {
    padding: 6px 12px;
  }

  .cart-notification__btn {
    padding: 8px 12px;
  }

  .cart-notification__icon {
    font-size: 18px;
  }

  .cart-notification__badge {
    width: 16px;
    height: 16px;
    font-size: 9px;
    top: -4px;
    right: -6px;
  }

  .cart-notification__label {
    font-size: 12px;
  }

  .cart-notification__total {
    font-size: 14px;
  }

  .cart-notification__arrow {
    font-size: 12px;
  }
}

/* Style du conteneur fullscreen personnalisé */
.fullscreen-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index:9999;
}

.fullscreen-wrapper img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}



/* Bouton de fermeture */
.fullscreen-close {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  color: white;
  border-radius:5px;
  background-color:white;
  cursor: pointer;
  z-index: 10000;
}
.fullscreen-close i {
  font-size: 30px;
  color: #F442A3; 
}

.fullscreen-icon {
  position: absolute;
  top: 0;
  right: 0;
  width: 25px;
  height: 25px;
  background-image: url('/biblio-app/assets/icons/background/background_1.png');
  background-color: rgba(220, 180, 40, 0.6);
  color: white;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-icon i {
  font-size: 24px; 
}

.nav-arrow {
  position: absolute;
  z-index: 10001;
  color: white;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  transition: background-color 0.3s;
}

.nav-arrow:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.left-arrow { left: 10px; top: 50%; transform: translateY(-50%); }
.right-arrow { right: 10px; top: 50%; transform: translateY(-50%); }
.up-arrow { top: 10px; left: 50%; transform: translateX(-50%); }
.down-arrow { bottom: 10px; left: 50%; transform: translateX(-50%); }

.container-footer-actions-fullscreen {
    display: flex;
    flex-direction: column;
    position:absolute;
    width: 200px;
    height: 40px;
    justify-content: center;
    align-items: center;
    bottom: 80px; /* Marge depuis le bas */
    left: 50%;
    transform: translateX(-50%); /* Centre horizontalement seulement */
    gap: 20px;
    z-index: 5;
    background-image: url('/biblio-app/assets/icons/background/background_1.png');
    padding: 3px 10px;
    border-radius: 10px; /* Forme ovale */
    backdrop-filter: blur(5px); /* Effet de flou sur le fond */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Ombre subtile */
}
.footer-actions-fullscreen {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-direction: row;
    width: 100%;
    height: 100%;
    align-items: center;
    background: rgba(220, 180, 40, 0.6);
    padding: 0 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow-x:auto;
}
.footer-actions-fullscreen .image-counter {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 20px;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    border: 2px dashed #F442A3;
    border-radius: 5px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.footer-actions-fullscreen .btn-actions {
    display: flex;
    flex-direction: column;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    border: 2px dashed #F442A3;
    border-radius: 10px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-actions-fullscreen .btn-actions:hover {
    background-color: rgba(244, 66, 163, 0.1);
    border-color: #d41b7a;
}

.footer-actions-fullscreen .btn-actions i {
    font-size: 20px;
    color: #F442A3;
    margin-bottom: 0px;
}

.footer-actions-fullscreen .btn-actions .footer-actions-label {
    font-weight: 500;
    color: #555;
    font-size: 12px;
    text-align: center;
    padding:2px;
}


.hidden {
    display: none;
}



/* Icône fullscreen */
.fullscreen-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a90e2;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.menu-item:hover .fullscreen-icon {
    opacity: 1;
    transform: scale(1);
}

.fullscreen-icon:hover {
    background: #4a90e2;
    color: white;
    transform: scale(1.1) rotate(90deg);
}
