/* ==========================================================================
   jun.beaty — оформление заказа
   ========================================================================== */

:root {
  /* Палитра из фрейма colors */
  --c-pink:  #e9d6db;
  --c-blue:  #dce8ee;
  --c-cream: #f7f2eb;
  --c-sage:  #a8b7a6;
  --c-dark:  #34343a;

  /* Производные оттенки макета */
  --c-bg:            #faf7f3;
  --c-field-bg:      #fdfdfb;
  --c-field-border:  #d3d2d0;
  --c-muted:         #6a656a;
  --c-option-bg:     #f1eae9;
  --c-check-border:  #bdc8c3;

  --radius:    6px;
  --radius-lg: 16px;

  --gutter: 16px;
  --content: 1280px;

  --font: "Manrope", "Segoe UI", Arial, sans-serif;
}

/* ---------- base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-dark);
  font: 400 16px/1.44 var(--font);
}

h1, h2, p, ul, figure, fieldset { margin: 0; }
ul { padding: 0; list-style: none; }
fieldset { padding: 0; border: 0; }
img, svg { display: block; max-width: 100%; }

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

button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--c-sage);
  outline-offset: 2px;
}

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

/* ---------- шапка ---------- */

.topbar {
  padding: 16px var(--gutter);
  background: var(--c-bg);
}

.topbar__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 16px;
  max-width: var(--content);
  min-height: 59px;
  margin: 0 auto;
}

.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 24px;
  height: 59px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.burger__line {
  height: 2px;
  background: var(--c-dark);
  border-radius: 1px;
}

.topbar__schedule,
.topbar__contacts { display: none; }

.topbar__schedule {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.topbar__contacts {
  margin-top: 4px;
  text-align: right;
  line-height: 1.2;
}

.topbar__phone {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.topbar__mail {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
}

.topbar__logo {
  grid-column: 2;
  justify-self: center;
}

.topbar__logo img { width: 90px; height: auto; }

/* ---------- полоса страницы ---------- */

.pagebar {
  padding: 0 var(--gutter);
  background: var(--c-blue);
}

.pagebar__inner {
  position: relative;
  display: flex;
  align-items: center;
  max-width: var(--content);
  min-height: 48px;
  margin: 0 auto;
}

.pagebar__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--c-dark);
}

.pagebar__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- каркас контента ---------- */

.checkout { padding: 32px var(--gutter) 0; }

.checkout__inner {
  max-width: var(--content);
  margin: 0 auto;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* ---------- форма ---------- */

.checkout__form > .section-title { margin-bottom: 33px; }

.form__row { margin-bottom: 17px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 17px;
}

.form__details .field { margin-bottom: 0; }

.field__label {
  color: var(--c-muted);
  font-size: 16px;
  line-height: 1.44;
}

.field__control {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--c-field-border);
  border-radius: var(--radius);
  background: var(--c-field-bg);
  color: var(--c-dark);
  font: inherit;
  line-height: 1.44;
}

.field__control::placeholder {
  color: var(--c-dark);
  opacity: 1;
}

.field__control--area {
  height: 160px;
  padding: 12px;
  resize: vertical;
}

/* выпадающие списки */

.field__select {
  position: relative;
  display: block;
}

.field__select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 9px;
  height: 6px;
  transform: translateY(-50%);
  background: var(--c-dark);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}

.field__select select {
  appearance: none;
  padding-right: 36px;
  cursor: pointer;
}

.field__control--placeholder:invalid { color: var(--c-dark); }

/* телефон */

.field__phone {
  display: flex;
  height: 48px;
  border: 1px solid var(--c-field-border);
  border-radius: var(--radius);
  background: var(--c-field-bg);
}

.field__select--code { flex: 0 0 auto; }
.field__select--code::after { right: 12px; }

.field__code {
  appearance: none;
  height: 46px;
  padding: 0 29px 0 12px;
  border: 0;
  background: none;
  color: var(--c-dark);
  font: inherit;
  cursor: pointer;
}

.field__control--phone {
  height: 46px;
  padding-left: 0;
  border: 0;
  background: none;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* блок «Детали» */

.form__details { margin-top: 49px; }
.form__details .section-title { margin-bottom: 8px; }
.form__details .field { gap: 8px; }

/* ---------- карточка заказа ---------- */

.order {
  margin-top: 50px;
  padding: 24px var(--gutter);
  border-radius: var(--radius-lg);
  background: var(--c-pink);
}

.order__title {
  margin-bottom: 25px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0;
  text-transform: uppercase;
}

.order__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.order__row--head  { border-bottom: 1px solid var(--c-check-border); }
.order__row--bordered {
  border-top: 1px solid var(--c-cream);
  border-bottom: 1px solid var(--c-cream);
}

.order__item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  margin: 16px 0;
}

