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

* {
  box-sizing: border-box;
}

body {
  --page-width: clamp(min(34rem, 100% - 2rem), 72%, 115.25rem);

  margin: 0;
  background: #fff;
  color: #080808;
  font-family: system-ui, sans-serif;
}

img {
  display: block;
  height: auto;
}

.site-header {
  border-bottom: clamp(1px, 0.078vw, 2px) solid #222;
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(41.5%, 66.5rem);
  min-height: clamp(4rem, 6.95vw, 11.125rem);
  margin-inline: auto;
}

.wordmark {
  width: clamp(8rem, 16.25vw, 26rem);
  min-height: 2.75rem;
  transform: translateY(-0.14vw);
}

.wordmark img {
  width: 100%;
}

.header-button,
.wordmark {
  padding: 0;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  cursor: pointer;
}

.header-button {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(2.75rem, 2.8vw, 4.5rem);
  aspect-ratio: 1;
}

.header-button--search {
  justify-self: start;
}

.header-button--search img {
  width: clamp(1.375rem, 2.42vw, 3.875rem);
}

.header-button--bag {
  justify-self: end;
}

.header-button--bag img {
  width: clamp(1.25rem, 2.23vw, 3.5625rem);
}

.cart-count {
  position: absolute;
  inset: 0 0 auto auto;
  min-width: 1.25rem;
  padding: 0.15rem 0.3rem;
  border-radius: 2rem;
  background: #374742;
  color: #fff;
  font: 700 0.75rem/1.25 system-ui, sans-serif;
}

main {
  padding-block-start: clamp(2rem, 4.05vw, 6.5rem);
}

.hero {
  --banner-radius: clamp(1.25rem, 2.8vw, 4.5rem);

  position: relative;
  container-type: inline-size;
  width: var(--page-width);
  aspect-ratio: 1844 / 442;
  margin-inline: auto;
  border-radius: var(--banner-radius);
  background: linear-gradient(
    #e3e7e6,
    #dfe3e2 11%,
    #dce0df 23%,
    #dadedd 33%,
    #d5d9d8 47%,
    #ced4d4 59%,
    #c5cbcb 72%,
    #bac3c0 83%,
    #b5bebd 93%,
    #b3bcbb
  );
}

.hero__artwork {
  position: absolute;
  inset: 0;
  clip-path: inset(-100% 0 0 0 round 0 0 var(--banner-radius) 0);
}

.hero__artwork img {
  position: absolute;
  inset: auto 0 0 auto;
  width: 31.1%;
}

.hero__motifs {
  position: absolute;
  inset: 8.1% auto auto 3.4%;
  width: 15.8%;
}

.hero__heading {
  position: absolute;
  inset: 37% auto auto 3.75%;
  margin: 0;
  font: 400 4.68cqw/1.2 Pacifico, cursive;
  white-space: nowrap;
}

.hero__speech {
  position: absolute;
  inset: auto 27% 88% auto;
  z-index: 1;
  margin: 0;
  color: #283a33;
  font-size: 0.875rem;
  font-weight: 600;
  pointer-events: none;
}

.hero__speech:not(:empty) {
  padding: 0.55rem 0.8rem;
  border: 1px solid #bac5c1;
  border-radius: 0.85rem 0.85rem 0.25rem 0.85rem;
  background: #fff;
}

.catalog {
  width: var(--page-width);
  margin: clamp(3rem, 4.1vw, 6.5rem) auto 3.5rem;
}

.catalog__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-block-end: 1.25rem;
}

.catalog__header h2 {
  margin: 0;
  font: 400 clamp(1.85rem, 2.75vw, 3rem)/1.3 Pacifico, cursive;
}

.catalog__header p {
  margin: 0;
  color: #505d57;
  font-size: 0.875rem;
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.65rem, 1.35vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dce3df;
  border-radius: 1rem;
  background: #fff;
}

