:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-synthesis: none;
  color: #171719;
  background: #fff;
  --accent: #f20c32;
  --muted: #767980;
  --surface: #f4f4f5;
  --divider: #efeff1;
  --page-padding: 18px;
  --nav-height: 68px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button, input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 1;
}

button, a {
  touch-action: manipulation;
}

button {
  border: 0;
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

button:active:not(:disabled) {
  opacity: .75;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, p {
  margin: 0;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.app {
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 9px var(--page-padding);
}

.location {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.3px;
}

.location__pin {
  width: 21px;
  height: 25px;
  color: var(--accent);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  flex: 0 0 auto;
}

.notifications {
  margin-right: -9px;
}

main {
  padding: 0 var(--page-padding) calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 20px);
}

.search {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 48px;
  padding-left: 15px;
  background: var(--surface);
  border-radius: 16px;
}

.search__icon {
  width: 21px;
  height: 21px;
  color: #868991;
}

.search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 12px 0 0;
  border: 0;
  outline: 0;
  border-radius: 0 16px 16px 0;
  background: transparent;
  color: #171719;
  font-size: 16px;
}

.search input::placeholder {
  color: #8c8f97;
  opacity: 1;
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search:focus-within {
  box-shadow: 0 0 0 2px #f20c3226;
}

.search input:focus-visible {
  outline: none;
}

.search__clear {
  margin-left: -12px;
  color: var(--muted);
}

.search__clear .icon {
  width: 18px;
  height: 18px;
}

.categories {
  display: flex;
  gap: 8px;
  margin: 14px calc(-1 * var(--page-padding)) 17px;
  padding: 2px var(--page-padding) 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.category {
  flex: 0 0 auto;
  min-width: 59px;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 24px;
  background: var(--surface);
  font-size: 13px;
  line-height: 20px;
}

.category.is-active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.category:focus-visible {
  outline-offset: -3px;
}

.promotions {
  min-width: 0;
}

.promotions__track {
  position: relative;
  display: flex;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  border-radius: 15px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

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

.promotions__track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.promotion {
  flex: 0 0 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 15px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #241c17;
  color: #fff;
}

.promotion__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2;
  object-fit: contain;
}

.promotion__details {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 17px;
}

.promotion__delivery {
  flex: 1;
  min-width: 0;
  padding-left: 10px;
  border-left: 1px solid #ffffff45;
  font-size: 11px;
  line-height: 16px;
}

.promotions__pagination {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

.promotion-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 32px;
  padding: 0;
  background: transparent;
}

.promotion-dot span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #dedee2;
  transition: background-color .15s ease;
}

.promotion-dot[aria-pressed="true"] span {
  background: var(--accent);
}

.promotion-dot:focus-visible {
  outline-offset: -3px;
  border-radius: 8px;
}

.rating, .delivery-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.rating .icon {
  width: 17px;
  height: 17px;
  color: #ffc329;
}

.delivery-time .icon {
  width: 16px;
  height: 16px;
}

.restaurants {
  margin-top: 14px;
  scroll-margin-top: 16px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.section-heading h2 {
  font-size: 21px;
  line-height: 28px;
  letter-spacing: -.5px;
  font-weight: 700;
}

.text-button {
  min-height: 44px;
  margin-right: -5px;
  padding: 8px 5px;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
}

.restaurant-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.restaurant-item + .restaurant-item {
  border-top: 1px solid var(--divider);
}

.restaurant {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 102px;
  padding-block: 12px;
}

.restaurant__image {
  display: block;
  object-fit: cover;
  background: var(--surface);
  width: 88px;
  height: 78px;
  flex: 0 0 auto;
  border-radius: 12px;
}

.restaurant__body {
  min-width: 0;
  flex: 1;
  align-self: center;
}

.restaurant__name {
  margin: 0 26px 7px 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 20px;
  letter-spacing: -.3px;
}

.restaurant__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 14px;
  font-size: 12px;
  line-height: 18px;
}

.restaurant__meta .delivery-time {
  color: #6d7078;
}

.restaurant__meta .delivery-time .icon {
  color: #25262a;
  width: 15px;
  height: 15px;
}

.restaurant__cuisine {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.favorite {
  position: absolute;
  top: 6px;
  right: -10px;
  color: #8c8f96;
}

.favorite .icon {
  width: 20px;
  height: 20px;
  transition: fill .15s ease, color .15s ease;
}

.favorite[aria-pressed="true"] {
  color: var(--accent);
}

.favorite[aria-pressed="true"] .icon {
  fill: currentColor;
}

.empty-state {
  padding: 30px 12px 26px;
  text-align: center;
}

.empty-state > .icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 14px;
  color: #979aa1;
}

.empty-state h3 {
  font-size: 18px;
  line-height: 25px;
}

.empty-state p {
  max-width: 270px;
  margin: 8px auto 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 21px;
}

.reset-button {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.noscript-message {
  padding: 20px 0;
  font-size: 14px;
  line-height: 1.5;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: 480px;
  min-height: var(--nav-height);
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  border-top: 1px solid #f1f1f3;
  background: #fff;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 53px;
  padding: 3px 0;
  background: transparent;
  color: #85888f;
  font-size: 10px;
  line-height: 15px;
  text-decoration: none;
}

.nav-item .icon {
  width: 23px;
  height: 23px;
}

.nav-item--active {
  color: var(--accent);
  font-weight: 500;
}

.nav-item--active .icon {
  fill: currentColor;
  stroke-width: 1.5;
}

@media (max-width: 359px) {
  :root {
    --page-padding: 14px;
  }

  .promotion__details {
    gap: 8px;
    padding-inline: 10px;
    font-size: 11px;
  }

  .promotion__delivery {
    padding-left: 8px;
    font-size: 10px;
  }

  .restaurant {
    gap: 10px;
  }

  .restaurant__image {
    width: 76px;
    height: 74px;
  }

  .restaurant__name {
    font-size: 14px;
  }

  .restaurant__meta {
    gap: 5px 10px;
  }

  .restaurant__cuisine {
    font-size: 11px;
  }

}

@media (min-width: 600px) {
  .app {
    padding-top: 16px;
  }

  .topbar {
    min-height: 76px;
  }

}

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

}
