/* HAM Bakery — nutrition card, product sheet, and the shared button motion system */

/* ================= nutrition card ================= */
.nutri { --c-carb: var(--ham); --c-fat: #d39e5b; --c-prot: var(--olive); --trk: rgba(79, 91, 42, .12); --txt: var(--ink); --sub: var(--muted-ink);
  display: grid; grid-template-columns: 150px 1fr; gap: 1.2rem 1.5rem; align-items: center; color: var(--txt); }
.inside .nutri { --c-prot: #b6e3a8; --trk: rgba(255, 248, 234, .12); --txt: var(--ivory); --sub: rgba(255, 248, 234, .65); }
.nutri-ring { position: relative; width: 150px; aspect-ratio: 1; }
.nutri-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.nutri-ring circle { fill: none; stroke-width: 12; }
.nutri-ring .trk { stroke: var(--trk); }
.nutri-ring .arc { stroke-linecap: round; stroke-dasharray: 0 400; }
.nutri-ring .arc-c { stroke: var(--c-carb); }
.nutri-ring .arc-f { stroke: var(--c-fat); }
.nutri-ring .arc-p { stroke: var(--c-prot); }
.nutri-kcal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.nutri-kcal b { font-family: var(--f-display); font-weight: 900; font-size: 2.3rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.nutri-kcal .unit { font-weight: 800; font-size: .78rem; color: var(--sub); margin-top: .3rem; }
.nutri-kcal .approx { font-weight: 800; font-size: .8rem; color: var(--sub); margin-bottom: .15rem; }
.nutri-side { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.nutri-toggle { position: relative; display: inline-flex; align-self: flex-start; padding: 4px; border-radius: 99px; background: var(--trk); margin-bottom: .3rem; isolation: isolate; }
.nutri-toggle button { position: relative; z-index: 1; border: 0; background: none; font-weight: 800; font-size: .78rem; color: var(--sub);
  padding: .42rem .8rem; border-radius: 99px; cursor: pointer; white-space: nowrap; transition: color .35s ease; }
.nutri-toggle button.on { color: var(--ink); }
.nutri-pill { position: absolute; z-index: 0; left: 4px; top: 4px; bottom: 4px; border-radius: 99px; background: var(--ham);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .15); transition: transform .5s cubic-bezier(.2, .9, .2, 1), width .5s cubic-bezier(.2, .9, .2, 1); }
.m-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 60px 34px; align-items: center; gap: .55rem; font-size: .84rem; }
.m-dot { width: 10px; height: 10px; border-radius: 50%; }
.m-c .m-dot, .m-c .m-bar i { background: var(--c-carb); }
.m-f .m-dot, .m-f .m-bar i { background: var(--c-fat); }
.m-p .m-dot, .m-p .m-bar i { background: var(--c-prot); }
.m-s .m-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--c-carb); }
.m-s .m-bar i { background: repeating-linear-gradient(-45deg, var(--c-carb) 0 4px, transparent 4px 7px); }
.m-s .m-name { color: var(--sub); padding-left: .4rem; }
.m-name { font-weight: 700; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
.m-val { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.m-val b { font-family: var(--f-display); font-weight: 700; }
.m-bar { height: 7px; border-radius: 99px; background: var(--trk); overflow: hidden; }
.m-bar i { display: block; height: 100%; border-radius: inherit; transform-origin: 0 50%; transform: scaleX(0); }
.m-ri { font-size: .72rem; font-weight: 800; color: var(--sub); text-align: right; font-variant-numeric: tabular-nums; }
.m-legend { font-size: .7rem; color: var(--sub); text-align: right; margin-top: -.15rem; }
.allergens { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.al { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .6rem .3rem .4rem; border-radius: 99px; font-size: .74rem; font-weight: 800;
  background: var(--trk); color: var(--txt); }
.al svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nutri-note { grid-column: 1 / -1; font-size: .74rem; color: var(--sub); line-height: 1.45; margin: 0; }
.nutri.compact { grid-template-columns: 120px 1fr; }
.nutri.compact .nutri-ring { width: 120px; }
.nutri.compact .nutri-kcal b { font-size: 1.8rem; }
.inside-nutri { margin-top: .2rem; padding: 1.1rem; border-radius: 22px; background: rgba(255, 248, 234, .06); box-shadow: inset 0 0 0 1px rgba(255, 248, 234, .1); }
.inside-nutri:empty { display: none; }
.sheet-h { font-family: var(--f-display); font-weight: 700; font-size: 1rem; margin: 1.1rem 0 .7rem; }
.sheet-h.light { margin-top: 0; color: var(--ivory); }

/* kcal chip on menu cards */
.p-kcal { position: absolute; top: 14px; left: 14px; z-index: 2; border: 0; cursor: pointer; display: inline-flex; flex-direction: column; align-items: flex-start;
  background: rgba(255, 255, 255, .92); color: var(--ink); border-radius: 14px; padding: .32rem .55rem; line-height: 1.05;
  font-family: var(--f-display); font-weight: 900; font-size: .8rem; box-shadow: 0 6px 14px rgba(43, 33, 28, .12); }
.p-kcal small { font-family: var(--f-body); font-weight: 800; font-size: .56rem; color: var(--muted-ink); }
.p-img { cursor: zoom-in; }

/* ================= product sheet ================= */
.sheet-card { position: relative; width: min(960px, 100%); max-height: 92vh; overflow: auto; padding: 0; border-radius: 30px; overscroll-behavior: contain; }
.sheet-body { display: grid; grid-template-columns: 1fr 1.15fr; min-height: 520px; }
.sheet-photo { background: radial-gradient(circle at 50% 60%, var(--ivory), var(--butter) 70%); display: grid; place-items: center; padding: 2rem;
  border-radius: 30px 0 0 30px; position: relative; overflow: hidden; }
.sheet-photo::before { content: ""; position: absolute; inset: 12% 14% 8%; border-radius: 999px 999px 26px 26px; background: rgba(255, 255, 255, .6); }
.sheet-photo img { position: relative; width: 100%; max-width: 380px; max-height: 420px; object-fit: contain; filter: drop-shadow(0 26px 30px rgba(43, 33, 28, .3)); }
.sheet-info { padding: 2rem 2rem 1.6rem; display: flex; flex-direction: column; min-width: 0; }
.sheet-name { font-family: var(--f-display); font-weight: 900; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.05; padding-right: 2.6rem; text-wrap: balance; }
.sheet-price { font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; margin-top: .6rem; }
.sheet-sizes { display: flex; gap: .4rem; margin-top: .8rem; }
.sheet-sizes .size { background: var(--butter); color: var(--olive); padding: .5rem .85rem; font-size: .8rem; border-radius: 14px; }
.sheet-sizes .size b { font-size: .9rem; }
.sheet-sizes .size.active { background: var(--olive); color: var(--ivory); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.comp { display: flex; flex-wrap: wrap; gap: .35rem; }
.comp span { background: var(--butter); border-radius: 99px; padding: .35rem .7rem; font-size: .8rem; font-weight: 700; color: var(--olive);
  animation: cardIn .5s var(--spring) both; animation-delay: calc(var(--i) * 40ms + .15s); }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 3; }
@media (max-width: 760px) {
  .sheet-body { grid-template-columns: 1fr; }
  .sheet-photo { border-radius: 30px 30px 0 0; padding: 1.2rem; min-height: 230px; }
  .sheet-photo img { max-height: 220px; }
  .sheet-info { padding: 1.3rem; }
  .nutri, .nutri.compact { grid-template-columns: 1fr; justify-items: center; }
  .nutri-side { width: 100%; }
  .nutri-toggle { align-self: center; }
  .m-row { grid-template-columns: 10px minmax(0, 1fr) auto 56px 34px; }
}

/* ================= one calm motion system for every button ================= */
:where(button, .pill-btn, .primary-btn, .ghost-btn, .ghost-dark, .add-btn, .step-btn, .tab, .inside-chip, .size, .seg button,
  .nav-item, .lang button, .icon-btn, .shop, .footer-links a, .p-3d, .p-kcal, .card, .cake-arrow) {
  -webkit-tap-highlight-color: transparent;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), background-color .3s ease, color .3s ease, box-shadow .45s ease, border-color .3s ease, opacity .3s ease;
}
@media (hover: hover) and (pointer: fine) {
  :where(.ghost-btn, .ghost-dark, .add-btn, .tab, .inside-chip, .p-3d, .p-kcal, .footer-links a, .shop, .size):hover { transform: translateY(-2px); }
  :where(.p-3d, .p-kcal):hover { box-shadow: 0 10px 20px rgba(43, 33, 28, .2); }
}
:where(button, .pill-btn, .primary-btn, .ghost-btn, .add-btn, .step-btn, .tab, .inside-chip, .size, .shop, .p-3d, .p-kcal, .cake-arrow):active {
  transform: scale(.95); transition-duration: .12s; }
.icon-btn:hover { transform: rotate(90deg); }

/* nutrition under the 3D stage: one wide row (ring | macros | allergens) */
.inside-nutri { grid-column: 1 / -1; padding: 1.4rem 1.6rem; }
.inside-nutri .nutri.compact { grid-template-columns: 130px minmax(0, 1fr); }
.inside-nutri .nutri.compact .nutri-ring { width: 130px; }
@media (min-width: 981px) {
  .inside-nutri { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 1.5rem; }
  .inside-nutri .sheet-h { margin: 0; font-size: 1.3rem; }
}

.inside-nutri .nutri-side { max-width: 560px; }
.inside-nutri .nutri.compact { justify-content: start; }

/* elements moved by GSAP must not also have CSS transform transitions (that is what made them jump) */
.p-card, .card, .carousel-track, .magnetic, .berry, .leaf, .deco, .hero-left, .hero-right, .tab-ind {
  transition-property: background-color, color, box-shadow, border-color, opacity !important;
}
.step-btn:active, .cake-arrow:active { transform: scale(.95); }
.step-btn:hover, .cake-arrow:hover { transform: none; }
.step-btn.next:hover { background: #ffd25a; box-shadow: 0 14px 30px rgba(0, 0, 0, .32); }
.cake-arrow:hover { background: var(--ham); }
.cake-nav .cake-arrow:hover { transform: none; }

/* small loading ring when a cake is still on its way */
.hero-center::after { content: ""; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .25); border-top-color: var(--ham); opacity: 0; transition: opacity .2s; animation: spin .8s linear infinite; }
.hero-center.waiting::after { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Next / Previous / cake arrows never move or scale — feedback is colour + shadow only */
.step-btn, .step-btn:hover, .step-btn:active, .cake-arrow, .cake-arrow:hover, .cake-arrow:active, .cake-nav .cake-arrow:hover { transform: none !important; }
.step-btn.next:active { background: #e8b22e; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.step-btn.prev:active { background: rgba(255, 255, 255, .22); }
.cake-arrow:active { background: #e8b22e; }

/* ================= "up next" preview buttons (replace the old Next / Previous pills) ================= */
.carousel-nav { display: flex; align-items: center; gap: .7rem; }
.peek { border: 0; cursor: pointer; font-family: var(--f-body); color: var(--ink); flex: none; transform: none !important;
  transition: background-color .3s ease, box-shadow .4s ease !important; }
.peek-thumb { display: grid; place-items: center; border-radius: 50%; background: #fff; overflow: hidden; }
.peek-thumb img { width: 88%; height: 88%; object-fit: contain; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.peek-thumb img.in { animation: peekIn .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes peekIn { from { opacity: 0; transform: rotate(-35deg) scale(.6); } to { opacity: 1; transform: none; } }

.peek.next { display: grid; grid-template-columns: 62px minmax(0, 1fr) 30px; align-items: center; gap: .65rem;
  width: 268px; height: 76px; padding: 7px 14px 7px 7px; border-radius: 40px; text-align: left;
  background: var(--ivory); box-shadow: 0 16px 34px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(43, 33, 28, .06); }
.peek-ring { position: relative; width: 62px; height: 62px; display: grid; place-items: center; }
.peek-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.peek-ring circle { fill: none; stroke-width: 4; }
.peek-ring .r-trk { stroke: rgba(43, 33, 28, .1); }
.peek-ring .r-val { stroke: var(--ham-deep); stroke-linecap: round; transition: stroke-dasharray .7s cubic-bezier(.2, .8, .2, 1); }
.peek-ring .peek-thumb { width: 50px; height: 50px; box-shadow: inset 0 0 0 1px rgba(43, 33, 28, .08); }
.peek-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.peek-txt small { font-size: .7rem; font-weight: 800; color: var(--muted-ink); white-space: nowrap; }
.peek-txt small #heroCount { color: var(--olive); font-variant-numeric: tabular-nums; margin-left: .2rem; min-width: auto; font-family: inherit; font-size: inherit; }
.peek-txt b { font-family: var(--f-display); font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-go { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--ham);
  font-weight: 900; font-size: .95rem; transition: background-color .3s ease, color .3s ease; }
.peek.next:hover { background: #fff; box-shadow: 0 20px 40px rgba(0, 0, 0, .32), 0 0 0 3px rgba(243, 193, 65, .6); }
.peek.next:hover .peek-go { background: var(--ham); color: var(--ink); }
.peek.next:hover .peek-thumb img { transform: rotate(14deg) scale(1.08); }
.peek.next:active { background: var(--butter); }

.peek.prev { position: relative; width: 58px; height: 58px; border-radius: 50%; padding: 4px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); backdrop-filter: blur(10px); }
.peek.prev .peek-thumb { width: 50px; height: 50px; opacity: .85; transition: opacity .3s ease; }
.peek-arrow { position: absolute; left: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--ham); font-size: .75rem; font-weight: 900; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.peek.prev:hover { background: rgba(255, 255, 255, .28); }
.peek.prev:hover .peek-thumb { opacity: 1; }
.peek.prev:hover .peek-thumb img { transform: rotate(-14deg) scale(1.08); }
.peek.prev:active { background: rgba(255, 255, 255, .38); }
@media (max-width: 640px) {
  .peek.next { width: 236px; height: 70px; grid-template-columns: 56px minmax(0, 1fr) 28px; }
  .peek-ring { width: 56px; height: 56px; }
  .peek-ring .peek-thumb { width: 45px; height: 45px; }
}
@media (max-width: 980px) { .cake-nav { display: none; } }

/* ================= no next/previous buttons: the cake strip is swiped / dragged ================= */
.carousel-cards { clip-path: none; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 4.8rem 6px 1rem; margin-top: -2.6rem; cursor: grab; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  -webkit-mask: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 28px), transparent);
          mask: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 28px), transparent); }
.carousel-cards::-webkit-scrollbar { display: none; }
.carousel-cards.dragging { cursor: grabbing; scroll-snap-type: none; }
.carousel-cards.dragging .card { pointer-events: none; }
.carousel-track { transform: none !important; padding-right: 22px; }
.carousel-track .card { scroll-snap-align: center; }
.carousel-nav { justify-content: center; width: 100%; }
.carousel-count { font-family: var(--f-display); font-weight: 700; font-size: .85rem; color: var(--muted-color); }

/* nothing may widen the page on phones (decorations near the edge used to stretch it to 566px) */
html, body { overflow-x: clip; }
.menu, .inside, .occasions, .delivery, .footer, main { overflow-x: clip; }
@media (max-width: 640px) {
  .m-row { grid-template-columns: 10px minmax(0, 1fr) auto 44px 30px; gap: .4rem; font-size: .8rem; }
  .inside-nutri { padding: 1rem .8rem; }
}

/* ---------- phone layout fixes ---------- */
@media (max-width: 760px) {
  .inside-nutri .nutri.compact { grid-template-columns: 1fr; justify-items: center; }
  .inside-nutri .nutri-side { max-width: none; width: 100%; }
}
@media (max-width: 640px) {
  .p-3d span { display: none; }
  .p-3d { top: 10px; right: 10px; padding: .32rem .5rem; }
  .p-kcal { top: 10px; left: 10px; padding: .25rem .45rem; font-size: .72rem; }
  .p-kcal small { font-size: .5rem; }
  .p-name { font-size: .8rem; }
  .side-price { font-size: .95rem; }
}
