@font-face {
  font-family: "Figtree";
  src: url("./assets/fonts/Figtree-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("./assets/fonts/Figtree-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("./assets/fonts/Figtree-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --highlight: #f3e3da;
  --accent: #19c4ea;
  --text: #000000;
  --text-secondary: rgba(0, 0, 0, 0.7);
  --shadow: 0 5px 12px rgba(0, 0, 0, 0.16);
  --soft-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  --design-width: 375;
  color-scheme: light;
  font-family: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
#app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #1b1b1b;
  color: var(--text);
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

.app-shell {
  width: 100vw;
  height: 100vh;
}

.phone-stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
}

@media (min-width: 720px) {
  body {
    display: grid;
    place-items: center;
    padding: 24px;
  }

  .app-shell {
    display: grid;
    place-items: center;
  }

  .phone-stage {
    width: min(375px, calc(100vw - 48px));
    height: min(812px, calc(100vh - 48px));
    border-radius: 28px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  }
}

.splash {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.splash-pizza {
  position: relative;
  width: min(72vw, 270px);
  aspect-ratio: 1;
}

.splash-slice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(0.96);
  animation: slice-in 18ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform-origin: 50% 50%;
}

@keyframes slice-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.catalog {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden auto;
  background: var(--bg);
  scrollbar-width: none;
}

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

.catalog-bg {
  position: absolute;
  top: 0;
  left: 50%;
  width: 150%;
  height: min(56.6vh, 532px);
  min-height: 455px;
  transform: translateX(-50%);
  border-bottom-right-radius: 50% 13%;
  border-bottom-left-radius: 50% 13%;
  background: var(--highlight);
  pointer-events: none;
  animation: bg-rise 120ms 35ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes bg-rise {
  from {
    transform: translate(-50%, 80px);
  }
}

.nav {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  min-height: 92px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 24px 0;
}

.round-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.round-button .material-symbols-rounded {
  font-size: 30px;
  line-height: 1;
}

.nav-title {
  min-width: 0;
  text-align: center;
}

.nav-kicker {
  display: block;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 400;
  line-height: 20px;
}

.nav-name {
  display: block;
  overflow: hidden;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel {
  position: relative;
  z-index: 2;
  height: min(40.7vh, 330px);
  min-height: 292px;
  margin-top: 25px;
  touch-action: pan-y;
}

.pizza-image {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
  user-select: none;
  -webkit-user-drag: none;
}

.pizza-side {
  position: absolute;
  top: 47%;
  width: 80px;
  height: 80px;
  padding: 0;
  overflow: hidden;
  transform: translateY(-50%);
}

.pizza-side.prev {
  left: -39px;
}

.pizza-side.next {
  right: -39px;
}

.pizza-center-wrap {
  position: absolute;
  top: 47%;
  left: 50%;
  display: grid;
  place-items: center;
  width: var(--pizza-size);
  height: var(--pizza-size);
  transform: translate(-50%, -50%);
}

.pizza-center {
  width: 100%;
  height: 100%;
  transition: width var(--size-duration) cubic-bezier(0.4, 0, 0.2, 1), height var(--size-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.pizza-center.bounce {
  animation: pizza-bounce 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pizza-bounce {
  0% { transform: scale(1); }
  31.8% { transform: scale(1.055); }
  68.2% { transform: scale(0.992); }
  100% { transform: scale(1); }
}

.carousel.settle-pull {
  animation: page-settle-pull 315ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes page-settle-pull {
  0% { transform: translateX(0); }
  37.1% { transform: translateX(var(--settle-distance)); }
  100% { transform: translateX(0); }
}

.zoom-button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  color: #ffffff;
}

.zoom-button .material-symbols-rounded {
  font-size: 52px;
}

.info-panel {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 max(32px, env(safe-area-inset-bottom, 0px));
  margin-top: -30px;
  transform: translateY(0);
  animation: content-in 130ms 95ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes content-in {
  from {
    opacity: 0;
    transform: translateY(56px);
  }
}

.banana-wrap {
  position: relative;
  width: 140px;
  height: 82px;
  margin-top: -4px;
}

.banana-text {
  position: absolute;
  top: 0;
  left: 50%;
  width: 112px;
  height: 40px;
  transform: translateX(-50%);
  pointer-events: none;
}

.banana-text span {
  position: absolute;
  left: 50%;
  top: 34px;
  height: 44px;
  color: #000000;
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  transform-origin: 0 -34px;
}

.banana {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 97px;
  height: 63px;
  object-fit: contain;
  transform: translateX(-50%);
}

.size-selector {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 244px;
  height: 64px;
  margin-top: -11px;
}

.size-pill {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

.size-pill:not(.active) {
  transform: translateY(-16px);
}

.size-pill-inner {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow);
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.size-pill.active {
  background: var(--bg);
}

.size-pill.active .size-pill-inner {
  color: #ffffff;
  background: #000000;
  box-shadow: none;
}

.description {
  width: 100%;
  max-width: 375px;
  margin: 31px 0 0;
  padding: 0 40px;
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
}

.order-bar {
  display: grid;
  grid-template-columns: 143px 100px 83px;
  justify-content: space-between;
  gap: 0;
  align-items: center;
  width: min(100%, 375px);
  margin-top: 38px;
  padding: 0 25px;
}

.quantity {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  width: 143px;
  height: 48px;
  border-radius: 36px;
  background: var(--highlight);
}

.quantity-value,
.price,
.add-button {
  font-size: 24px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}

.quantity-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
  font-size: 35px;
  font-weight: 400;
  line-height: 1;
}

.quantity-button[disabled] {
  opacity: 0.45;
}

.price {
  width: 100px;
  white-space: nowrap;
}

.add-button {
  display: grid;
  place-items: center;
  width: 83px;
  height: 48px;
  border-radius: 36px;
  color: #ffffff;
  background: var(--accent);
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
  max-width: min(320px, calc(100vw - 40px));
  padding: 12px 18px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.82);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  font-size: 14px;
  transform: translateX(-50%);
}

.install-panel {
  position: fixed;
  z-index: 35;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
  width: min(335px, calc(100vw - 32px));
  transform: translateX(-50%);
}

.install-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
}

.install-card h2 {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.install-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.install-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.install-actions button {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 800;
}

.install-secondary {
  color: var(--text);
  background: var(--highlight);
}

.install-primary {
  color: #ffffff;
  background: var(--accent);
}

.zoom-layer {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
  touch-action: none;
}

.zoom-layer img {
  width: min(274px, 73vw);
  height: min(274px, 73vw);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: none;
  transform: translate(var(--pan-x), var(--pan-y)) scale(5.2);
  animation: zoom-in 475ms cubic-bezier(0.4, 0, 0.2, 1) both;
  user-select: none;
  -webkit-user-drag: none;
}

.zoom-layer.dragging img {
  animation: none;
}

@keyframes zoom-in {
  0% { transform: translate(0, 0) scale(1); }
  82% { transform: translate(0, 0) scale(5.2936); }
  100% { transform: translate(0, 0) scale(5.2); }
}

.dialog-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.46);
}

.dialog {
  width: min(320px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.dialog h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
}

.dialog p {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.dialog button {
  display: inline-grid;
  place-items: center;
  min-width: 96px;
  height: 42px;
  padding: 0 18px;
  border-radius: 22px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 600;
}

.loading {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(25, 196, 234, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 359px) {
  .order-bar {
    grid-template-columns: 143px 1fr;
    row-gap: 12px;
    padding: 0 20px;
  }

  .add-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .description {
    padding: 0 28px;
    font-size: 21px;
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  .phone-stage {
    max-width: none;
  }

  .catalog {
    overflow: hidden;
  }

  .catalog-bg {
    left: 0;
    width: 54%;
    height: 100%;
    min-height: 0;
    transform: none;
    border-radius: 0;
  }

  .nav {
    width: 54%;
  }

  .carousel {
    width: 54%;
    margin-top: 28px;
  }

  .info-panel {
    position: absolute;
    top: 82px;
    right: 0;
    width: 46%;
    height: calc(100% - 82px);
    overflow: auto;
    padding-top: 10px;
  }

  .description {
    font-size: 18px;
    line-height: 1.45;
  }

  .order-bar {
    grid-template-columns: 143px 100px;
  }

  .add-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}
