@import url("responsive-guard.css");

:root {
  --body-bg: #f8f9fa;
  --white: #ffffff;
  --text: #171717;
  --muted: #5b616e;
  --line: #e5e7eb;
  --primary: #ff7a00;
  --primary-soft: #ff7a001f;
  --primary-shadow: rgba(255, 122, 0, 0.26);
  --whatsapp: #25d366;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-logo: 0 14px 32px rgba(0, 0, 0, 0.16);
  --font: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --detail-actions-pad-y: 0.85rem;
  --detail-actions-btn-h: 3.05rem;
  --detail-actions-h: calc(var(--detail-actions-pad-y) * 2 + var(--detail-actions-btn-h) + var(--safe-bottom));
  --bottom-nav-pad-top: 0.55rem;
  --bottom-nav-pad-bottom: 0.62rem;
  --bottom-nav-item-h: 3.35rem;
  --bottom-nav-label-size: clamp(0.6875rem, 0.66rem + 0.12vw, 0.75rem);
  --bottom-nav-h: calc(var(--bottom-nav-pad-top) + var(--bottom-nav-pad-bottom) + var(--bottom-nav-item-h) + var(--safe-bottom));
  --app-shell-max: 430px;
  /* Android / Chrome : svh = hauteur visible réelle (sans barre d’adresse). */
  --app-overlay-height: 100svh;
}

/* iOS Safari : -webkit-fill-available gère correctement la barre d’adresse. */
@supports (-webkit-touch-callout: none) {
  :root {
    --app-overlay-height: -webkit-fill-available;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--body-bg);
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--body-bg);
  font-family: var(--font);
  color: var(--text);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  background: var(--body-bg);
  overflow: hidden;
}

.app.menu-enter-pending {
  opacity: 0;
  pointer-events: none;
}

.app.is-menu-opening {
  animation: menu-page-enter 300ms ease-out both;
  pointer-events: auto;
}

@keyframes menu-page-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.app.is-menu-opening .hero__banner-frame {
  animation: menu-banner-enter 400ms ease-out both;
}

