:root {
  --green: #315b35;
  --green-dark: #1e3d24;
  --cream: #f7f5ef;
  --sand: #e8e0cf;
  --orange: #e87535;
  --text: #242821;
  --muted: #6f766b;
  --white: #ffffff;
  --shadow: 0 14px 35px rgba(36, 40, 33, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--cream);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.header,
.catalog,
.benefits,
.article,
.footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: var(--green-dark);
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
}

.logo span {
  margin-left: 6px;
  color: var(--orange);
}

.header__button,
.button {
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
}

.header__button {
  padding: 11px 17px;
  color: var(--green-dark);
  background: transparent;
  border: 1px solid var(--green);
}

.button {
  display: inline-flex;
  justify-content: center;
  padding: 14px 22px;
}

.button:hover,
.header__button:hover {
  transform: translateY(-2px);
}

.button--primary {
  color: var(--white);
  background: var(--green);
}

.button--primary:hover {
  background: var(--green-dark);
}

.cart-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: var(--green);
  box-shadow: 0 16px 34px rgba(30, 61, 36, 0.35);
  font-weight: 700;
  transition: transform 0.2s, background 0.2s;
}

.cart-float:hover {
  transform: translateY(-2px);
  background: var(--green-dark);
}

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

.cart-float__icon {
  font-size: 18px;
}

.cart-float__count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--white);
  font-size: 13px;
  text-align: center;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 510px;
  display: grid;
  place-items: center;
  padding: 70px 20px;
  background: var(--green-dark);
}

.hero__background,
.hero__overlay {
  position: absolute;
  inset: 0;
}

.hero__background {
  overflow: hidden;
}

.hero__slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  will-change: transform;
}

.hero__slide--cheese {
  background-image: url("cheese.jpg");
}

.hero__slide--bread {
  background-image: url("hleb.jpg");
  animation: hero-slide 42s linear infinite;
}

.hero__overlay {
  background: linear-gradient(
    90deg,
    rgba(20, 45, 24, 0.85),
    rgba(20, 45, 24, 0.35)
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  color: var(--white);
}

@keyframes hero-slide {
  0% {
    transform: translateX(-100%);
  }

  9.52% {
    transform: translateX(0);
  }

  19.05% {
    transform: translateX(0);
  }

  28.57% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__slide--bread {
    animation: none;
  }
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 710px;
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.05;
}

.hero__text {
  max-width: 530px;
  margin: 22px 0 30px;
  font-size: 18px;
  line-height: 1.55;
}

.catalog {
  padding: 80px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
}

.catalog__note {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  text-align: right;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
  scroll-margin-top: 24px;
}

.product-card:target {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.product-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--sand);
}

.product-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.product-card h3 {
  margin: 0 0 9px;
  font-size: 21px;
}

.product-card__description {
  min-height: 65px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.product-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.product-card__price {
  color: var(--green-dark);
  font-size: 20px;
  font-weight: 800;
}

.product-card__price small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.product-card__button {
  padding: 10px 14px;
  color: var(--green-dark);
  background: #e7f0e4;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
}

.product-card__button:hover {
  color: var(--white);
  background: var(--green);
}

.product-card__button.is-added {
  color: var(--white);
  background: var(--green-dark);
}

.loading {
  grid-column: 1 / -1;
  color: var(--muted);
}

.benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 0 0 80px;
}

.benefit {
  padding: 26px;
  border-radius: 16px;
  background: #e9eee3;
}

.benefit__icon {
  font-size: 28px;
}

.benefit h3 {
  margin: 14px 0 8px;
}

.benefit p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.article {
  padding: 80px 0;
}

.article__body {
  max-width: 780px;
  min-height: 240px;
  margin: 0 auto;
  padding: 30px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
  line-height: 1.65;
  white-space: pre-line;
}

.article__body p {
  margin: 0 0 16px;
  color: var(--muted);
}

.article__body p:last-child {
  margin-bottom: 0;
}

.article__body h3 {
  margin: 26px 0 10px;
  color: var(--green-dark);
  font-size: 22px;
  white-space: normal;
}

.article__body ul,
.article__body ol {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--muted);
  white-space: normal;
}

.article__cta {
  display: flex;
  width: fit-content;
  margin: 26px auto 0;
}

.article .section-heading {
  max-width: 780px;
  margin-right: auto;
  margin-left: auto;
}

.footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding: 40px 0;
  border-top: 1px solid #d8d8cf;
}

.footer__brand {
  max-width: 420px;
}

.footer__brand p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.footer__contacts {
  display: grid;
  gap: 6px;
}

.footer__contacts a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
}

.footer__contacts a:hover {
  color: var(--orange);
}

.footer__contacts p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.order-dialog {
  width: min(540px, calc(100% - 30px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.28);
}

.order-dialog::backdrop {
  background: rgba(19, 33, 20, 0.7);
}

.dialog__header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 28px 28px 0;
}

.dialog__header h2 {
  margin: 0;
  font-size: 28px;
}

.dialog__close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--green-dark);
  background: #edf0ea;
  font-size: 28px;
  line-height: 1;
}

.order-form {
  display: grid;
  gap: 15px;
  padding: 25px 28px 28px;
}

.order-form label {
  display: grid;
  gap: 7px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 700;
}

.order-form input,
.order-form textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cdd3c9;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  outline-color: var(--green);
}

.order-form textarea {
  min-height: 80px;
  resize: vertical;
}

.order-form input[readonly] {
  color: var(--muted);
  background: #f1f3ef;
}

.order-cart {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f1f3ef;
}

.order-cart__title {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.order-cart__empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.order-cart__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 0;
  border-top: 1px solid #dde1d8;
}

.order-cart__row:first-child {
  border-top: 0;
  padding-top: 0;
}

.order-cart__info {
  flex: 1 1 150px;
  display: grid;
  gap: 2px;
}

.order-cart__name {
  font-size: 14px;
  font-weight: 700;
}

.order-cart__unit {
  color: var(--muted);
  font-size: 12px;
}

.order-cart__qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.order-cart__qty button {
  width: 26px;
  height: 26px;
  border: 1px solid #cdd3c9;
  border-radius: 6px;
  color: var(--green-dark);
  background: var(--white);
  font-weight: 700;
  line-height: 1;
}

.order-cart__qty button:hover {
  background: #e7f0e4;
}

.order-cart__sum {
  min-width: 72px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.order-cart__remove {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.order-cart__remove:hover {
  color: #b23b3b;
  background: #f7e7e7;
}

.order-cart__total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dde1d8;
  color: var(--green-dark);
  font-weight: 800;
  text-align: right;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--green);
  font-weight: 700;
}

@media (max-width: 850px) {
  .products-grid,
  .benefits {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer {
    flex-direction: column;
    gap: 28px;
  }
}

@media (max-width: 580px) {
  .header,
  .catalog,
  .benefits,
  .footer {
    width: min(100% - 28px, 1180px);
  }

  .header__button {
    padding: 9px 11px;
    font-size: 13px;
  }

  .cart-float {
    right: 14px;
    bottom: 14px;
    padding: 12px 14px;
  }

  .cart-float__label {
    display: none;
  }

  .section-heading,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog__note {
    text-align: left;
  }

  .products-grid,
  .benefits {
    grid-template-columns: 1fr;
  }

  .product-card__description {
    min-height: auto;
  }

  .dialog__header,
  .order-form {
    padding-right: 20px;
    padding-left: 20px;
  }
}
