/* ==================================================================
   Joy — "طراحی پیتزای دلخواه خودتان" (Design Your Own Pizza)
   Front-end styles. Reuses the site's design tokens (--orange,
   --menu-bg, --card-bg ...) defined on :root in joy-menu.html.
   All selectors are namespaced .joy-pz- / #joy* to avoid clashes.
   ================================================================== */

:root{
  --jpz-orange: var(--orange, #e07b39);
  --jpz-orange-bright: var(--orange-bright, #ff9d4d);
  --jpz-bg: var(--menu-bg, #0d1322);
  --jpz-bg2: var(--menu-bg2, #11182a);
  --jpz-card: var(--card-bg, #161d2e);
  --jpz-card2: var(--card-bg2, #1a2236);
  --jpz-text: var(--card-text, #eef2fb);
  --jpz-sub: var(--card-sub, #9aa6c0);
  --jpz-line: rgba(255,157,77,0.18);
}

/* ───────────────────────── 3D FLOATING BUTTON ───────────────────────── */
/* Replaces the old phone-fab in the same bottom-right slot. */
.joy-pz-fab{
  position: fixed;
  bottom: 28px; right: 20px;
  z-index: 420;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 16px; max-width: 190px; line-height: 1.22; text-align: center;
  border: none; cursor: pointer;
  border-radius: 40px;
  font-family: "Tabliq", "Vazirmatn", sans-serif;
  font-size: 0.66rem; font-weight: 700;
  color: #fff; text-decoration: none; white-space: normal;
  background: linear-gradient(135deg, #ffb05e 0%, var(--jpz-orange) 52%, #c85f24 100%);
  box-shadow:
    0 10px 22px rgba(224,123,57,0.45),
    0 3px 8px rgba(0,0,0,0.35),
    inset 0 2px 0 rgba(255,255,255,0.45),
    inset 0 -3px 6px rgba(150,60,15,0.5);
  transform: translateY(0) perspective(600px) rotateX(0deg);
  transition: transform 0.22s cubic-bezier(0.34,1.4,0.64,1), box-shadow 0.22s;
  animation: joyFabFloat 4.5s ease-in-out infinite;
}
.joy-pz-fab:hover{
  transform: translateY(-3px) perspective(600px) rotateX(8deg) scale(1.04);
  box-shadow:
    0 16px 32px rgba(224,123,57,0.55),
    0 5px 12px rgba(0,0,0,0.4),
    inset 0 2px 0 rgba(255,255,255,0.55),
    inset 0 -3px 6px rgba(150,60,15,0.55);
}
.joy-pz-fab:active{ transform: translateY(1px) scale(0.98); }
.joy-pz-fab .joy-pz-fab-ico{
  width: 26px; height: 26px; flex-shrink: 0;
  filter: drop-shadow(0 2px 2px rgba(120,50,10,0.5));
  animation: joyFabSpin 9s linear infinite;
}
@keyframes joyFabFloat{ 0%,100%{ margin-bottom:0 } 50%{ margin-bottom:5px } }
@keyframes joyFabSpin{ to{ transform: rotate(360deg) } }
@media (max-width: 420px){
  .joy-pz-fab{ font-size: 0.6rem; padding: 10px 13px; gap: 6px; bottom: 22px; right: 12px; max-width: 172px; }
  .joy-pz-fab .joy-pz-fab-ico{ width: 21px; height: 21px; }
}
@media (prefers-reduced-motion: reduce){
  .joy-pz-fab, .joy-pz-fab .joy-pz-fab-ico{ animation: none; }
}

/* ───────────────────────── FAVORITES STAR (hero top bar) ───────────────────────── */
.joy-pz-star{
  width: 30px; height: 30px; padding: 0; cursor: pointer;
  background: none; border: none;
  display: inline-flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35));
  transition: transform 0.18s, opacity 0.18s;
}
.joy-pz-star svg{ width: 26px; height: 26px; }
.joy-pz-star:hover{ transform: scale(1.14) rotate(-6deg); }
.joy-pz-star:active{ transform: scale(0.92); }
.joy-pz-star .joy-star-fill{ transition: fill 0.25s; }

/* ───────────────────────── FULL-SCREEN OVERLAYS (designer / favorites) ───────────────────────── */
.joy-pz-screen{
  position: fixed; inset: 0; z-index: 900;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(224,123,57,0.12), transparent 55%),
    radial-gradient(120% 80% at 10% 100%, rgba(99,102,241,0.10), transparent 55%),
    linear-gradient(160deg, var(--jpz-bg) 0%, var(--jpz-bg2) 60%, #0a0f1c 100%);
  color: var(--jpz-text);
  direction: rtl;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateY(28px) scale(0.985);
  transition: opacity 0.42s ease, transform 0.42s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
}
.joy-pz-screen.open{ opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }

/* header */
.joy-pz-head{
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--jpz-line);
  background: linear-gradient(180deg, rgba(0,0,0,0.18), transparent);
  backdrop-filter: blur(6px);
}
.joy-pz-back{
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid var(--jpz-line);
  color: var(--jpz-text); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s, transform 0.18s;
}
.joy-pz-back:hover{ background: rgba(255,157,77,0.16); transform: scale(1.06); }
.joy-pz-title{ flex: 1; min-width: 0; }
.joy-pz-kicker{
  display:block;
  margin-bottom: 5px;
  color: rgba(255,255,255,0.46);
  font-family: "Fredoka","Vazirmatn",sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.joy-pz-title h2{
  font-family: "Tabliq","Vazirmatn",sans-serif; font-weight: 700;
  font-size: 1.3rem; line-height: 1.15; margin: 0;
  color: #fff3e6;
  text-shadow: 0 8px 20px rgba(0,0,0,0.28);
}
.joy-pz-title p{
  font-family: "Tabliq","Vazirmatn",sans-serif;
  font-size: 0.82rem; color: rgba(255,255,255,0.68); margin: 6px 0 0;
}

/* body layout: pizza stage + palette */
.joy-pz-body{
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.joy-pz-stage{
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 16px 6px;
}

/* rotating pizza */
.joy-pz-pizza-wrap{
  position: relative; width: min(74vw, 340px); aspect-ratio: 1/1;
  filter: drop-shadow(0 26px 30px rgba(0,0,0,0.55));
}
.joy-pz-pizza-wrap svg{ width: 100%; height: 100%; display: block; overflow: visible; }
#joyPizzaSpin{
  transform-box: fill-box; transform-origin: center;
  animation: joyPizzaSpin 26s linear infinite;
  will-change: transform;
}
@keyframes joyPizzaSpin{ to{ transform: rotate(360deg) } }
.joy-pz-pizza-wrap.is-detroit #joyPizzaSpin{
  animation: joyDetroitShake 4.2s ease-in-out infinite;
  transform-origin: center;
}
@keyframes joyDetroitShake{
  0%,100%{ transform: rotate(0deg) translateY(0); }
  18%{ transform: rotate(-1.2deg) translate(-2px, 1px); }
  36%{ transform: rotate(1deg) translate(2px, -1px); }
  54%{ transform: rotate(-0.8deg) translate(-1px, 1px); }
  72%{ transform: rotate(0.9deg) translate(1px, -1px); }
}
.joy-pz-pizza-wrap:hover #joyPizzaSpin{ animation-play-state: paused; }
@media (prefers-reduced-motion: reduce){ #joyPizzaSpin{ animation: none; } }

/* topping piece enter animation (position is on the outer <g> attribute) */
.joy-pz-piece-in{
  transform-box: fill-box; transform-origin: center;
  animation: joyPieceIn 0.5s cubic-bezier(0.34,1.5,0.55,1) both;
}
@keyframes joyPieceIn{ from{ opacity:0; transform: scale(0.15) } to{ opacity:1; transform: scale(1) } }
.joy-pz-piece-out{ animation: joyPieceOut 0.3s ease forwards; transform-box: fill-box; transform-origin: center; }
@keyframes joyPieceOut{ to{ opacity:0; transform: scale(0.2) } }

/* live total */
.joy-pz-total{
  margin: 12px 0 2px; text-align: center;
}
.joy-pz-total-off{
  min-width: 86px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,157,77,0.14);
}
.joy-pz-total .lbl{ font-size: 0.72rem; color: var(--jpz-sub); display:block; margin-bottom:2px;}
.joy-pz-total .amt{
  font-family: "Tabliq","Vazirmatn",sans-serif; font-weight: 700;
  font-size: 1rem; color: #ffd5b5;
  transition: transform 0.2s; display: inline-block;
}
.joy-pz-total .amt.bump{ transform: scale(1.16); }
.joy-pz-total .cur{ display:block; margin:2px 0 0; font-size: 0.67rem; color: rgba(255,255,255,0.52); font-weight:600; }

/* palette */
.joy-pz-palette{ padding: 8px 14px 26px; }
.joy-pz-tabs{
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px;
  scrollbar-width: none; justify-content: flex-start;
}
.joy-pz-tabs::-webkit-scrollbar{ display: none; }
.joy-pz-tab{
  flex: 0 0 auto; padding: 8px 16px; border-radius: 30px; cursor: pointer;
  font-family: "Vazirmatn",sans-serif; font-size: 0.82rem; font-weight: 600;
  background: var(--jpz-card); color: var(--jpz-sub);
  border: 1px solid transparent; transition: all 0.2s; white-space: nowrap;
}
.joy-pz-tab.active{
  background: linear-gradient(135deg, var(--jpz-orange-bright), var(--jpz-orange));
  color: #fff; box-shadow: 0 4px 14px rgba(224,123,57,0.35);
}
.joy-pz-grid{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px,1fr));
  gap: 10px;
}
.joy-pz-chip{
  position: relative; cursor: pointer; user-select: none;
  background: var(--jpz-card); border: 1.5px solid rgba(255,255,255,0.06);
  border-radius: 16px; padding: 10px 8px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform 0.16s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.joy-pz-chip:hover{ transform: translateY(-2px); border-color: var(--jpz-line); }
.joy-pz-chip.sel{
  border-color: var(--jpz-orange-bright);
  background: linear-gradient(180deg, rgba(255,157,77,0.14), var(--jpz-card));
  box-shadow: 0 8px 22px rgba(224,123,57,0.22);
}
.joy-pz-chip .ico{ width: 46px; height: 46px; pointer-events: none; }
.joy-pz-chip .ico svg{ width: 100%; height: 100%; display:block; }
.joy-pz-chip .nm{ font-size: 0.74rem; font-weight: 600; text-align: center; line-height: 1.2; color: var(--jpz-text); }
.joy-pz-chip .pr{ font-size: 0.68rem; color: var(--jpz-sub); }
.joy-pz-chip.sel .pr{ color: var(--jpz-orange-bright); font-weight: 700; }
.joy-pz-opt-pr, .joy-pz-chip .pr{ display:none !important; }
.joy-pz-chip .tick{
  position: absolute; top: 6px; left: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--jpz-orange-bright); color: #fff;
  display: none; align-items: center; justify-content: center; font-size: 11px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.joy-pz-chip.sel .tick{ display: flex; }
.joy-pz-hint{ font-size: 0.72rem; color: var(--jpz-sub); padding: 2px 4px 12px; }

/* footer actions */
.joy-pz-foot{
  flex-shrink: 0; display: flex; gap: 10px; padding: 12px 16px;
  border-top: 1px solid var(--jpz-line);
  background: linear-gradient(0deg, rgba(0,0,0,0.28), transparent);
  backdrop-filter: blur(8px);
}
.joy-pz-btn{
  flex: 1; padding: 13px 14px; border-radius: 14px; cursor: pointer;
  font-family: "Vazirmatn",sans-serif; font-size: 0.9rem; font-weight: 700;
  border: none; transition: transform 0.15s, filter 0.2s, box-shadow 0.2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.joy-pz-btn:active{ transform: scale(0.97); }
.joy-pz-btn.ghost{ flex: 0 0 auto; background: rgba(255,255,255,0.07); color: var(--jpz-text); border: 1px solid var(--jpz-line); }
.joy-pz-btn.ghost:hover{ background: rgba(255,255,255,0.13); }
.joy-pz-btn.save{ background: rgba(255,255,255,0.1); color: var(--jpz-text); border: 1px solid var(--jpz-line); }
.joy-pz-btn.save:hover{ filter: brightness(1.15); }
.joy-pz-btn.order{
  background: linear-gradient(135deg, var(--jpz-orange-bright), var(--jpz-orange));
  color: #fff; box-shadow: 0 8px 22px rgba(224,123,57,0.4);
}
.joy-pz-btn.order:hover{ filter: brightness(1.08); box-shadow: 0 12px 28px rgba(224,123,57,0.5); }
.joy-pz-btn[disabled]{ opacity: 0.5; pointer-events: none; }

/* ───────────────────────── AUTH MODAL ───────────────────────── */
.joy-pz-modal{
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.32s ease;
}
.joy-pz-modal.open{ opacity: 1; pointer-events: all; }
.joy-pz-modal .bk{
  position: absolute; inset: 0; background: rgba(6,10,20,0.62);
  backdrop-filter: blur(8px) saturate(120%);
}
.joy-pz-sheet{
  position: relative; width: 100%; max-width: 380px;
  background: linear-gradient(160deg, rgba(28,32,42,0.55), rgba(18,22,32,0.62));
  -webkit-backdrop-filter: blur(28px) saturate(175%); backdrop-filter: blur(28px) saturate(175%);
  border: 1px solid var(--jpz-line); border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 40px rgba(255,157,77,0.06);
  padding: 26px 22px 22px; text-align: center; color: var(--jpz-text);
  transform: translateY(18px) scale(0.96); transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.joy-pz-modal.open .joy-pz-sheet{ transform: translateY(0) scale(1); }
.joy-pz-sheet .ic{
  width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--jpz-orange-bright), var(--jpz-orange));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(224,123,57,0.4);
}
.joy-pz-sheet .ic svg{ width: 30px; height: 30px; }
.joy-pz-sheet .ic .joy-auth-modal-logo{ width: 40px; height: 40px; object-fit: contain; display: block; mix-blend-mode: linear-light; }
.joy-pz-sheet h3{ font-family:"Tabliq",sans-serif; font-size: 1.2rem; margin: 0 0 6px; }
.joy-pz-sheet p{ font-size: 0.82rem; color: var(--jpz-sub); margin: 0 0 18px; line-height: 1.7; }
/* JoyAuth modal — smaller title & subtitle */
.joy-auth-modal-sheet h3{ font-size: 0.95rem; }
.joy-auth-modal-sheet p{ font-size: 0.76rem; }
.joy-pz-input{
  width: 100%; padding: 14px 16px; margin-bottom: 12px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--jpz-line);
  border-radius: 14px; color: var(--jpz-text); font-family: "Vazirmatn",sans-serif;
  font-size: 0.95rem; outline: none; text-align: center; transition: border-color 0.2s, box-shadow 0.2s;
}
.joy-pz-input:focus{ border-color: var(--jpz-orange-bright); box-shadow: 0 0 0 4px rgba(255,157,77,0.12); }
.joy-pz-input.code{ letter-spacing: 0.4em; font-size: 1.4rem; font-weight: 700; direction: ltr; }
.joy-pz-modal .joy-pz-btn{ width: 100%; margin-top: 4px; }
.joy-pz-msg{ font-size: 0.78rem; min-height: 18px; margin: 4px 0 0; }
.joy-auth-shell .joy-pz-msg{ text-align: center; }
.joy-pz-msg.err{ color: #ff8a8a; }
.joy-pz-msg.ok{ color: #7ee0a0; }
.joy-pz-link{ background:none; border:none; color: var(--jpz-orange-bright); font-family:inherit; font-size:0.78rem; cursor:pointer; margin-top:12px; }
.joy-pz-close{
  position: absolute; top: 14px; left: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: none; color: var(--jpz-text); cursor: pointer; font-size: 14px;
}
.joy-auth-shell{ direction: rtl; text-align: right; }
.joy-auth-tabs{ display:flex; gap:8px; margin-bottom:14px; }
.joy-auth-tab{
  flex:1; border:none; border-radius:14px; padding:11px 14px; cursor:pointer;
  background:rgba(255,255,255,0.06); color:var(--jpz-sub); font:600 .9rem "Tabliq",sans-serif;
  transition:background .2s,color .2s,transform .15s;
}
.joy-auth-tab.active{ background:linear-gradient(135deg,var(--jpz-orange-bright),var(--jpz-orange)); color:#fff; box-shadow:0 10px 24px rgba(224,123,57,.24); }
.joy-auth-methods{ display:grid; gap:10px; }
.joy-auth-method{
  width:100%; border:1px solid var(--jpz-line); border-radius:16px; padding:14px 16px; cursor:pointer;
  background:rgba(255,255,255,.05); color:var(--jpz-text); display:flex; align-items:center; justify-content:center; gap:12px;
  font:600 .92rem "Tabliq",sans-serif; transition:border-color .2s,background .2s,transform .15s;
}
.joy-auth-method:hover,.joy-auth-tab:hover,.joy-auth-submit:hover,.joy-auth-logout:hover{ transform:translateY(-1px); }
.joy-auth-method svg{ width:22px; height:22px; flex:0 0 22px; }
.joy-auth-method img{ width:24px; height:24px; flex:0 0 24px; object-fit:contain; display:block; }
.joy-auth-form-wrap{ max-height:0; overflow:hidden; opacity:0; transition:max-height .35s ease,opacity .25s ease; }
.joy-auth-form-wrap.open{ max-height:520px; opacity:1; margin-top:14px; }
.joy-auth-label{ display:block; margin:0 0 6px; color:#4a5468; font:600 .8rem "Tabliq",sans-serif; }
.joy-auth-input{ text-align:right; direction:rtl; margin-bottom:10px; font-family:"Tabliq","Vazirmatn",sans-serif; font-size:0.82rem; padding:12px 14px; }
.joy-auth-submit{ width:100%; }
.joy-auth-back,.joy-auth-logout{
  border:none; background:rgba(255,255,255,.08); color:var(--jpz-text); border-radius:12px; padding:10px 14px; cursor:pointer;
  font:600 .85rem "Tabliq",sans-serif;
}
.joy-auth-back{ margin:0 0 12px; }
.joy-auth-user{
  display:flex; flex-direction:column; gap:14px; padding:18px; border-radius:20px; color:var(--jpz-text);
  background:linear-gradient(160deg,rgba(28,32,42,.72),rgba(18,22,32,.82)); border:1px solid var(--jpz-line);
  box-shadow:0 24px 54px rgba(0,0,0,.24), inset 0 0 32px rgba(255,157,77,.06);
}
.joy-auth-user-title{ color:var(--jpz-sub); font:500 .82rem "Tabliq",sans-serif; }
.joy-auth-user-name{ font:700 1rem "Tabliq",sans-serif; margin-top:4px; }
.joy-auth-user-sub{ color:var(--jpz-sub); font:500 .82rem "Tabliq",sans-serif; margin-top:4px; word-break:break-word; }
.joy-auth-user-actions{ display:flex; flex-direction:column; gap:10px; }
.joy-auth-inline{ margin-top:10px; }
.joy-auth-inline .joy-auth-shell{
  background:linear-gradient(160deg,rgba(28,32,42,.72),rgba(18,22,32,.82)); border:1px solid rgba(255,157,77,.18);
  border-radius:24px; padding:18px; box-shadow:0 24px 54px rgba(0,0,0,.16), inset 0 0 32px rgba(255,157,77,.06);
}

/* ───────────────────────── FAVORITES PANEL ───────────────────────── */
.joy-pz-favgrid{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
  gap: 14px; padding: 18px 16px 30px;
}
.joy-pz-favcard{
  background: var(--jpz-card); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  animation: joyFavIn 0.4s ease both;
}
@keyframes joyFavIn{ from{opacity:0; transform: translateY(12px)} to{opacity:1; transform:none} }
.joy-pz-favcard .pv{
  aspect-ratio: 1/1; background: radial-gradient(circle at 50% 40%, #1c2438, #0e1422);
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.joy-pz-favcard .pv svg{ width: 100%; height: 100%; }
.joy-pz-favcard .meta{ padding: 10px 12px 12px; }
.joy-pz-favcard .nm{ font-weight: 700; font-size: 0.9rem; margin-bottom: 3px; }
.joy-pz-favcard .tp{ font-size: 0.7rem; color: var(--jpz-sub); line-height: 1.5; min-height: 32px; }
.joy-pz-favcard .pr{ font-size: 0.85rem; color: var(--jpz-orange-bright); font-weight: 700; margin-top: 6px; }
.joy-pz-favcard .acts{ display: flex; gap: 6px; margin-top: 10px; }
.joy-pz-favcard .acts button{
  flex: 1; padding: 8px; border-radius: 10px; font-family: "Vazirmatn",sans-serif;
  font-size: 0.74rem; font-weight: 600; cursor: pointer; border: none; transition: filter 0.15s;
}
.joy-pz-favcard .acts .reorder{ background: linear-gradient(135deg,var(--jpz-orange-bright),var(--jpz-orange)); color:#fff; }
.joy-pz-favcard .acts .del{ background: rgba(255,255,255,0.08); color: var(--jpz-sub); flex: 0 0 auto; }
.joy-pz-favcard .acts button:hover{ filter: brightness(1.12); }
.joy-pz-empty{ text-align: center; color: var(--jpz-sub); padding: 60px 20px; font-size: 0.9rem; }
.joy-pz-empty .big{ font-size: 2.4rem; margin-bottom: 10px; }

/* toast */
.joy-pz-toast{
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 1100; background: rgba(20,26,40,0.96); color: #fff; border: 1px solid var(--jpz-line);
  padding: 12px 20px; border-radius: 30px; font-family: "Vazirmatn",sans-serif; font-size: 0.85rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: all 0.3s; max-width: 88vw; text-align:center;
}
.joy-pz-toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }
.joy-pz-toast.ok{ border-color: rgba(126,224,160,0.5); }
.joy-pz-toast.err{ border-color: rgba(255,138,138,0.5); }

/* desktop: two columns for the designer */
@media (min-width: 880px){
  .joy-pz-body{ flex-direction: row; }
  .joy-pz-stage{ flex: 0 0 46%; position: sticky; top: 0; align-self: flex-start; padding-top: 30px; }
  .joy-pz-pizza-wrap{ width: min(34vw, 420px); }
  .joy-pz-palette{ flex: 1; overflow-y: auto; }
}

/* close/back buttons: perfectly centered SVG cross (font-independent) */
.joy-pz-close, .joy-pz-back { display: flex; align-items: center; justify-content: center; line-height: 0; padding: 0; }
.joy-pz-close svg, .joy-pz-back svg { display: block; }


/* ══════════════════════════════════════════════════════════════════
   ROTATING "REFLECTION" STROKE
   desktop → plays on hover.  touch → plays automatically while a card
   is scrolled into view (.in-view via JS) and continuously on fixed CTAs
   (FAB + footer buttons), since touch users can't hover.
   ================================================================== */
@property --joy-ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
/* about-fab already has position:fixed — no position:relative needed */
.menu-card, .drink-card, .joy-pz-fab, .joy-pz-btn.order, .joy-pz-btn.save { position: relative; }
.menu-card::after, .drink-card::after, .joy-pz-fab::after, .joy-pz-btn.order::after, .joy-pz-btn.save::after, .about-fab::after{
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1.6px; z-index: 4;
  background: conic-gradient(from var(--joy-ang),
     rgba(255,157,77,0) 0deg, rgba(255,255,255,0.92) 60deg,
     rgba(255,157,77,0.95) 100deg, rgba(255,157,77,0) 160deg, rgba(255,157,77,0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s ease;
}
@keyframes joySweep { to { --joy-ang: 360deg; } }
@media (hover:hover){
  .menu-card:hover::after, .drink-card:hover::after, .joy-pz-fab:hover::after,
  .joy-pz-btn.order:hover::after, .joy-pz-btn.save:hover::after, .about-fab:hover::after{ opacity: 1; animation: joySweep 1.5s linear infinite; }
}
/* mobile: continuous rotating glow on all touch screens */
@media (hover:none){
  .menu-card::after, .drink-card::after { opacity: 1; animation: joySweep 2.6s linear infinite; }
  .joy-pz-fab::after, .joy-pz-btn.order::after, .joy-pz-btn.save::after, .about-fab::after{ opacity: 1; animation: joySweep 2.6s linear infinite; }
}
@media (prefers-reduced-motion: reduce){ .menu-card::after,.drink-card::after,.joy-pz-fab::after,.joy-pz-btn.order::after,.joy-pz-btn.save::after,.about-fab::after{ animation: none !important; } }
@supports not ((-webkit-mask-composite: xor) or (mask-composite: exclude)){
  .menu-card::after, .drink-card::after, .joy-pz-fab::after, .joy-pz-btn.order::after, .joy-pz-btn.save::after, .about-fab::after{ display: none; }
}


/* ══════════════════════════════════════════════════════════════════
   5-STEP PIZZA WIZARD
   ================================================================== */
.joy-pz-wizard-screen .joy-pz-head{ align-items:center; }
.joy-pz-head .joy-pz-total{ margin:0; flex-shrink:0; text-align:center; }
.joy-pz-head .joy-pz-total .amt{ font-size:0.94rem; }
.joy-pz-head .joy-pz-total .cur{ font-size:0.62rem; }

/* progress indicator */
.joy-pz-steps{ flex-shrink:0; display:flex; gap:6px; padding:12px 14px 4px; overflow-x:auto; scrollbar-width:none; }
.joy-pz-steps::-webkit-scrollbar{ display:none; }
.joy-pz-pstep{ flex:1 0 auto; min-width:62px; display:flex; flex-direction:column; align-items:center; gap:5px; opacity:.5; transition:opacity .3s; }
.joy-pz-pstep .n{ width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:0.85rem; background:var(--jpz-card); border:1px solid var(--jpz-line); color:var(--jpz-sub); transition:all .3s; }
.joy-pz-pstep .l{ font-size:0.66rem; color:var(--jpz-sub); white-space:nowrap; }
.joy-pz-pstep.active{ opacity:1; }
.joy-pz-pstep.active .n{ background:linear-gradient(135deg,var(--jpz-orange-bright),var(--jpz-orange)); color:#fff; border-color:transparent; box-shadow:0 6px 16px rgba(224,123,57,.4); transform:scale(1.08); }
.joy-pz-pstep.active .l{ color:var(--jpz-text); font-weight:600; }
.joy-pz-pstep.done .n{ background:rgba(126,224,160,.18); color:#7ee0a0; border-color:rgba(126,224,160,.4); }

/* type/size badge under the rotating pizza */
.joy-pz-badge{ margin-top:10px; font-size:0.82rem; font-weight:700; color:var(--jpz-orange-bright); text-align:center; min-height:1.2em; }

/* wizard column + step transition */
.joy-pz-wizard{ flex:1; min-width:0; padding:8px 14px 18px; }
.joy-pz-step{ opacity:0; transform:translateY(10px); }
.joy-pz-step.in{ animation:joyStepIn .42s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes joyStepIn{ to{ opacity:1; transform:none; } }

/* option grids */
.joy-pz-opts{ display:grid; gap:14px; }
.joy-pz-opts.cols1{ grid-template-columns:1fr; }
.joy-pz-opts.cols2{ grid-template-columns:repeat(2,1fr); }
.joy-pz-opts.cols3{ grid-template-columns:repeat(auto-fill,minmax(118px,1fr)); }

/* option card */
.joy-pz-opt{ position:relative; cursor:pointer; text-align:center; font-family:inherit; color:var(--jpz-text);
  background:linear-gradient(155deg, rgba(26,34,54,.5), rgba(15,21,36,.6)); border:1.5px solid rgba(255,255,255,.07);
  border-radius:18px; padding:16px 12px 14px; display:flex; flex-direction:column; align-items:center; gap:9px;
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); transition:transform .16s, border-color .2s, box-shadow .2s, background .2s; }
.joy-pz-opt:hover{ transform:translateY(-2px); border-color:var(--jpz-line); }
.joy-pz-opt.sel{ border-color:var(--jpz-orange-bright); background:linear-gradient(180deg, rgba(255,157,77,.14), rgba(20,27,44,.62)); box-shadow:0 10px 26px rgba(224,123,57,.24); }
.joy-pz-opt-ic{ width:68px; height:68px; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.joy-pz-opt-ic img, .joy-pz-opt-ic svg{ width:100%; height:100%; object-fit:contain; display:block; }
.joy-pz-opt-nm{ font-size:0.94rem; font-weight:700; line-height:1.35; }
.joy-pz-opt-ds{ font-size:0.74rem; color:var(--jpz-sub); line-height:1.55; }
.joy-pz-opt-pr{ font-size:0.66rem; color:var(--jpz-orange-bright); font-weight:700; }
.joy-pz-opt-tick{ position:absolute; top:8px; left:8px; width:22px; height:22px; border-radius:50%; background:var(--jpz-orange-bright); color:#fff; display:none; align-items:center; justify-content:center; font-size:13px; box-shadow:0 2px 6px rgba(0,0,0,.4); }
.joy-pz-opt.sel .joy-pz-opt-tick{ display:flex; }

/* big (type) cards: image left, text right */
.joy-pz-opt.big{ display:grid; grid-template-columns:92px 1fr; align-items:center; gap:4px 16px; text-align:right; padding:18px; }
.joy-pz-opt.big .joy-pz-opt-ic{ grid-column:1; grid-row:1 / -1; align-self:center; width:92px; height:92px; }
.joy-pz-opt.big > .joy-pz-opt-nm, .joy-pz-opt.big > .joy-pz-opt-ds, .joy-pz-opt.big > .joy-pz-opt-pr{ grid-column:2; }
.joy-pz-opt.big .joy-pz-opt-nm{ font-size:1.14rem; }
.joy-pz-opt.big .joy-pz-opt-ds{ font-size:0.79rem; }

@media (max-width: 640px){
  .joy-pz-opts{ gap:12px; }
  .joy-pz-opts.cols3{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .joy-pz-opt{ padding:14px 10px 13px; }
  .joy-pz-opt-ic{ width:60px; height:60px; }
  .joy-pz-opt-nm{ font-size:0.88rem; }
  .joy-pz-opt-ds{ font-size:0.71rem; }
  .joy-pz-opt.big{ grid-template-columns:78px 1fr; padding:16px; }
  .joy-pz-opt.big .joy-pz-opt-ic{ width:78px; height:78px; }
  .joy-pz-opt.big .joy-pz-opt-nm{ font-size:1.04rem; }
}

/* final step section headers */
.joy-pz-sec{ font-size:0.86rem; font-weight:700; color:var(--jpz-text); margin:6px 2px 10px; }
.joy-pz-sec.req span{ color:#ff8a8a; font-size:0.72rem; font-weight:600; }
.joy-pz-note{ font-size:0.74rem; color:var(--jpz-sub); background:rgba(255,255,255,.05); border-radius:10px; padding:8px 12px; margin-bottom:12px; }

/* validation message */
.joy-pz-err{ flex-shrink:0; text-align:center; color:#ff8a8a; font-size:0.82rem; font-weight:600; opacity:0; max-height:0; overflow:hidden; transition:opacity .25s, max-height .25s; }
.joy-pz-err.show{ opacity:1; max-height:44px; padding:2px 16px 8px; }
.joy-pz-err.shake{ animation:joyShake .4s; }
@keyframes joyShake{ 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }

/* nav footer */
.joy-pz-nav{ flex-shrink:0; display:flex; gap:10px; padding:12px 16px; border-top:1px solid var(--jpz-line); background:linear-gradient(0deg, rgba(0,0,0,.28), transparent); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
.joy-pz-nav .joy-pz-btn{ flex:1; }
.joy-pz-nav .joy-pz-btn.ghost{ flex:0 0 36%; }
.joy-pz-btn.finish{ box-shadow:0 10px 26px rgba(224,123,57,.5); }

@media (min-width:880px){ .joy-pz-wizard-screen .joy-pz-stage{ flex:0 0 42%; } }
.joy-pz-sheet .joy-pz-input{ box-shadow: 0 8px 20px rgba(0,0,0,0.32); }

/* ════════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES — auth modal + favorites + inline panels
   (added 2026-07-03). The site's :root already redefines --card-text /
   --card-sub / --card-bg etc under body.light-theme, so anything that
   uses var(--jpz-*) flips automatically. These rules handle the bits
   that are hard-coded (translucent dark glass, white-on-dark inputs,
   dark nav gradient) so the auth modal reads as a real light sheet.
   ════════════════════════════════════════════════════════════════ */
body.light-theme .joy-pz-modal .bk{
  background: rgba(15,28,52,0.32);
  backdrop-filter: blur(10px) saturate(140%);
}
body.light-theme .joy-pz-sheet{
  background: linear-gradient(160deg, rgba(255,255,255,0.78), rgba(244,248,252,0.62));
  border-color: rgba(255,255,255,0.85);
  box-shadow: 0 30px 80px rgba(15,28,52,0.22), inset 0 0 40px rgba(224,123,57,0.06);
}
/* explicit title + explainer colors so they stay correct even if the
   token chain breaks: title = dark navy blue, explainer = muted gray */
body.light-theme .joy-pz-sheet h3{ color: #16223c; }
body.light-theme .joy-pz-sheet p{ color: #8893a8; }
body.light-theme .joy-pz-input{
  background: rgba(255,255,255,0.55);
  border-color: rgba(30,45,78,0.10);
  color: var(--navy);
}
body.light-theme .joy-pz-input:focus{
  border-color: var(--jpz-orange-bright);
  box-shadow: 0 0 0 4px rgba(255,157,77,0.18);
}
body.light-theme .joy-pz-close{
  background: rgba(30,45,78,0.06);
  color: var(--navy);
}
body.light-theme .joy-auth-tab{
  background: rgba(30,45,78,0.05);
  color: rgba(22,34,60,0.62);
}
body.light-theme .joy-auth-method{
  background: rgba(255,255,255,0.65);
  border-color: rgba(30,45,78,0.10);
  color: var(--navy);
}
body.light-theme .joy-auth-back,
body.light-theme .joy-auth-logout{
  background: rgba(30,45,78,0.06);
  color: var(--navy);
}
body.light-theme .joy-auth-user{
  background: linear-gradient(160deg, rgba(255,255,255,0.88), rgba(244,248,252,0.78));
  border-color: rgba(255,157,77,0.28);
  box-shadow: 0 24px 54px rgba(15,28,52,0.18), inset 0 0 32px rgba(255,157,77,0.06);
}
body.light-theme .joy-auth-inline .joy-auth-shell,
/* Force the about panel's auth section to be light ALWAYS (regardless of
   page theme) — the about sheet is a dim/navy context and the inline auth
   card should never inherit that dark look. */
#aboutPanel .joy-auth-inline .joy-auth-shell{
  background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(244,248,252,0.88));
  border-color: rgba(255,157,77,0.28);
  box-shadow: 0 24px 54px rgba(15,28,52,0.14), inset 0 0 32px rgba(255,157,77,0.06);
}
/* Light skin for the inside pieces of the about panel auth (no theme gate) */
#aboutPanel .joy-auth-inline .joy-auth-tab{
  background: rgba(30,45,78,0.05);
  color: rgba(22,34,60,0.62);
}
#aboutPanel .joy-auth-inline .joy-auth-method{
  background: rgba(255,255,255,0.78);
  border-color: rgba(30,45,78,0.10);
  color: var(--navy);
}
#aboutPanel .joy-auth-inline .joy-pz-input{
  background: rgba(255,255,255,0.72);
  border-color: rgba(30,45,78,0.10);
  color: var(--navy);
}
#aboutPanel .joy-auth-inline .joy-pz-input:focus{
  border-color: var(--jpz-orange-bright);
  box-shadow: 0 0 0 4px rgba(255,157,77,0.18);
}
#aboutPanel .joy-auth-inline .joy-auth-back,
#aboutPanel .joy-auth-inline .joy-auth-logout{
  background: rgba(30,45,78,0.06);
  color: var(--navy);
}
#aboutPanel .joy-auth-inline .joy-auth-label{ color:#4a5468; }
#aboutPanel .joy-auth-inline .joy-pz-msg{ color: #4a5468; }
body.light-theme .joy-pz-favcard{
  background: rgba(255,255,255,0.82);
  border-color: rgba(30,45,78,0.08);
  box-shadow: 0 6px 18px rgba(15,28,52,0.10);
}
body.light-theme .joy-pz-favcard .pv{
  background: radial-gradient(circle at 50% 40%, #f4f8fc, #e9f2f9);
}
body.light-theme .joy-pz-nav{
  background: linear-gradient(0deg, rgba(30,45,78,0.06), transparent);
  border-top-color: rgba(30,45,78,0.08);
}