@keyframes menu-banner-enter {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.app.is-menu-opening .restaurant__logo {
  animation: menu-logo-enter 350ms ease-out 80ms both;
}

@keyframes menu-logo-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 15px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.app.is-menu-opening .restaurant__content {
  animation: menu-content-enter 320ms ease-out 160ms both;
}

.app.is-menu-opening .section[aria-labelledby="categories-title"] .section__title {
  animation: menu-content-enter 280ms ease-out 220ms both;
}

@keyframes menu-content-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.app.is-menu-opening .category-pill {
  animation: menu-category-enter 300ms ease-out both;
  animation-delay: var(--menu-enter-delay, 280ms);
}

@keyframes menu-category-enter {
  from {
    opacity: 0;
    transform: translate3d(-12px, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.app.is-menu-opening .product-card {
  animation: menu-card-enter 320ms ease-out both;
  animation-delay: var(--menu-enter-delay, 360ms);
}

@keyframes menu-card-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.app.is-menu-opening .whatsapp {
  animation: menu-whatsapp-enter 350ms ease-out both;
  animation-delay: var(--menu-enter-delay, 480ms);
}

@keyframes menu-whatsapp-enter {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.page {
  min-width: 0;
  overflow-x: clip;
  padding-bottom: calc(var(--bottom-nav-h) + 0.85rem);
}

.hero {
  position: relative;
}

/* Bannière : fond neutre sans image par défaut ; photo plein cadre une fois configurée */
.hero__banner-frame {
  width: 100%;
  height: 235px;
  border-radius: 0 0 30px 30px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, #f5f6f8 0%, #e9ecef 100%);
  overflow: hidden;
  position: relative;
}

.hero__cover--photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.hero__cover--photo[hidden] {
  display: none !important;
}

.restaurant {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 0.95rem;
  align-items: start;
  padding: 0 1.2rem;
  margin-top: -38px;
  min-width: 0;
}

.restaurant__logo {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  background: var(--white);
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  box-shadow: var(--shadow-logo);
}

.restaurant__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.restaurant__logo img[hidden] {
  display: none !important;
}

.restaurant__logo.is-empty {
  border: 1px dashed rgba(17, 24, 39, 0.1);
}

.restaurant__content {
  min-width: 0;
  padding-top: 2.95rem;
  padding-bottom: 0.35rem;
  overflow-wrap: anywhere;
}

.restaurant__title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.restaurant__desc {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.section {
  --section-pad: 1rem;
  margin-top: 1.55rem;
  padding: 0 var(--section-pad);
  min-width: 0;
}

.section__title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.categories {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin-inline: calc(-1 * var(--section-pad, 1rem));
  padding: 0.1rem var(--section-pad, 1rem) 0.75rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.categories::-webkit-scrollbar {
  display: none;
}

.category-pill {
  flex: 0 0 auto;
  min-height: 2.55rem;
  padding: 0 1.05rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: #4b5563;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.category-pill:active {
  transform: scale(0.96);
}

.category-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

.products-category-title {
  grid-column: 1 / -1;
  margin: 0.25rem 0 -0.25rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.product-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 15px;
  border-radius: 25px;
  background: var(--white);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
}

.product-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__media {
  position: relative;
  margin-bottom: 0.8rem;
}

.product-card__image {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: center;
  border-radius: 20px;
}

.product-card__placeholder {
  width: 100%;
  aspect-ratio: 5 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
  border-radius: 20px;
  background: #f3f4f6;
  color: #9ca3af;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  max-width: 100%;
}

.product-card__heart,
.similar-card__heart {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition:
    color 0.3s ease,
    transform 0.3s ease,
    background 0.3s ease;
}

.product-card__heart i,
.similar-card__heart i {
  -webkit-text-stroke: 1px var(--primary);
}

.product-card__heart.is-favorite,
.similar-card__heart.is-favorite {
  color: var(--primary);
}

.product-card__heart.is-favorite i,
.similar-card__heart.is-favorite i {
  -webkit-text-stroke: 0;
}

.product-card__heart.is-bouncing,
.similar-card__heart.is-bouncing {
  animation: favoriteBeat 0.34s ease;
}

@keyframes favoriteBeat {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.24);
  }

  100% {
    transform: scale(1);
  }
}

.product-card__name {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.product-card__meta {
  height: calc(0.66rem * 1.35 * 2);
  margin: auto 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.product-card__price {
  margin: 0.28rem 0 0;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 800;
}

.product-card--no-meta .product-card__price {
  margin-top: auto;
}

.menu-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem;
  border-radius: 22px;
  background: var(--white);
  color: var(--muted);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.whatsapp {
  position: fixed;
  right: max(1rem, calc(50% - min(100%, var(--app-shell-max)) / 2 + 1rem));
  left: auto;
  bottom: max(calc(var(--bottom-nav-h) + 0.65rem), calc(var(--safe-bottom) + var(--bottom-nav-h) + 0.65rem));
  z-index: 20;
  width: 3.15rem;
  height: 3.15rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--whatsapp);
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(37, 211, 102, 0.36);
}

.whatsapp i {
  font-size: 1.65rem;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 90;
  width: min(100%, var(--app-shell-max));
  max-width: 100%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding: var(--bottom-nav-pad-top) 0.85rem calc(var(--bottom-nav-pad-bottom) + var(--safe-bottom));
  padding-left: calc(0.85rem + var(--safe-left));
  padding-right: calc(0.85rem + var(--safe-right));
  border-radius: 26px 26px 0 0;
  background: var(--white);
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.08);
}

.app:has(#product-detail:not([hidden])) .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}

.bottom-nav__item {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 6.5rem;
  min-height: var(--bottom-nav-item-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.28rem 0.35rem;
  border-radius: 999px;
  color: #9ca3af;
  text-decoration: none;
}

.bottom-nav__item i {
  font-size: 1.08rem;
  line-height: 1;
}

.bottom-nav__label {
  display: block;
  width: 100%;
  font-size: var(--bottom-nav-label-size);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.bottom-nav__icon-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.cart-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.55rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  transform: scale(1);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.cart-badge[hidden] {
  display: none !important;
}

.cart-badge--inverse {
  background: var(--white);
  color: var(--primary);
}

.cart-badge--pop {
  animation: cart-badge-pop 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cart-badge-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.28);
  }
  100% {
    transform: scale(1);
  }
}

.bottom-nav__item.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.bottom-nav__item.active .bottom-nav__label {
  font-weight: 700;
}

.cart-toast {
  position: fixed;
  left: 50%;
  bottom: max(calc(var(--bottom-nav-h) + 0.75rem), calc(var(--safe-bottom) + var(--bottom-nav-h) + 0.75rem));
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.72rem 1.05rem 0.72rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  box-shadow:
    0 12px 28px rgba(22, 163, 74, 0.35),
    0 2px 8px rgba(22, 163, 74, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(14px) scale(0.94);
  transition:
    opacity 0.32s ease,
    transform 0.38s cubic-bezier(0.22, 1.1, 0.36, 1),
    visibility 0.32s ease;
  pointer-events: none;
}

.cart-toast::before {
  content: "✓";
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.cart-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.cart-toast.is-leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(8px) scale(0.97);
  transition-duration: 0.22s;
}

.cart-toast__msg {
  min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  .cart-toast {
    transition: opacity 0.15s ease, visibility 0.15s ease;
    transform: translateX(-50%);
  }

  .cart-toast.is-visible {
    transform: translateX(-50%);
  }

  .cart-toast.is-leaving {
    transform: translateX(-50%);
  }

  .cart-badge--pop {
    animation: none;
  }

  .app.menu-enter-pending {
    opacity: 1;
    pointer-events: auto;
  }

  .app.is-menu-opening,
  .app.is-menu-opening .hero__banner-frame,
  .app.is-menu-opening .restaurant__logo,
  .app.is-menu-opening .restaurant__content,
  .app.is-menu-opening .section[aria-labelledby="categories-title"] .section__title,
  .app.is-menu-opening .category-pill,
  .app.is-menu-opening .product-card,
  .app.is-menu-opening .whatsapp {
    animation: none !important;
  }

  .product-detail.is-opening,
  .product-detail.is-opening .detail-title,
  .product-detail.is-opening .detail-price,
  .product-detail.is-opening .detail-description {
    animation: none !important;
  }

  .product-detail.is-opening {
    opacity: 1;
    transform: none;
  }

  .product-detail.is-opening .detail-title,
  .product-detail.is-opening .detail-price,
  .product-detail.is-opening .detail-description {
    opacity: 1;
    transform: none;
  }
}

.app:has(#product-detail:not([hidden])),
.app:has(#order-page:not([hidden])) {
  height: var(--app-overlay-height);
  max-height: var(--app-overlay-height);
  /* Laisse height/max-height piloter le lock overlay sans conflit min-height. */
  min-height: 0;
  overflow: hidden;
}

.app:has(#product-detail:not([hidden])) .page,
.app:has(#order-page:not([hidden])) .page {
  visibility: hidden;
}

.product-detail {
  position: absolute;
  inset: 0;
  z-index: 40;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  color: var(--text);
}

.product-detail.is-layout-prep {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  pointer-events: none;
}

.product-detail.is-opening {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  animation: product-detail-enter 300ms ease-out forwards;
}

@keyframes product-detail-enter {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.product-detail.is-opening .detail-title {
  transform: translate3d(0, 12px, 0);
  animation: detail-content-enter 280ms ease-out 70ms forwards;
}

.product-detail.is-opening .detail-price {
  transform: translate3d(0, 12px, 0);
  animation: detail-content-enter 280ms ease-out 120ms forwards;
}

.product-detail.is-opening .detail-description:not([hidden]) {
  transform: translate3d(0, 12px, 0);
  animation: detail-content-enter 280ms ease-out 170ms forwards;
}

@keyframes detail-content-enter {
  to {
    transform: translate3d(0, 0, 0);
  }
}

.product-detail__scroll {
  --detail-pad: 1.25rem;
  flex: 0 1 auto;
  min-height: 0;
  min-width: 0;
  max-height: calc(100% - var(--detail-actions-h));
  overflow-x: clip;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* Mobile : barre d'actions fixe (Safari iOS) — scroll plafonné, sans flex-grow */
@media (max-width: 47.99rem) {
  .product-detail:not([hidden]) .detail-actions {
    position: fixed;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 0;
    z-index: 45;
    width: min(100%, var(--app-shell-max));
    max-width: 100%;
  }

  .product-detail:not([hidden]) .product-detail__scroll {
    max-height: calc(100% - var(--detail-actions-h));
  }
}

.detail-back {
  position: absolute;
  top: calc(1.25rem + var(--safe-top));
  left: calc(1.15rem + var(--safe-left));
  z-index: 2;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: #111111;
  font-size: 1.2rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.detail-media {
  --detail-media-h: 240px;
  width: calc(100% - 0.75rem);
  margin: 0.35rem auto 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: var(--detail-media-h);
  height: var(--detail-media-h);
  max-height: var(--detail-media-h);
  padding: 0;
  border-radius: 22px;
  background: #eceff1;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.detail-media.is-ready {
  opacity: 1;
}

@media (min-width: 500px) and (max-width: 63.99rem) {
  .detail-media {
    --detail-media-h: 290px;
  }
}

@media (min-width: 64rem) {
  .detail-media {
    --detail-media-h: 340px;
  }
}

.detail-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  background: transparent;
}

.detail-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 1.25rem;
  border-radius: 0;
  background: transparent;
  color: #9ca3af;
  text-align: center;
  box-shadow: none;
}

.detail-image-placeholder i {
  font-size: 2rem;
  opacity: 0.7;
}

.detail-image-placeholder span {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  max-width: 14rem;
}

.detail-image[hidden],
.detail-image-placeholder[hidden] {
  display: none !important;
}

.detail-content {
  min-width: 0;
  overflow-x: clip;
  padding: 0 var(--detail-pad) 0.5rem;
}

.detail-title {
  margin: 0.15rem 0 0;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.detail-price {
  margin: 0.3rem 0 0;
  color: var(--primary);
  font-size: 1.08rem;
  font-weight: 700;
}

.detail-description {
  margin: 0.35rem 0 1.1rem;
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.45;
}

.detail-group {
  margin-top: 0.85rem;
}

.detail-group:last-of-type {
  margin-bottom: 0.25rem;
}

.detail-label {
  margin: 0 0 0.55rem;
  padding-left: 1.2rem;
  color: #5d626b;
  font-size: 0.78rem;
  font-weight: 500;
}

.size-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.size-option {
  min-height: 2.65rem;
  display: grid;
  place-items: center;
  gap: 0.15rem;
  border: 0;
  border-radius: 50px;
  background: var(--white);
  color: #1f2937;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.size-option small {
  color: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.75;
}

.size-option.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 12px 20px var(--primary-shadow);
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-left: 1.2rem;
  padding: 0.35rem 0.55rem 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f9fa;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.quantity-btn {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quantity-btn:active {
  transform: scale(0.94);
}

.quantity-btn--minus {
  background: var(--primary-soft);
  color: var(--primary);
}

.quantity-btn--plus {
  background: var(--primary);
  box-shadow: 0 8px 18px var(--primary-shadow);
}

.quantity-value {
  min-width: 1.85rem;
  color: #1f2937;
  font-size: 0.98rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.similar-section {
  margin-top: 1rem;
  margin-bottom: 0;
  padding-top: 0.65rem;
  padding-bottom: 0;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.similar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.similar-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
}

.similar-see-all {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.similar-see-all i {
  font-size: 0.62rem;
}

.similar-list {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin-inline: calc(-1 * var(--detail-pad, 1.25rem));
  padding: 0 var(--detail-pad, 1.25rem) 0.35rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  -webkit-overflow-scrolling: touch;
}

.similar-list::-webkit-scrollbar {
  height: 4px;
}

.similar-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

.similar-card {
  flex: 0 0 9.5rem;
  width: 9.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: var(--white);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  overflow: hidden;
}

.similar-card__heart {
  top: 0.4rem;
  right: 0.4rem;
  width: 1.45rem;
  height: 1.45rem;
  font-size: 0.72rem;
}

.similar-card__image {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  display: block;
}

.similar-card__placeholder {
  width: 100%;
  aspect-ratio: 5 / 4;
  display: grid;
  place-items: center;
  padding: 0.5rem;
  border-radius: 0;
  background: #f3f4f6;
  color: #9ca3af;
  font-size: 0.52rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.similar-card__placeholder span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.similar-card__price {
  padding: 0.45rem 0.55rem 0.12rem;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.similar-card__name {
  padding: 0 0.55rem 0.55rem;
  overflow: hidden;
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-actions {
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 0.7rem;
  align-items: stretch;
  padding: var(--detail-actions-pad-y) 1.15rem calc(var(--detail-actions-pad-y) + var(--safe-bottom));
  padding-left: calc(1.15rem + var(--safe-left));
  padding-right: calc(1.15rem + var(--safe-right));
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
}

.action-btn {
  position: relative;
  min-width: 0;
  width: 100%;
  min-height: 3.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-inline: 0.75rem;
  border: 0;
  border-radius: 50px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: visible;
}

.action-btn:active {
  transform: scale(0.98);
}

.action-btn span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-btn--add {
  background: var(--primary);
  color: var(--white);
  border: 0;
  box-shadow: 0 10px 22px var(--primary-shadow);
}

.action-btn--add i {
  font-size: 1.05rem;
}

.action-btn--order {
  background: #25d366;
  color: var(--white);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.35);
}

.action-btn--order i {
  font-size: 1.15rem;
  line-height: 1;
}

.order-page {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  background: var(--white);
  color: var(--text);
  overflow: hidden;
}

.order-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 4.6rem;
  padding-bottom: var(--bottom-nav-h);
  border-radius: 28px 28px 0 0;
  background: var(--white);
}

.order-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 70;
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 1.15rem;
  box-shadow: 0 12px 26px var(--primary-shadow);
  cursor: pointer;
}

.order-header {
  padding: 1.25rem 1rem;
  border-radius: 28px 28px 0 0;
  background: var(--primary);
  color: var(--white);
  text-align: center;
}

.order-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.order-instruction {
  max-width: 18rem;
  margin: 1.15rem auto 1.35rem;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.order-instruction strong {
  font-weight: 800;
}

.order-instruction span {
  color: var(--whatsapp);
  font-weight: 800;
}

.order-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 1.35rem;
  padding: 1rem 0 0.75rem;
  border-top: 2px dashed #cccccc;
  overflow-x: clip;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0;
  font-size: 0.86rem;
  font-weight: 800;
}

.order-empty {
  margin: 0;
  color: #6b7280;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.order-item__name {
  flex: 1;
  min-width: 0;
}

.order-item__controls {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
}

.order-qty-btn {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.78rem;
  cursor: pointer;
}

.order-remove-btn {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.order-remove-btn img {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
  pointer-events: none;
}

.order-item__price {
  min-width: 5.4rem;
  font-weight: 700;
  text-align: right;
}

.order-total {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 1.35rem;
  padding: 0.9rem 0;
  border-top: 2px dashed #cccccc;
  border-bottom: 2px dashed #cccccc;
  color: #6b7280;
  font-size: 1rem;
  font-weight: 700;
}

.order-total strong {
  color: #6b7280;
  font-size: 1.05rem;
  font-weight: 800;
}

.order-submit {
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: max-content;
  margin: 1.15rem auto 1.25rem;
  padding: 0 2rem;
  border: 0;
  border-radius: 50px;
  background: var(--whatsapp);
  color: var(--white);
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(37, 211, 102, 0.32);
  cursor: pointer;
  flex: 0 0 auto;
}

.order-submit i {
  font-size: 1.15rem;
  line-height: 1;
}

.order-footer {
  display: none;
}

@media (max-width: 360px) {
  .size-options {
    gap: 0.45rem;
  }

  .size-option {
    min-height: 2.35rem;
    font-size: 0.72rem;
  }

  .quantity-control {
    margin-left: 0.85rem;
  }

  .hero__banner-frame {
    height: 205px;
  }

  .restaurant {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.75rem;
    padding-inline: 0.9rem;
    margin-top: -30px;
  }

  .restaurant__logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }

  .restaurant__content {
    padding-top: 2.25rem;
  }

  .restaurant__title {
    font-size: 1.35rem;
  }

  .section {
    --section-pad: 0.8rem;
  }

  .categories {
    margin-inline: calc(-1 * var(--section-pad));
    padding-inline: var(--section-pad);
  }

  .products-grid {
    gap: 0.72rem;
  }

  .product-card {
    padding: 0.65rem;
    border-radius: 20px;
  }

  .product-card__image {
    border-radius: 16px;
  }

  .product-card__name {
    font-size: 0.78rem;
  }

  .product-card__price {
    font-size: 0.82rem;
  }

  .bottom-nav {
    padding-inline: 0.65rem;
  }

  .detail-media {
    width: calc(100% - 0.65rem);
    margin-top: 0.25rem;
    border-radius: 18px;
  }

  .product-detail__scroll {
    --detail-pad: 1rem;
  }

  .detail-content {
    padding: 0 var(--detail-pad) 0.5rem;
  }

  .similar-list {
    margin-inline: calc(-1 * var(--detail-pad));
    padding-inline: var(--detail-pad);
  }

  .detail-title {
    font-size: 1.38rem;
  }

  .detail-actions {
    gap: 0.5rem;
    padding-left: calc(0.8rem + var(--safe-left));
    padding-right: calc(0.8rem + var(--safe-right));
  }

  .action-btn {
    font-size: 0.76rem;
  }

  .order-total {
    margin-inline: 0.9rem;
  }

  .order-item {
    gap: 0.55rem;
    font-size: 0.78rem;
  }

  .order-item__price {
    min-width: 4.4rem;
  }

  .order-qty-btn {
    width: 1.5rem;
    height: 1.5rem;
  }

  .order-remove-btn {
    width: 1.75rem;
    height: 1.75rem;
  }

  .order-remove-btn img {
    width: 1rem;
    height: 1rem;
  }
}

/* =========================================================
   TABLETTE — 600px à 1023px (mobile agrandi, même design)
   ========================================================= */

@media (min-width: 37.5rem) and (max-width: 63.99rem) {
  :root {
    --app-shell-max: clamp(540px, calc(540px + (100vw - 600px) * 0.141843), 600px);
    --app-overlay-height: calc(100svh - 2rem);
  }

  body {
    display: grid;
    place-items: start center;
    padding-block: 1rem;
    min-height: 100svh;
  }

  .app {
    width: min(calc(100% - 1.25rem), var(--app-shell-max));
    min-height: calc(100svh - 2rem);
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  }

  .section {
    --section-pad: clamp(0.85rem, calc(0.8rem + (100vw - 600px) * 0.00059), 1.05rem);
  }

  .bottom-nav {
    width: min(calc(100% - 1.25rem), var(--app-shell-max));
    bottom: calc(1rem + var(--safe-bottom));
    border-radius: 26px;
  }

  .whatsapp {
    right: max(1rem, calc(50% - min(100%, var(--app-shell-max)) / 2 + 1rem));
    bottom: max(calc(var(--bottom-nav-h) + 0.85rem), calc(var(--safe-bottom) + var(--bottom-nav-h) + 0.85rem));
  }

  .product-detail,
  .order-page {
    border-radius: 28px;
  }
}

/* =========================================================
   DESKTOP — 1024px+ (app mobile centrée, style WhatsApp Web)
   ========================================================= */

@media (min-width: 64rem) {
  :root {
    --app-shell-max: clamp(460px, 480px, 500px);
    --app-overlay-height: calc(100svh - 3rem);
  }

  html {
    background: #eceff1;
  }

  body {
    display: grid;
    place-items: start center;
    padding-block: 1.5rem;
    min-height: 100svh;
    background: #eceff1;
  }

  .app {
    width: min(calc(100% - 2rem), var(--app-shell-max));
    min-height: calc(100svh - 3rem);
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  }

  .bottom-nav {
    width: min(calc(100% - 2rem), var(--app-shell-max));
    bottom: calc(1.5rem + var(--safe-bottom));
    border-radius: 26px;
  }

  .whatsapp {
    right: max(1.25rem, calc(50% - min(100%, var(--app-shell-max)) / 2 + 1.25rem));
    bottom: max(calc(var(--bottom-nav-h) + 1rem), calc(var(--safe-bottom) + var(--bottom-nav-h) + 1rem));
  }

  .product-detail {
    top: 1.5rem;
    bottom: 1.5rem;
    border-radius: 32px;
  }

  .order-page {
    top: 1.5rem;
    bottom: 1.5rem;
    height: auto;
    border-radius: 32px;
  }
}