.product-card__image {
  width: 100%;
  aspect-ratio: 1.14;
  object-fit: cover;
  background: #e6ebe7;
}

.product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  padding: clamp(0.65rem, 1.2vw, 1.05rem);
}

.product-card__name {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.product-card__detail {
  margin: 0;
  color: #505d57;
  font-size: 0.875rem;
  line-height: 1.35;
}

.product-card__purchase {
  display: grid;
  gap: 0.55rem;
  margin-block-start: auto;
  padding-block-start: 0.5rem;
}

.product-card__price {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}

.product-card__add {
  padding-inline: 0.4rem;
}

.product-card__quantity:not([hidden]) {
  display: inline-block;
  min-width: 1.2rem;
  margin-inline-start: 0.15rem;
  padding-inline: 0.2rem;
  border-radius: 1rem;
  background: #f7faf7;
  color: #283a33;
  line-height: 1.2rem;
}

.shop-dialog {
  width: min(32rem, 100% - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid #b9c3bf;
  border-radius: 1.5rem;
  background: #fff;
  color: #17211d;
  box-shadow: 0 1rem 4rem #1a292528;
}

.shop-dialog::backdrop {
  background: #202a275c;
}

.shop-dialog__body {
  padding: clamp(1rem, 4vw, 2rem);
}

.shop-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block-end: 1rem;
}

.shop-dialog__header h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 650;
}