.order__thumb {
  width: 84px;
  height: 84px;
  border-radius: var(--radius);
  background: var(--c-cream);
  object-fit: cover;
}

.order__name {
  margin-top: 8px;
  color: var(--c-muted);
  font-family: "Lato", var(--font);
  font-size: 14px;
  line-height: 1.2;
}

.order__price {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.order__row--plain {
  margin-top: 32px;
  border: 0;
}

/* способы доставки */

.order__delivery {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.shipping {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: var(--radius);
  background: var(--c-option-bg);
  cursor: pointer;
}

.shipping__input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
}

.shipping__mark {
  position: relative;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid var(--c-dark);
  border-radius: 50%;
}

.shipping__input:checked + .shipping__mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--c-dark);
}

.shipping__input:focus-visible + .shipping__mark {
  outline: 2px solid var(--c-sage);
  outline-offset: 2px;
}

.shipping__name {
  flex: 1 1 auto;
  font-size: 16px;
  line-height: 1.2;
}

.shipping__price {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

/* согласия */

.order__delivery + .order__row--bordered { margin-top: 32px; }

.order__row--bordered + .consent { margin-top: 32px; }

.consent {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  cursor: pointer;
}

.consent__input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
}

.consent__box {
  position: relative;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid var(--c-check-border);
  border-radius: 5px;
  background: #fff;
}

.consent__input:checked + .consent__box::after {
  content: "";
  position: absolute;
  top: 3px; left: 6px;
  width: 5px; height: 9px;
  border: solid var(--c-dark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent__input:focus-visible + .consent__box {
  outline: 2px solid var(--c-sage);
  outline-offset: 2px;
}

.consent__text {
  color: var(--c-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

/* кнопка и сноска */

.order__submit {
  display: block;
  width: 100%;
  height: 56px;
  margin-top: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--c-dark);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .2s ease;
}

.order__submit:hover { opacity: .85; }

.order__note {
  margin-top: 16px;
  color: var(--c-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

/* ---------- подвал ---------- */

.footer {
  margin-top: 48px;
  padding: 26px var(--gutter) 56px;
  background: var(--c-dark);
  color: var(--c-cream);
}

.footer__inner {
  max-width: var(--content);
  margin: 0 auto;
}

.footer__logo img { width: 120px; height: auto; }

.footer__links {
  margin-top: 39px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 1.2;
}

.footer__legal {
  margin-top: 48px;
  font-size: 14px;
  line-height: 1.2;
}

/* ==========================================================================
   Планшет
   ========================================================================== */

@media (min-width: 768px) {
  :root { --gutter: 40px; }

  .form__row--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .form__row--split .field { margin-bottom: 0; }
}

/* ==========================================================================
   Десктоп
   ========================================================================== */

@media (min-width: 1024px) {
  :root { --gutter: 80px; }

  .topbar { padding-bottom: 16px; }
  .topbar__inner { min-height: 59px; }
  .topbar__logo img { width: 90px; }

  .burger { display: none; }

  .topbar__schedule,
  .topbar__contacts { display: block; }

  .pagebar__inner { min-height: 64px; }
  .pagebar__title { font-size: 22px; }

  .checkout { padding-top: 64px; padding-bottom: 0; }

  .checkout__inner {
    display: grid;
    grid-template-columns: minmax(0, 632fr) minmax(0, 524fr);
    column-gap: 124px;
    align-items: start;
  }

  .checkout__form > .section-title { margin-top: 16px; margin-bottom: 40px; }

  .order {
    position: sticky;
    top: 24px;
    margin-top: 0;
    padding: 24px;
  }

  .order__item { gap: 16px 40px; }

  .order__note { max-width: 392px; }

  .footer {
    margin-top: 82px;
    padding: 28px var(--gutter) 38px;
  }

  .footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 632fr) minmax(0, 524fr);
    column-gap: 124px;
    align-items: start;
  }

  .footer__cols {
    display: grid;
    grid-template-columns: 304px minmax(0, auto);
    margin-top: 12px;
  }

  .footer__links { margin-top: 0; }
  .footer__legal { margin-top: 0; }
}

/* ==========================================================================
   Печать / доступность
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
