/* O'Miami Pizza — panier client + checkout. Palette « Italiana » (définie dans index.html). */

/* ---------- mise en page : carte + panier latéral ---------- */
.shop { width: min(1320px, 100% - 32px); margin-inline: auto; display: grid;
  grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
/* Titre au-dessus ; carte (.paper) et panier alignés sur la même ligne. */
.shop-main { display: contents; }
.shop-main > .title { grid-column: 1; grid-row: 1; }
.shop-main > .paper { grid-column: 1; grid-row: 2; }
.shop-cart { grid-column: 2; grid-row: 2; position: sticky; top: 84px; scroll-margin-top: 84px; }

.cart { background: var(--paper); border: 1px solid var(--line); border-radius: 20px;
  padding: clamp(18px, 3vw, 24px); box-shadow: 0 10px 40px rgba(60, 30, 10, .08);
  display: flex; flex-direction: column; max-height: calc(100vh - 100px); }
.cart-lines { overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 0 1 auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 4px; }
.cart-close { display: none; }
.cart-backdrop, .cart-fab { display: none; }

/* ---------- mobile / tablette : tiroir latéral + barre flottante ---------- */
@media (max-width: 1000px) {
  .shop { grid-template-columns: 1fr; width: min(1080px, 100% - 32px); }
  .shop-main > .title, .shop-main > .paper { grid-column: 1; }
  .shop-main > .paper { grid-row: auto; }
  .shop-cart { grid-column: auto; grid-row: auto; }
  .shop-cart { position: fixed; top: 0; right: 0; z-index: 40; height: 100dvh; width: min(400px, 100%);
    transform: translateX(100%); transition: transform .25s ease; visibility: hidden; }
  .cart-open .shop-cart { transform: none; visibility: visible; }
  #cart-root { height: 100%; }
  .shop-cart .cart { height: 100%; max-height: none; border-radius: 0; border: 0; }
  .cart-open .cart-fab { visibility: hidden; }
  .cart-lines { flex: 1 1 auto; }
  .cart-close { display: grid; place-content: center; width: 2.4rem; height: 2.4rem; border-radius: 10px;
    border: 1.5px solid var(--line); background: var(--bg); font-size: 1.1rem; cursor: pointer; }
  .cart-backdrop { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(35, 26, 20, .45);
    opacity: 0; pointer-events: none; transition: opacity .25s; }
  .cart-open .cart-backdrop { opacity: 1; pointer-events: auto; }
  .cart-open { overflow: hidden; }
  .cart-fab:not([hidden]) { display: flex; align-items: center; gap: .8rem; position: fixed; z-index: 30;
    left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 480px; margin-inline: auto;
    padding: .9rem 1.2rem; border: 0; border-radius: 14px; background: var(--green); color: #fff;
    font: 600 1.05rem Inter, sans-serif; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); cursor: pointer; }
  .cart-fab .fab-n { background: #fff; color: var(--green); border-radius: 99px; min-width: 1.7rem; height: 1.7rem;
    padding: 0 .45rem; display: grid; place-content: center; font-weight: 700; font-size: .9rem; }
  .cart-fab .fab-total { margin-left: auto; font-family: Fraunces, serif; font-weight: 800; }
  .cart-fab.bump { animation: bump .35s ease; }
  body:has(.cart-fab:not([hidden])) footer { padding-bottom: 96px; }
}
@keyframes bump { 50% { transform: scale(1.04); } }
.cart-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; flex: 0 0 auto; }
.cart-head h2 { font-size: 1.6rem; }
.cart-badge { margin-left: auto; min-width: 1.8rem; height: 1.8rem; padding: 0 .5rem; border-radius: 99px;
  background: var(--red); color: #fff; font-weight: 700; display: grid; place-content: center; font-size: .95rem; }
.cart-empty { color: var(--mute); font-style: italic; padding: .6rem 0 1rem; }
.menu-error { color: var(--red); text-align: center; padding: 2rem 0; }

.cart-lines { list-style: none; padding: 0; margin: 0; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .3rem .7rem;
  padding: .7rem 0; border-bottom: 1px dotted #cbbd9f; }
.cl-info { display: flex; flex-direction: column; }
.cl-name { font-weight: 600; }
.cl-unit { color: var(--mute); font-size: .82rem; }
.cl-qty { display: flex; align-items: center; gap: .4rem; }
.cl-qty button { width: 2rem; height: 2rem; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--bg); font-size: 1.2rem; font-weight: 700; cursor: pointer; line-height: 1; }
.cl-qty button:hover { border-color: var(--red); color: var(--red); }
.cl-qty span { min-width: 1.4rem; text-align: center; font-weight: 600; }
.cl-sum { font-weight: 700; min-width: 3.2rem; text-align: right; white-space: nowrap; }

.cart-type { display: flex; gap: .4rem; margin: 1.2rem 0 .8rem; }
.cart-type button { flex: 1; padding: .6rem .3rem; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--bg); font-weight: 600; cursor: pointer; font-size: .92rem; }
.cart-type button.on { border-color: var(--red); background: var(--red); color: #fff; }
.cart-type button:disabled { opacity: .5; cursor: not-allowed; line-height: 1.15; }
.cart-type button small { display: block; font-size: .7rem; font-weight: 500; }

.cart-total { display: flex; justify-content: space-between; align-items: baseline;
  padding-top: .9rem; margin-top: .3rem; border-top: 2px solid var(--ink); font-size: 1.15rem; }
.cart-total strong { font-size: 1.6rem; color: var(--red); font-family: Fraunces, serif; }

.cart-validate { width: 100%; margin-top: 1rem; padding: .95rem; border: 0; border-radius: 12px;
  background: var(--green); color: #fff; font: 600 1.1rem Inter, sans-serif; cursor: pointer; }
.cart-validate:disabled { background: var(--line); color: var(--mute); cursor: not-allowed; }
.cart-hint { flex: 0 0 auto; margin: 0 0 .6rem; font-size: .85rem; color: var(--mute); }
.cart-offer { flex: 0 0 auto; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: .5rem .7rem; margin-bottom: .4rem; border-radius: 10px; background: #e9f2ea; color: var(--green); font-size: .9rem; }
.cart-offer strong { white-space: nowrap; }
.co-zone { margin: -.3rem 0 .7rem; font-size: .82rem; color: var(--mute); }
.cart-closed { flex: 0 0 auto; margin-top: .9rem; padding: .6rem .8rem; border-radius: 10px;
  background: #fdeecf; color: #8a6413; font-size: .9rem; text-align: center; }
.cl-qty button:disabled { opacity: .35; cursor: not-allowed; }
.cart-validate:not(:disabled):hover { transform: translateY(-1px); }

/* ---------- overlays (sélecteur / checkout / confirmation) ---------- */
.picker-ov { position: fixed; inset: 0; background: rgba(35, 26, 20, .55); z-index: 50;
  display: grid; place-items: center; padding: 20px; }
.picker, .checkout { background: var(--paper); border-radius: 18px; padding: 24px; width: min(440px, 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3); max-height: 90vh; overflow: auto; }
.picker h3, .checkout h3 { font-size: 1.5rem; margin-bottom: 1rem; text-align: center; }
.picker-msg { text-align: center; margin-bottom: 1rem; line-height: 1.4; }
.picker-opts { display: grid; gap: .5rem; }
.picker-opts button { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem 1.1rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg);
  font: 600 1.05rem Inter, sans-serif; cursor: pointer; }
.picker-opts button:hover { border-color: var(--red); }
.picker-opts strong { color: var(--red); }
.picker-cancel { margin-top: 1rem; width: 100%; padding: .7rem; border: 0; border-radius: 10px;
  background: var(--line); color: var(--ink); font-weight: 600; cursor: pointer; }

/* checkout form */
.co-type { text-align: center; color: var(--mute); margin-bottom: 1rem; }
.co-type strong { color: var(--red); }
.co-error { background: #fbe4e0; color: var(--red); padding: .6rem .8rem; border-radius: 10px; margin-bottom: .8rem; font-size: .9rem; }
.checkout label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .7rem; }
.checkout input { display: block; width: 100%; margin-top: .3rem; padding: .7rem .8rem; border: 1.5px solid var(--line);
  border-radius: 10px; font: 400 1rem Inter, sans-serif; background: var(--bg); }
.checkout input:focus { outline: 2px solid var(--red); border-color: var(--red); }
.checkout input.is-invalid, .checkout input.is-invalid:focus { border-color: var(--red); outline-color: var(--red); background: #fdf1ee; }
.checkout input.is-valid, .checkout input.is-valid:focus { border-color: var(--green); outline-color: var(--green); }
.co-hint { display: block; margin-top: .3rem; font-weight: 500; font-size: .78rem; color: var(--mute); }
.co-hint.bad { color: var(--red); }
.co-hint.ok { color: var(--green); }
.co-pay button:disabled { cursor: not-allowed; }
.co-pay { display: flex; gap: .6rem; margin: 1.2rem 0 .4rem; }
.co-pay button { flex: 1; padding: .85rem .4rem; border-radius: 12px; border: 0; font: 600 1rem Inter, sans-serif; cursor: pointer; }
.co-pay button:disabled { opacity: .5; cursor: wait; }
.co-online { background: var(--red); color: #fff; }


.add { transition: background .15s, color .15s; }
.add:hover { background: var(--red); color: #fff; }

/* lien vers la page de suivi de la dernière commande */
.cart-track { display: block; margin-bottom: .9rem; padding: .7rem .9rem; border-radius: 12px; background: #e8f3ec; color: var(--green); font-weight: 600; text-decoration: none; text-align: center; }
.cart-track:hover { background: #dcecE2; }

.co-legal { margin: .2rem 0 .6rem; font-size: .75rem; line-height: 1.4; color: var(--mute); text-align: center; }
.co-legal a { color: var(--mute); }