.shop-dialog__close {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eff2f0;
  color: #374742;
  font: 1.5rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.shop-search {
  display: flex;
  gap: 0.5rem;
}

.shop-search input {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #879891;
  border-radius: 0.65rem;
  color: inherit;
  font: inherit;
}

.shop-action {
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: 0.65rem;
  background: #374742;
  color: #fff;
  font: 600 0.875rem/1.3 system-ui, sans-serif;
  cursor: pointer;
}

.shop-action--secondary {
  background: #eff2f0;
  color: #374742;
}

button:focus-visible,
.shop-search input:focus-visible {
  outline: 2px solid #59796d;
  outline-offset: 2px;
}

@media (hover: hover) {
  .header-button:hover,
  .wordmark:hover {
    background: #f2f4f3;
  }

  .shop-action:hover,
  .shop-dialog__close:hover {
    filter: brightness(0.92);
  }
}

.shop-status {
  margin: 1rem 0 0;
  color: #505d57;
  overflow-wrap: anywhere;
}

.shop-status:empty,
.shop-list:empty {
  margin: 0;
}

.shop-list {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.shop-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #dde4e1;
  border-radius: 0.75rem;
}

.shop-list__item p {
  margin: 0;
  overflow-wrap: anywhere;
}

.shop-list__detail {
  color: #505d57;
  font-size: 0.875rem;
}

.shop-total:not([hidden]) {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.checkout:not([hidden]), .checkout__contacts:not([hidden]) {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.checkout__primary {
  width: 100%;
  margin-block-start: 1rem;
}

.shop-dialog--checkout {
  width: min(42rem, 100% - 1rem);
}

.checkout__search:not([hidden]) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.pickup-map {
  height: clamp(17rem, 44dvh, 25rem);
  border: 1px solid #b9c3bf;
  border-radius: 0.85rem;
  background: #e6ebe7;
  isolation: isolate;
}

.pickup-map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.65rem 0 0;
  padding: 0;
  color: #505d57;
  font-size: 0.8rem;
  list-style: none;
}

.pickup-map__legend li,
.pickup-point__brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pickup-point__logo {
  width: 2.45rem;
  height: 1.1rem;
  object-fit: contain;
}

.pickup-point__logo[src$="/rupost.svg"] {
  width: 4.7rem;
}

.pickup-map__badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 1.7rem;
  border: 2px solid var(--pickup-color);
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 2px 6px #17211d4d;
}

.pickup-map__badge::after {
  position: absolute;
  inset: 100% auto auto 50%;
  width: 0;
  height: 0;
  border-inline: 5px solid transparent;
  border-top: 6px solid var(--pickup-color);
  content: '';
  transform: translateX(-50%);
}

.pickup-map__pin--selected .pickup-map__badge {
  outline: 3px solid #17211d;
  outline-offset: 1px;
}

.pickup-map__cluster {
  display: grid;
  place-items: center;
  border: 3px solid #d8e2dd;
  border-radius: 50%;
  background: #374742;
  color: #fff;
  font: 700 0.85rem system-ui, sans-serif;
}

.pickup-map__cluster--carrier {
  border: 2px solid #c8d4cd;
  border-radius: 1.25rem;
  background: #fff;
  color: #17211d;
  box-shadow: 0 2px 6px #17211d38;
}

.pickup-map__cluster-label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.pickup-map__message,
.pickup-point p {
  margin: 0;
  overflow-wrap: anywhere;
}

.pickup-map__coverage {
  margin: 0.4rem 0 0;
}

.pickup-point:not([hidden]) {
  display: grid;
  gap: 0.4rem;
  color: #17211d;
  font: 0.875rem/1.4 system-ui, sans-serif;
}

.pickup-point--selection {
  padding: 0.7rem 0.85rem;
  border: 1px solid #c8d4cd;
  border-radius: 0.7rem;
  background: #f4f7f5;
}

.pickup-point p.pickup-point__hours {
  color: #505d57;
  font-size: 0.8rem;
  white-space: pre-line;
}

.pickup-point .shop-action {
  margin-block-start: 0.35rem;
}

.checkout__demo-note {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.65rem;
  background: #eff2f0;
  color: #374742;
  font-size: 0.875rem;
}

.checkout__field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.checkout__field :is(input, select) {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #879891;
  border-radius: 0.65rem;
  background: #fff;
  color: inherit;
  font: 400 1rem system-ui, sans-serif;
}

.checkout__field :is(input, select):focus-visible {
  outline: 2px solid #59796d;
  outline-offset: 2px;
}

.checkout__contacts {
  min-width: 0;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid #dde4e1;
  border-radius: 0.75rem;
}

.checkout__contacts legend {
  padding-inline: 0.35rem;
  font-weight: 650;
}

.checkout__totals {
  display: grid;
  gap: 0.25rem;
  margin: 0;
}

.checkout__totals div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.checkout__totals div:last-child {
  margin-block-start: 0.25rem;
  padding-block-start: 0.5rem;
  border-top: 1px solid #dde4e1;
  font-weight: 700;
}

.checkout__totals dd {
  margin: 0;
  white-space: nowrap;
}

#checkout-estimate {
  color: #505d57;
  font-size: 0.8rem;
}

#checkout-receipt p {
  margin: 0;
  overflow-wrap: anywhere;
}

.checkout__link:not([hidden]) {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.shop-action:disabled {
  opacity: 0.65;
  cursor: default;
}

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

@media (max-width: 55rem) {
  .catalog__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 37.5rem) {
  .site-header__inner {
    width: min(100% - 1.5rem, 28rem);
  }

  .wordmark {
    width: clamp(8rem, 37vw, 11rem);
  }
}

@media (max-width: 32.5rem) {
  .checkout__search:not([hidden]) {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    width: calc(100% - 2rem);
    aspect-ratio: 2.15;
  }

  .hero__artwork img {
    width: 54%;
  }

  .hero__motifs {
    inset: 12% auto auto 5%;
    width: 27%;
  }

  .hero__heading {
    inset: 38% auto auto 5%;
    font-size: 7.05cqw;
    line-height: 1.26;
  }

  .hero__heading span {
    display: block;
  }

  .hero__speech {
    inset: calc(100% + 0.4rem) 5% auto auto;
    max-width: 60%;
  }

  .catalog__header {
    display: block;
  }

  .catalog__header p {
    margin-block-start: 0.4rem;
  }
}
