:root {
  --app-bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f1f2f4;
  --text: #151515;
  --muted: #777a82;
  --line: #eceef2;
  --red: #e50914;
  --red-dark: #b70710;
  --yellow: #ffd90a;
  --green: #22b66b;
  --orange: #ff7a1a;
  --black: #070707;
  --shadow: 0 16px 44px rgba(20, 20, 20, 0.14);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  background: var(--app-bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  width: 100%;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(229, 9, 20, 0.12), transparent 18rem),
    radial-gradient(circle at 92% 24%, rgba(255, 217, 10, 0.2), transparent 20rem),
    var(--app-bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body.sheet-open {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: 100svh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--surface);
  padding-bottom: calc(8.6rem + var(--safe-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 25;
  padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 0.75rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94)),
    var(--surface);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(236, 238, 242, 0.82);
}

.address-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding-right: 3.7rem;
}

.avatar-btn,
.round-btn,
.close-btn {
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
}

.avatar-btn {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: #101010;
  color: #fff;
  box-shadow: inset 0 0 0 3px var(--red);
}

.avatar-btn span {
  font-family: Georgia, serif;
  font-size: 1.65rem;
  line-height: 1;
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.avatar-btn i {
  position: absolute;
  right: 0.1rem;
  top: 0.1rem;
  width: 0.82rem;
  height: 0.82rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
}

.address-btn {
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
}

.address-btn small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.address-btn strong {
  display: block;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.round-btn {
  width: 3rem;
  height: 3rem;
  color: var(--black);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.app-header .round-btn {
  position: fixed;
  right: 1rem;
  top: calc(0.85rem + env(safe-area-inset-top, 0px));
  z-index: 50;
}

.round-btn span,
.tabbar strong {
  position: absolute;
  display: none;
  min-width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  padding: 0 0.3rem;
  color: #fff;
  border-radius: 999px;
  background: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
}

.round-btn span {
  right: -0.2rem;
  top: -0.12rem;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  min-height: 3.75rem;
  margin-top: 0.9rem;
  padding: 0 1rem;
  color: #9a9ca4;
  border-radius: 18px;
  background: var(--surface-2);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.08rem;
}

.perks-strip {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.75rem -1rem -0.2rem;
  padding: 0 1rem 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.perks-strip::-webkit-scrollbar,
.category-rail::-webkit-scrollbar,
.promo-rail::-webkit-scrollbar,
.horizontal-list::-webkit-scrollbar {
  display: none;
}

.perks-strip span {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: #e7fff2;
  color: #333;
  font-size: 0.84rem;
  font-weight: 800;
}

.perks-strip span:nth-child(2) {
  background: #f2edff;
}

.app-main {
  padding: 0 0 1rem;
}

.category-rail {
  display: flex;
  gap: 0.95rem;
  padding: 1.05rem 1rem 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.category-pill {
  display: grid;
  flex: 0 0 4.85rem;
  justify-items: center;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  scroll-snap-align: start;
}

.category-pill img {
  width: 4.25rem;
  height: 4.25rem;
  object-fit: cover;
  border-radius: 22px;
  background: var(--surface-2);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.category-pill span {
  max-width: 5rem;
  min-height: 2.1em;
  font-size: 0.83rem;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
}

.promo-rail,
.horizontal-list {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.promo-rail {
  padding: 0.4rem 1rem 1rem;
  scroll-snap-type: x mandatory;
}

.promo-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 6.3rem;
  flex: 0 0 min(82vw, 21rem);
  min-height: 8.7rem;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  padding: 1rem;
  text-align: left;
  scroll-snap-align: start;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.promo-card.is-red {
  color: #fff;
  background: linear-gradient(135deg, #e50914, #8c050b);
}

.promo-card.is-yellow {
  color: #171717;
  background: linear-gradient(135deg, #ffd90a, #ff9d00);
}

.promo-card.is-green {
  color: #061b11;
  background: linear-gradient(135deg, #b8ff7a, #18c878);
}

.promo-card small {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  font-size: 0.75rem;
  font-weight: 900;
}

.promo-card strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.55rem;
  line-height: 0.98;
}

.promo-card span {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.84rem;
  font-weight: 800;
  opacity: 0.9;
}

.promo-card img {
  align-self: center;
  width: 6.3rem;
  height: 6.3rem;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.36);
  border-radius: 22px;
  transform: rotate(4deg);
}

.section-block {
  padding: 0.55rem 0 1rem;
  scroll-margin-top: 9rem;
}

.section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  padding: 0 1rem 0.8rem;
}

.section-title > div {
  min-width: 0;
}

.section-title h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.1;
}

.section-title p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.section-title button {
  flex: 0 0 auto;
  color: var(--red);
  border: 0;
  background: transparent;
  font-weight: 900;
  white-space: nowrap;
}

.horizontal-list {
  padding: 0 1rem 0.3rem;
  scroll-snap-type: x proximity;
}

.product-card {
  position: relative;
  display: grid;
  flex: 0 0 10.4rem;
  align-content: start;
  min-height: 16.7rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  scroll-snap-align: start;
}

.product-card__image {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface-2);
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discount-badge,
.deal-badge {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0 0.45rem;
  color: #fff;
  border-radius: 999px;
  background: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
}

.deal-badge {
  top: 0.55rem;
  bottom: auto;
  background: rgba(5, 5, 5, 0.74);
}

.add-btn {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: var(--black);
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  transition:
    transform 170ms ease,
    background-color 170ms ease;
}

.add-btn.is-added {
  transform: scale(1.14);
  background: var(--red);
  color: #fff;
}

.product-card__body {
  display: grid;
  gap: 0.28rem;
  padding: 0.65rem 0.7rem 0.8rem;
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.price-line strong {
  color: #15965a;
  font-size: 1.08rem;
  line-height: 1;
}

.price-line s {
  color: #a6a8ae;
  font-size: 0.82rem;
}

.product-card h3 {
  display: -webkit-box;
  min-height: 2.3em;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.14;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card p {
  display: -webkit-box;
  min-height: 2.1em;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  color: #54575f;
  font-size: 0.78rem;
  font-weight: 800;
}

.meta-line b {
  color: var(--green);
}

.page-view {
  padding: 0.45rem 1rem 1.2rem;
}

.page-view[hidden] {
  display: none;
}

.page-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.45rem 0 1rem;
}

.back-btn {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
}

.page-header h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.05;
}

.page-header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.page-count {
  align-self: center;
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  background: #fff0f1;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 950;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.tag-grid .product-card {
  min-width: 0;
  min-height: 0;
}

.product-card {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.product-card:active {
  transform: scale(0.985);
}

.product-card:focus-visible,
.back-btn:focus-visible,
.detail-add-btn:focus-visible {
  outline: 3px solid rgba(229, 9, 20, 0.28);
  outline-offset: 3px;
}

.product-detail {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.product-gallery {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.75rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: linear-gradient(180deg, #fff5f5, #fff);
}

.product-gallery::-webkit-scrollbar {
  display: none;
}

.product-gallery figure {
  flex: 0 0 38%;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface-2);
  scroll-snap-align: start;
}

.product-gallery figure.is-main {
  flex-basis: 84%;
}

.product-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.product-detail__body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.detail-tags span,
.detail-tags button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0 0.65rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: #4d5059;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.detail-tags button {
  color: var(--red);
  background: #fff0f1;
}

.product-detail h1,
.product-detail p {
  margin: 0;
}

.product-detail h1 {
  font-size: 1.65rem;
  line-height: 1.05;
}

.product-detail p {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.35;
}

.detail-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
}

.detail-price strong {
  color: #13945a;
  font-size: 1.85rem;
  line-height: 1;
}

.detail-price s {
  color: #a6a8ae;
  font-size: 1rem;
}

.detail-price span {
  padding: 0.25rem 0.48rem;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 950;
}

.detail-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.35rem;
  border: 0;
  border-radius: 16px;
  background: var(--red);
  color: #fff;
  font-weight: 950;
}

.detail-checkout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.1rem;
  border: 1px solid rgba(229, 9, 20, 0.22);
  border-radius: 16px;
  background: #fff4f5;
  color: var(--red);
  font-weight: 950;
}

.compact-section {
  padding-top: 1rem;
}

.product-modal,
.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  pointer-events: none;
}

.payment-modal {
  z-index: 170;
}

.product-modal[aria-hidden="true"],
.payment-modal[aria-hidden="true"] {
  visibility: hidden;
}

.product-modal[aria-hidden="false"],
.payment-modal[aria-hidden="false"] {
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  transition: opacity 180ms ease;
}

.product-modal[aria-hidden="false"] .modal-backdrop,
.payment-modal[aria-hidden="false"] .modal-backdrop {
  opacity: 1;
}

.product-modal__panel,
.payment-panel {
  position: relative;
  align-self: end;
  justify-self: center;
  width: min(100%, 34rem);
  max-height: 92svh;
  overflow-y: auto;
  padding: 0.85rem 1rem calc(1rem + var(--safe-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.18);
  transform: translateY(100%);
  transition: transform 230ms ease;
}

.product-modal[aria-hidden="false"] .product-modal__panel,
.payment-modal[aria-hidden="false"] .payment-panel {
  transform: translateY(0);
}

.product-modal__header,
.payment-header {
  position: sticky;
  top: -0.85rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -1rem;
  padding: 0.65rem 1rem 0.85rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.product-modal__header p,
.payment-header p {
  margin: 0;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.product-modal__header h2,
.payment-header h2 {
  margin: 0.08rem 0 0;
  font-size: 1.42rem;
  line-height: 1.05;
}

.product-detail--modal {
  box-shadow: none;
}

.modal-related {
  padding-top: 0.9rem;
}

@media (max-width: 719px) {
  .product-modal__panel {
    max-height: calc(100svh - 5.15rem - var(--safe-bottom));
    margin-bottom: calc(4.85rem + var(--safe-bottom));
    border-radius: 24px 24px 0 0;
  }

  .product-detail--modal .product-gallery,
  .product-detail--page .product-gallery {
    display: block;
    overflow: hidden;
    padding: 0.6rem;
    background: #fff;
  }

  .product-detail--modal .product-gallery figure,
  .product-detail--page .product-gallery figure {
    display: none;
  }

  .product-detail--modal .product-gallery figure.is-main,
  .product-detail--page .product-gallery figure.is-main {
    display: block;
    width: 100%;
    border-radius: 18px;
    background: #f6f1ef;
  }

  .product-detail--modal .product-gallery img,
  .product-detail--page .product-gallery img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
  }

  .product-detail--modal .product-gallery img {
    max-height: min(32svh, 18rem);
  }

  .product-detail--page .product-gallery img {
    max-height: min(42svh, 22rem);
  }

  .product-detail--modal .product-detail__body {
    padding-bottom: calc(5.75rem + var(--safe-bottom));
  }
}

.checkout-page {
  display: grid;
  gap: 0.85rem;
}

.checkout-column {
  display: grid;
  gap: 0.8rem;
}

.checkout-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.checkout-section-title h2,
.checkout-section-title p {
  margin: 0;
}

.checkout-section-title p {
  color: var(--muted);
  font-weight: 800;
}

.checkout-items {
  display: grid;
  gap: 0.65rem;
}

.checkout-item {
  display: grid;
  grid-template-columns: 4.8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.checkout-item img {
  width: 4.8rem;
  height: 4.8rem;
  object-fit: cover;
  border-radius: 15px;
}

.checkout-item h3,
.checkout-item p {
  margin: 0;
}

.checkout-item h3 {
  overflow: hidden;
  font-size: 0.95rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.checkout-item p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.checkout-fee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.78rem 0.9rem;
  border: 1px dashed rgba(34, 182, 107, 0.45);
  border-radius: 16px;
  background: #f0fff6;
  color: #145b38;
  font-weight: 950;
}

.checkout-fee strong {
  color: var(--green);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.service-choice {
  display: block;
}

.service-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.service-choice span,
.payment-current {
  display: grid;
  gap: 0.22rem;
  min-height: 5rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.service-choice span {
  align-content: center;
}

.service-choice svg,
.payment-current svg {
  color: var(--red);
}

.service-choice b,
.payment-current b {
  color: var(--text);
  font-size: 0.98rem;
}

.service-choice small,
.payment-current small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 780;
}

.service-choice input:checked + span {
  border-color: rgba(229, 9, 20, 0.42);
  background: #fff4f5;
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.08);
}

.form-grid {
  display: grid;
  gap: 0.65rem;
}

.delivery-address-fields {
  display: grid;
  gap: 0.65rem;
}

.delivery-address-fields[hidden] {
  display: none;
}

.pickup-address {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.35;
}

.pickup-card small {
  color: var(--muted);
  font-weight: 760;
}

.payment-current {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 4.5rem;
  border: 1px solid rgba(229, 9, 20, 0.2);
  background: #fff4f5;
  color: var(--text);
  text-align: left;
}

.checkout-actions {
  display: grid;
  gap: 0.65rem;
}

.finalize-btn,
.confirm-payment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.35rem;
  border: 0;
  border-radius: 16px;
  background: var(--red);
  color: #fff;
  font-weight: 950;
}

.whatsapp-btn.is-secondary {
  color: var(--red);
  border: 1px solid rgba(229, 9, 20, 0.24);
  background: #fff4f5;
}

.payment-panel {
  width: min(calc(100% - 1rem), 30rem);
  padding-bottom: calc(1rem + var(--safe-bottom));
}

.payment-options {
  display: grid;
  gap: 0.65rem;
  padding: 0.3rem 0 0.9rem;
}

.payment-option {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  align-items: center;
  gap: 0.2rem 0.75rem;
  min-height: 4.9rem;
  padding: 0.82rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.payment-option svg,
.payment-option .pix-mark {
  grid-row: span 2;
  justify-self: center;
}

.payment-option strong,
.payment-option small {
  display: block;
}

.payment-option strong {
  font-size: 1rem;
}

.payment-option small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.payment-option.is-selected {
  border-color: rgba(229, 9, 20, 0.42);
  background: linear-gradient(135deg, #fff5f6 0%, #fff 100%);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.08);
}

.confirm-payment {
  width: 100%;
}

.pix-mark {
  position: relative;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
}

.pix-mark i {
  position: absolute;
  width: 0.82rem;
  height: 0.82rem;
  border-radius: 0.18rem;
  background: #21b68b;
  transform: rotate(45deg);
}

.pix-mark i:nth-child(1) {
  top: 0.1rem;
}

.pix-mark i:nth-child(2) {
  right: 0.1rem;
}

.pix-mark i:nth-child(3) {
  bottom: 0.1rem;
}

.pix-mark i:nth-child(4) {
  left: 0.1rem;
}

.checkout-grand-total {
  align-self: center;
  color: var(--red);
  font-size: 1.15rem;
}

.floating-cart {
  position: fixed;
  left: 50%;
  bottom: calc(4.7rem + var(--safe-bottom));
  z-index: 135;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  width: min(calc(100% - 1.35rem), 31rem);
  padding: 0.72rem 0.72rem 0.72rem 0.95rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  --cart-x: -50%;
  transform: translateX(var(--cart-x));
}

.floating-cart[hidden] {
  display: none;
}

.floating-cart.is-bumping {
  animation: cartBump 320ms ease;
}

.floating-cart small,
.floating-cart strong {
  display: block;
}

.floating-cart small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.floating-cart strong {
  font-size: 1.16rem;
}

.floating-cart button {
  min-height: 3rem;
  padding: 0 1.1rem;
  color: #fff;
  border: 0;
  border-radius: 14px;
  background: var(--red);
  font-size: 1rem;
  font-weight: 950;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 140;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 32rem);
  padding: 0.42rem 0.55rem calc(0.45rem + var(--safe-bottom));
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.08);
  transform: translateX(-50%);
}

.tabbar a,
.tabbar button {
  position: relative;
  display: grid;
  min-height: 3.85rem;
  place-items: center;
  gap: 0.1rem;
  color: #62656d;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 850;
}

.tabbar .is-active {
  color: var(--black);
}

.tabbar .is-active svg {
  fill: var(--black);
}

.tabbar strong {
  right: 1rem;
  top: 0.25rem;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  pointer-events: none;
}

.sheet[aria-hidden="true"] {
  visibility: hidden;
}

.sheet[aria-hidden="false"] {
  visibility: visible;
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 180ms ease;
}

.sheet[aria-hidden="false"] .sheet-backdrop {
  opacity: 1;
}

.sheet-panel {
  position: relative;
  align-self: end;
  justify-self: center;
  width: min(100%, 32rem);
  max-height: 92svh;
  overflow-y: auto;
  padding: 0.55rem 1rem calc(1rem + var(--safe-bottom));
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  transform: translateY(100%);
  transition: transform 230ms ease;
}

.sheet[aria-hidden="false"] .sheet-panel {
  transform: translateY(0);
}

.sheet-handle {
  width: 3.4rem;
  height: 0.32rem;
  margin: 0.35rem auto 0.7rem;
  border-radius: 999px;
  background: #d8dbe1;
}

.sheet-header {
  position: sticky;
  top: -0.55rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -1rem;
  padding: 0.5rem 1rem 0.85rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.sheet-header p {
  margin: 0;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

.sheet-header h2 {
  margin: 0;
  font-size: 1.55rem;
}

.close-btn {
  width: 2.6rem;
  height: 2.6rem;
  color: var(--text);
  border-radius: 50%;
  background: var(--surface-2);
}

.cart-items {
  display: grid;
  gap: 0.65rem;
  padding: 0.3rem 0 0.9rem;
}

.empty-cart {
  padding: 1.2rem;
  color: var(--muted);
  border-radius: 18px;
  background: var(--surface-2);
  text-align: center;
  font-weight: 750;
}

.cart-item {
  display: grid;
  grid-template-columns: 4.7rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.cart-item img {
  width: 4.7rem;
  height: 4.7rem;
  object-fit: cover;
  border-radius: 15px;
}

.cart-item h3,
.cart-item p {
  margin: 0;
}

.cart-item h3 {
  overflow: hidden;
  font-size: 0.95rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cart-item p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.quantity {
  display: grid;
  grid-template-columns: 2rem 1.5rem 2rem;
  align-items: center;
  gap: 0.2rem;
}

.quantity button {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
}

.quantity span {
  font-weight: 950;
  text-align: center;
}

.checkout-form {
  display: grid;
  gap: 0.8rem;
}

.checkout-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.checkout-card h3 {
  margin: 0;
  font-size: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: #565963;
  font-size: 0.82rem;
  font-weight: 850;
}

input,
textarea {
  width: 100%;
  min-height: 2.85rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: var(--surface-2);
  padding: 0.75rem 0.82rem;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(229, 9, 20, 0.55);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.11);
}

.delivery-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3rem;
  align-items: end;
  gap: 0.5rem;
}

.delivery-actions button,
.ghost-action,
.pix-btn,
.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.9rem;
  border: 0;
  border-radius: 14px;
  font-weight: 950;
}

.delivery-actions button {
  color: #fff;
  background: var(--black);
}

.ghost-action,
.pix-btn {
  color: var(--text);
  background: var(--surface-2);
}

.delivery-feedback {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 750;
}

.delivery-feedback.is-ok {
  color: #11874f;
}

.delivery-feedback.is-alert {
  color: #b66b08;
}

.delivery-feedback.is-out {
  color: var(--red-dark);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.segmented + .segmented {
  grid-template-columns: repeat(2, 1fr);
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.segmented span {
  display: grid;
  min-height: 2.65rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: #5d6068;
}

.segmented input:checked + span {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.sheet-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem;
  border-radius: 18px;
  background: #fff3f4;
}

.sheet-total span {
  color: var(--muted);
  font-weight: 900;
}

.sheet-total strong {
  color: var(--red);
  font-size: 1.35rem;
}

.whatsapp-btn {
  min-height: 3.35rem;
  color: #fff;
  background: var(--red);
  font-size: 1rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(8.5rem + var(--safe-bottom));
  z-index: 120;
  width: min(calc(100% - 2rem), 28rem);
  padding: 0.85rem 1rem;
  color: #fff;
  border-radius: 16px;
  background: rgba(20, 20, 20, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 1rem);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fly-img {
  position: fixed;
  z-index: 200;
  width: 4.8rem;
  height: 4.8rem;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  transition:
    transform 620ms cubic-bezier(0.16, 0.9, 0.25, 1),
    opacity 620ms ease;
}

.add-burst {
  position: fixed;
  z-index: 210;
  width: 0;
  height: 0;
  pointer-events: none;
}

.add-burst span {
  position: absolute;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 2px rgba(255, 217, 10, 0.28);
  animation: burstDot 560ms ease-out forwards;
}

.add-burst span:nth-child(2) {
  background: var(--red);
  animation-delay: 25ms;
}

.add-burst span:nth-child(3) {
  background: var(--green);
  animation-delay: 45ms;
}

.add-burst span:nth-child(4) {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.16);
  animation-delay: 70ms;
}

.add-burst span:nth-child(5) {
  background: var(--orange);
  animation-delay: 90ms;
}

@keyframes cartBump {
  0%,
  100% {
    transform: translateX(var(--cart-x)) scale(1);
  }
  45% {
    transform: translateX(var(--cart-x)) scale(1.035);
  }
}

@keyframes burstDot {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.35);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, -34px))) scale(1);
  }
}

.add-burst span:nth-child(1) {
  --x: -28px;
  --y: -34px;
}

.add-burst span:nth-child(2) {
  --x: 32px;
  --y: -26px;
}

.add-burst span:nth-child(3) {
  --x: -22px;
  --y: 28px;
}

.add-burst span:nth-child(4) {
  --x: 28px;
  --y: 30px;
}

.add-burst span:nth-child(5) {
  --x: 0px;
  --y: -44px;
}

@media (min-width: 720px) {
  body {
    padding: 1.2rem 0;
  }

  .app-shell {
    max-width: 32rem;
    min-height: calc(100svh - 2.4rem);
    border-radius: 30px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.16);
  }

  .app-header {
    border-radius: 30px 30px 0 0;
  }

  .app-header .round-btn {
    position: absolute;
  }

  .tabbar,
  .floating-cart {
    max-width: 32rem;
  }

  .tabbar {
    border-radius: 24px 24px 0 0;
  }
}

@media (min-width: 1024px) {
  body {
    padding: 0;
  }

  .app-shell {
    max-width: none;
    min-height: 100svh;
    border-radius: 0;
    box-shadow: none;
    padding-bottom: 5.4rem;
  }

  .app-header {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
    align-items: center;
    gap: 0.75rem 1.35rem;
    padding: 1rem clamp(2rem, 4vw, 5rem) 0.9rem;
  }

  .address-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-right: 0;
  }

  .app-header .round-btn {
    position: fixed;
    right: clamp(2rem, 4vw, 5rem);
    top: 1rem;
    justify-self: end;
  }

  .search-box {
    margin-top: 0;
  }

  .perks-strip {
    grid-column: 1 / -1;
    margin: 0.2rem 0 0;
    padding: 0;
  }

  .app-main {
    padding: 0 clamp(2rem, 4vw, 5rem) 1.6rem;
  }

  .category-rail,
  .promo-rail,
  .horizontal-list,
  .section-title,
  .page-view {
    padding-left: 0;
    padding-right: 0;
  }

  .category-rail {
    gap: 1.15rem;
  }

  .category-pill {
    flex-basis: 5.65rem;
  }

  .category-pill img {
    width: 5rem;
    height: 5rem;
  }

  .promo-card {
    flex-basis: clamp(28rem, 31vw, 36rem);
    min-height: 9.5rem;
  }

  .product-card {
    flex-basis: clamp(16rem, 18vw, 20rem);
    min-height: 21rem;
  }

  .tag-grid {
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  }

  .product-modal__panel {
    align-self: center;
    width: min(1120px, calc(100% - 4rem));
    max-height: min(88svh, 820px);
    padding: 1rem;
    border-radius: 30px;
    transform: translateY(1rem) scale(0.98);
  }

  .product-modal[aria-hidden="false"] .product-modal__panel {
    transform: translateY(0) scale(1);
  }

  .product-modal__header {
    top: -1rem;
    margin: 0 -1rem;
    padding: 0.8rem 1rem 1rem;
  }

  .product-detail--modal {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
    align-items: stretch;
  }

  .product-gallery {
    min-width: 0;
    padding: 1rem;
  }

  .product-detail--modal .product-gallery {
    display: grid;
    place-items: center;
    overflow: hidden;
    scroll-snap-type: none;
  }

  .product-detail--modal .product-gallery figure {
    display: none;
  }

  .product-detail--modal .product-gallery figure.is-main {
    display: block;
    width: 100%;
    max-width: min(100%, 34rem);
    flex-basis: auto;
  }

  .product-detail--modal .product-gallery img {
    width: 100%;
    max-height: min(62svh, 34rem);
    aspect-ratio: 1;
    object-fit: contain;
    object-position: center;
    background: #f6f1ef;
  }

  .product-detail__body {
    align-content: start;
    padding: 1.5rem;
  }

  .modal-related .horizontal-list {
    padding-bottom: 0;
  }

  body[data-view="checkout"] .page-view {
    width: min(1180px, 100%);
    margin: 0 auto;
  }

  .checkout-page {
    grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 1.15rem;
  }

  .checkout-summary {
    position: sticky;
    top: 8.6rem;
  }

  .checkout-form.checkout-column {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1rem;
  }

  .checkout-card,
  .checkout-summary {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    padding: 1rem;
  }

  .checkout-service,
  .checkout-submit {
    grid-column: 1 / -1;
  }

  .checkout-submit {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    padding: 1rem;
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .floating-cart {
    right: clamp(2rem, 4vw, 5rem);
    left: auto;
    bottom: 1.35rem;
    width: min(28rem, calc(100% - 4rem));
    --cart-x: 0;
  }

  .tabbar {
    display: none;
  }

  .payment-panel {
    width: min(34rem, calc(100% - 3rem));
    border-radius: 28px;
    align-self: center;
    transform: translateY(1rem) scale(0.98);
  }

  .payment-modal[aria-hidden="false"] .payment-panel {
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 360px) {
  .product-card {
    flex-basis: 9.5rem;
  }

  .promo-card {
    flex-basis: 19rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
