/* =========================================================
   Page de commande — La Napolitaine
   Même univers que l'accueil (tokens de style.css), codes des grandes enseignes :
   grande photo par produit, barre de catégories collante, panier toujours visible.
   ========================================================= */

html:has(body.page-order) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:has(body.page-order) { scroll-behavior: auto; } }
.page-order { background: var(--creme); }
.page-order .grain { opacity: .05; }

/* ---------- En-tête ---------- */
.o-header { background: rgba(20, 16, 13, .94); }
.o-header__title { font-family: var(--f-display); font-size: 1.15rem; color: var(--or); letter-spacing: .02em; }
.o-back { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .9rem; opacity: .85; transition: opacity .3s; }
.o-back svg { width: 1.1em; height: 1.1em; }
.o-back:hover { opacity: 1; }
.o-cartbtn { display: inline-flex; align-items: center; gap: .6rem; padding: .5rem .9rem .5rem .8rem; border-radius: 99px; background: var(--rosso); color: #fff; font-weight: 800; font-size: .92rem; transition: transform .3s var(--ease), background .3s; }
.o-cartbtn:hover { transform: translateY(-2px); background: var(--rosso-glow); }
.o-cartbtn svg { width: 20px; height: 20px; }
.o-cartbtn__n { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border-radius: 99px; background: var(--creme); color: var(--rosso-deep); font-size: .82rem; }
.o-cartbtn.is-bump { animation: bump .5s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* ---------- Bandeau ---------- */
.o-hero { position: relative; overflow: hidden; background: var(--four); color: var(--creme); padding: calc(var(--header-h) + clamp(2.5rem, 6vw, 4.5rem)) var(--gut) 0; isolation: isolate; }
.o-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 90% at 85% 10%, rgba(193, 18, 31, .55), transparent 65%), radial-gradient(60% 80% at 0% 100%, rgba(227, 163, 59, .18), transparent 60%); }
.o-hero { display: flex; flex-direction: column; }
.o-hero__in { order: 1; }
.o-hero__reel { order: 2; }
.o-hero__in { position: relative; display: grid; gap: 1rem; max-width: 900px; padding-bottom: clamp(2rem, 4vw, 3rem); }
.o-hero__in .eyebrow { margin-bottom: 0; }
.o-hero h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(3rem, 8.5vw, 7.4rem); line-height: .92; letter-spacing: -.015em; }
.o-hero__p { max-width: 52ch; font-size: clamp(1rem, 1.4vw, 1.2rem); opacity: .9; }
.o-perks { display: flex; flex-wrap: wrap; gap: .5rem; }
.o-perks li { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .95rem; border-radius: 99px; background: rgba(245, 233, 211, .1); border: 1px solid rgba(245, 233, 211, .22); font-weight: 700; font-size: .88rem; }
.o-perks svg { width: 1.2em; height: 1.2em; color: var(--or); }
.o-hero .chip { justify-self: start; }
.o-hero__reel { position: relative; height: 128px; overflow: hidden; margin: 0 calc(var(--gut) * -1); -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.o-hero__track { display: flex; gap: 1rem; width: max-content; padding: 0 .5rem 0 0; animation: reel 70s linear infinite; }
.o-hero__track img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(245, 233, 211, .85); flex: none; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); }
.o-hero__track img:nth-child(even) { transform: translateY(12px); }
@keyframes reel { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- Barre collante ---------- */
.o-bar { position: sticky; top: var(--header-h); z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: .8rem 1.5rem; flex-wrap: wrap; padding: .75rem var(--gut); background: rgba(245, 233, 211, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(20, 16, 13, .14); }
.o-cats { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.o-cats::-webkit-scrollbar { display: none; }
.o-cats a { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-radius: 99px; border: 2px solid transparent; font-weight: 800; font-size: .95rem; white-space: nowrap; transition: background .3s, color .3s, border-color .3s; }
.o-cats a span { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; border-radius: 99px; background: rgba(20, 16, 13, .1); font-size: .78rem; }
.o-cats a:hover { border-color: var(--ink); }
.o-cats a.is-on { background: var(--ink); color: var(--creme); }
.o-cats a.is-on span { background: var(--rosso); color: #fff; }
.o-tools { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: clamp(1.4rem, 3vw, 2.2rem); }
.o-diet { display: flex; gap: .3rem; padding: .25rem; border-radius: 99px; background: rgba(20, 16, 13, .08); }
.o-diet button { padding: .4rem .85rem; border-radius: 99px; font-weight: 800; font-size: .84rem; transition: background .3s, color .3s; }
.o-diet button.is-on { background: var(--rosso); color: #fff; }
.o-search { position: relative; display: block; }
.o-search svg { position: absolute; left: .9rem; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: #6a5848; pointer-events: none; }
.o-search input { width: min(280px, 60vw); font: inherit; font-size: .92rem; padding: .6rem 1rem .6rem 2.6rem; border-radius: 99px; border: 2px solid rgba(20, 16, 13, .18); background: #fffaf0; color: var(--ink); transition: border-color .25s, box-shadow .25s; }
.o-search input:focus { outline: none; border-color: var(--rosso); box-shadow: 0 0 0 4px rgba(193, 18, 31, .14); }

/* ---------- Mise en page ---------- */
.o-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: clamp(1.4rem, 3vw, 2.6rem); align-items: start; max-width: 1640px; margin: 0 auto; padding: clamp(1.6rem, 3vw, 2.6rem) var(--gut) clamp(3rem, 6vw, 5rem); }
.o-sec { scroll-margin-top: calc(var(--header-h) + 5.5rem); margin-bottom: clamp(2.4rem, 5vw, 4rem); }
.o-sec[hidden] { display: none; }
.o-sec__h { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.o-sec__h h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; }
.o-sec__h p { color: #5b4a3d; font-weight: 600; }
.o-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: clamp(1rem, 1.8vw, 1.5rem); }
.o-grid--small { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
.o-empty { padding: 3rem 1rem; text-align: center; font-weight: 700; font-size: 1.1rem; }
.o-fine { max-width: 70ch; }

/* ---------- Carte produit ---------- */
.o-card { position: relative; display: flex; flex-direction: column; background: #FFFBF1; border-radius: 26px; overflow: hidden; box-shadow: 0 10px 30px rgba(80, 40, 10, .12); transition: transform .5s var(--ease), box-shadow .5s var(--ease), opacity .8s var(--ease); }
.o-card[hidden] { display: none; }
.js .o-card:not(.is-in) { opacity: 0; transform: translateY(28px); transition-delay: calc(var(--d, 0) * 70ms); }
.o-card:hover { transform: translateY(-6px); box-shadow: 0 22px 50px rgba(80, 40, 10, .2); }
.o-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--creme-2); }
.o-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.o-card:hover .o-card__media img { transform: scale(1.08); }
.o-card__art { display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(circle, #f6e7c8, #e4cfa4); }
.o-card__art svg { width: 62%; }
.o-badge { position: absolute; left: .8rem; top: .8rem; padding: .3em .8em; border-radius: 99px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--basilic); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.o-badge--poisson { background: #1F5A7A; }
.o-qty { position: absolute; right: .8rem; top: .8rem; min-width: 2.2rem; height: 2.2rem; padding: 0 .6rem; border-radius: 99px; display: inline-grid; place-items: center; background: var(--rosso); color: #fff; font-weight: 800; box-shadow: 0 6px 16px rgba(193, 18, 31, .5); transform: scale(0); transition: transform .45s var(--ease); }
.o-qty.is-on { transform: scale(1); }
.o-card__body { display: flex; flex-direction: column; gap: .45rem; padding: 1.05rem 1.1rem 1.15rem; flex: 1; }
.o-card__name { font-family: var(--f-display); font-weight: 400; font-size: 1.55rem; line-height: 1.05; }
.o-card__ing { font-size: .86rem; line-height: 1.45; color: #5b4a3d; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.75em; }
.o-card__buy { margin-top: auto; padding-top: .7rem; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.o-add { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .5rem .5rem .95rem; border-radius: 99px; border: 2px solid var(--ink); text-align: left; transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease); }
.o-add__t { display: grid; line-height: 1.15; }
.o-add__t small { font-size: .72rem; font-weight: 700; opacity: .75; }
.o-add__t b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.o-add svg { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--rosso); color: #fff; flex: none; transition: transform .4s var(--ease), background .3s, color .3s; }
.o-add:hover, .o-add:focus-visible { background: var(--rosso); border-color: var(--rosso); color: #fff; }
.o-add:hover svg { background: #fff; color: var(--rosso); transform: rotate(90deg); }
.o-add:active { transform: scale(.96); }
.o-add.is-pop { animation: pop .5s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.o-card--solo .o-card__buy { grid-template-columns: 1fr; }
.o-card--solo .o-card__name { font-size: 1.35rem; }
.o-card--solo .o-card__ing { min-height: 0; -webkit-line-clamp: 2; }
.o-card--solo .o-card__media { aspect-ratio: 16 / 11; }
.o-fly { position: fixed; z-index: 400; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); pointer-events: none; }

/* ---------- Panier ---------- */
.o-cart { position: sticky; top: calc(var(--header-h) + 5.2rem); display: flex; flex-direction: column; max-height: calc(100dvh - var(--header-h) - 6.4rem); background: var(--four); color: var(--creme); border-radius: 30px; box-shadow: 0 30px 70px rgba(20, 10, 4, .35); overflow: hidden; }
.o-cart__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem .9rem; border-bottom: 1px solid rgba(245, 233, 211, .14); }
.o-cart__head h2 { display: flex; align-items: center; gap: .7rem; font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; }
.o-cart__n { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.9rem; padding: 0 .5rem; border-radius: 99px; background: var(--rosso); font-family: var(--f-body); font-weight: 800; font-size: .9rem; }
.o-cart__x { display: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(245, 233, 211, .4); place-items: center; }
.o-cart__x svg { width: 20px; height: 20px; }
.o-cart__body { flex: 1; overflow-y: auto; padding: .4rem 1.4rem 1rem; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rosso) transparent; min-height: 150px; }
.o-cart__empty { display: grid; justify-items: center; gap: .3rem; padding: 2.2rem 0; text-align: center; font-weight: 700; opacity: .9; }
.o-cart__empty span { font-size: 2.6rem; filter: grayscale(.2); }
.o-cart__empty small { font-weight: 500; opacity: .7; }
.o-cart__empty[hidden] { display: none; }
.o-lines { display: grid; }
.o-line { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: .15rem .85rem; align-items: center; padding: .85rem 0; border-bottom: 1px dashed rgba(245, 233, 211, .2); }
.o-line img { grid-row: span 2; width: 54px; height: 54px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(245, 233, 211, .5); }
.o-line__n { font-weight: 800; line-height: 1.2; }
.o-line__n small { display: block; font-weight: 500; font-size: .76rem; opacity: .65; }
.o-line__p { font-weight: 800; font-variant-numeric: tabular-nums; }
.o-line .stepper { grid-column: 2 / 4; justify-self: start; border-color: rgba(245, 233, 211, .5); background: transparent; color: var(--creme); }
.o-line .stepper.has-qty { border-color: var(--or); background: transparent; }
.o-line .stepper button:hover:not(:disabled) { background: var(--rosso); color: #fff; }
.o-upsell { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid rgba(245, 233, 211, .14); }
.o-upsell[hidden] { display: none; }
.o-upsell h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.25rem; margin-bottom: .6rem; color: var(--or); }
.o-upsell__list { display: grid; gap: .5rem; }
.o-up { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .4rem .5rem .4rem .4rem; border-radius: 16px; background: rgba(245, 233, 211, .08); text-align: left; transition: background .3s; }
.o-up:hover { background: rgba(245, 233, 211, .16); }
.o-up img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.o-up b { display: block; font-size: .9rem; line-height: 1.2; }
.o-up small { opacity: .7; font-size: .78rem; }
.o-up svg { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--rosso); color: #fff; }
.o-cart__foot { padding: 1rem 1.4rem 1.3rem; border-top: 1px solid rgba(245, 233, 211, .14); display: grid; gap: .8rem; background: var(--four-2); }
.o-total div { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--f-display); font-size: 2rem; line-height: 1; }
.o-cart__foot .fine { color: rgba(245, 233, 211, .65); margin-top: 0; font-size: .78rem; }
.o-cart__foot .btn[disabled] { opacity: .4; pointer-events: none; }
.o-cart__foot .btn--red .btn__fill { background: var(--creme); }
.o-scrim { position: fixed; inset: 0; z-index: 140; background: rgba(10, 8, 6, .6); opacity: 0; pointer-events: none; transition: opacity .4s; }
.o-scrim.is-on { opacity: 1; pointer-events: auto; }
.o-barmob { display: none; position: fixed; left: .8rem; right: .8rem; bottom: calc(.8rem + env(safe-area-inset-bottom)); z-index: 130; }
.o-barmob button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; padding: .85rem 1.2rem .85rem .9rem; border-radius: 99px; background: var(--rosso); color: #fff; font-weight: 800; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); text-align: center; }
.o-barmob__n { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; border-radius: 99px; background: var(--creme); color: var(--rosso-deep); font-size: .88rem; }
.o-barmob[hidden] { display: none !important; }
.o-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.4rem var(--gut) 2rem; background: var(--four); color: var(--creme); font-size: .9rem; }
.o-footer a { text-decoration: underline; text-underline-offset: .2em; }

/* ---------- Finalisation ---------- */
.co { position: fixed; inset: 0; z-index: 240; display: grid; place-items: center; padding: 1rem; background: rgba(10, 8, 6, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.co[hidden] { display: none; }
.co__panel { width: min(1080px, 100%); max-height: calc(100dvh - 2rem); overflow-y: auto; background: var(--creme); border-radius: 34px; padding: clamp(1.2rem, 3vw, 2.2rem); overscroll-behavior: contain; box-shadow: 0 40px 100px rgba(0, 0, 0, .5); }
.co__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.co__head h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1; }
.co__x { color: var(--ink); border-color: var(--ink); }
.co__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(1rem, 2.5vw, 2rem); align-items: start; }
.co .panel { background: #FFFBF1; margin-bottom: 1.1rem; }
.co__recap { position: sticky; top: 0; }
.co .ticket { filter: drop-shadow(0 18px 30px rgba(80, 40, 10, .25)); background: #fff; }
.co .ticket::after { background: linear-gradient(-45deg, transparent 8px, #fff 0) 0 0 / 20px 14px, linear-gradient(45deg, transparent 8px, #fff 0) 0 0 / 20px 14px; background-repeat: repeat-x; }
.co .ticket__lines { max-height: 240px; }
.modes--photo { grid-template-columns: repeat(3, 1fr); }
.mode--photo span { position: relative; min-height: 138px; align-content: end; justify-items: start; padding: .9rem; color: var(--creme); border-color: transparent; background: linear-gradient(0deg, rgba(20, 16, 13, .88), rgba(20, 16, 13, .1) 72%), var(--bg) center / cover; overflow: hidden; }
.mode--photo span b { font-size: 1.02rem; }
.mode--photo span small { opacity: .9; }
.mode--photo input:checked + span { background: linear-gradient(0deg, rgba(142, 14, 25, .92), rgba(20, 16, 13, .12) 72%), var(--bg) center / cover; border-color: var(--rosso); box-shadow: 0 0 0 4px rgba(193, 18, 31, .3); }
.mode--photo input:checked + span::after { content: ''; position: absolute; top: .6rem; right: .6rem; width: 26px; height: 26px; border-radius: 50%; background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23C1121F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 70% no-repeat; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .o-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1000px) {
  .o-layout { grid-template-columns: 1fr; }
  .o-header__title { display: none; }
  .o-cart { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 88dvh; border-radius: 30px 30px 0 0; z-index: 150; transform: translateY(105%); visibility: hidden; transition: transform .55s var(--ease), visibility 0s .55s; }
  .o-cart.is-open { transform: translateY(0); visibility: visible; transition: transform .55s var(--ease), visibility 0s; }
  .o-cart__x { display: grid; }
  .o-barmob { display: block; }
  .page-order { padding-bottom: 5.5rem; }
  .o-cartbtn { display: none; }
  .co__grid { grid-template-columns: 1fr; }
  .co__recap { position: static; }
}
@media (max-width: 820px) {
  .header-tel { display: none; }
  .o-bar { padding: .5rem var(--gut); }
  .o-tools { flex-direction: column; align-items: stretch; }
  .o-search input { width: 100%; }
  .o-diet { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .o-diet button { white-space: nowrap; }
  .o-sec { scroll-margin-top: calc(var(--header-h) + 4.4rem); }
  .o-hero__reel { height: 100px; }
  .o-hero__track img { width: 86px; height: 86px; }
  .modes--photo { grid-template-columns: 1fr; }
  .mode--photo span { min-height: 96px; }
  .co { padding: 0; place-items: stretch; }
  .co__panel { max-height: 100dvh; height: 100dvh; border-radius: 0; }
}
@media (max-width: 520px) {
  .o-grid { grid-template-columns: 1fr; }
  .o-grid--small { grid-template-columns: 1fr 1fr; }
  .o-card--solo .o-card__body { padding: .8rem; }
  .o-card--solo .o-card__name { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .o-hero__track { animation: none; }
  .js .o-card:not(.is-in) { opacity: 1; transform: none; }
}
