/*
 * PRIVATE TIME — оформление, которое накладывается на лендинг клиента без изменения его файла:
 * корзина, оформление заказа, поля всех форм, страница курса, карточки программы лояльности.
 * Подключается сервером в <head> после стилей лендинга (src/app/route.ts).
 * Используются переменные и приёмы самого лендинга (цвета, шрифт, прописные подписи).
 */

.pt-rel { position: relative; }
.pt-hide { display: none !important; }
.pt-err { color: #e8838a; font-size: 13px; }
.pt-ok { color: var(--gold); font-size: 13px; }

/* ───── Выпадающие подсказки (город, пункт выдачи) ───── */
.pt-dd { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 4px; background: var(--night); border: 1px solid var(--gold); max-height: 300px; overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.pt-dd button { display: block; width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.35; }
.pt-dd button:last-child { border-bottom: 0; }
.pt-dd button:hover, .pt-dd button:focus { background: rgba(201, 165, 106, .1); outline: none; }
.pt-dd small { display: block; color: var(--soft); font-size: 12.5px; }
.pt-dd .pt-empty { padding: 12px 14px; color: var(--soft); font-size: 14px; }

/* ───── Поля всех форм сайта ───── */
/* Рамкой, а не одной линией снизу: видно, куда нажимать, и меньше «полос» на странице */
.field input, .field select, .field textarea { height: 50px; border: 1px solid rgba(244, 236, 226, .22); background: rgba(12, 9, 9, .45); padding: 0 14px; font-size: 16px; }
.field textarea { height: 96px; padding-top: 12px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field input[readonly] { color: var(--soft); }
/* Выпадающий список — в том же виде, со своей стрелкой */
.field select { appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }

/* ───── Программа лояльности ───── */
/* Название уровня уменьшается вместе с карточкой: длинное «Единственная» не вылезает за её край */
.tile { container-type: inline-size; }
.tile > .h1 { font-size: clamp(22px, 11cqi, 44px) !important; }

/* ───── Страницы с цветным первым блоком: курс, миссия, предзапись ───── */
/* Цветной блок начинается сразу под шапкой сайта, «крошки» лежат поверх него, а не прилипают к нему сверху */
.crumbs:has(+ .tex), .crumbs:has(+ .wine) { position: absolute; left: 0; right: 0; z-index: 3; padding-top: 30px; color: rgba(244, 236, 226, .78); }

/* ───── Страница курса «Камасутра» ───── */
.crumbs + .satin { padding-block: clamp(120px, 11vw, 180px) clamp(80px, 8vw, 120px) !important; }
/* Текст — по той же левой границе, что меню и «крошки»; заголовок на широком экране в одну строку */
.crumbs + .satin > .wrap { max-width: 1360px !important; }
@media (min-width: 1100px) { .crumbs + .satin .display { white-space: nowrap; font-size: clamp(32px, 3.3vw, 47px); } }
/* Цифры курса — цельная панель с ячейками. Стоит на том же фоне, что и следующий раздел «Три акта»:
   между красным блоком и разделом нет третьего фона, панель к красному не прилипает */
.crumbs + .satin + section { background: var(--night) !important; padding-block: clamp(48px, 6vw, 80px) 0 !important; }
.crumbs + .satin + section + section { padding-top: clamp(48px, 6vw, 80px); }
.crumbs + .satin + section .stats { padding: 0; background: rgba(12, 9, 9, .4); border: 1px solid var(--line); }
.crumbs + .satin + section .stats > div { display: flex; flex-direction: column; gap: 8px; padding: 26px 26px 28px; border-right: 1px solid var(--line); }
.crumbs + .satin + section .stats > div:last-child { border-right: 0; }
@media (max-width: 760px) {
  .crumbs + .satin + section .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .crumbs + .satin + section .stats > div { padding: 20px 18px 22px; border-bottom: 1px solid var(--line); }
  .crumbs + .satin + section .stats > div:nth-child(even) { border-right: 0; }
  .crumbs + .satin + section .stats > div:last-child { grid-column: 1 / -1; border-bottom: 0; }
}

/* ───── Корзина ───── */
/* Шапка корзины той же высоты, что шапка сайта: линии под ними на одном уровне */
.drawer .top { box-sizing: border-box; height: var(--pt-head, 76px); padding: calc(var(--pt-head, 76px) - 76px) 26px 0; }
.drawer .top .h3 { letter-spacing: .2em; font-size: 15px; }
.drawer .list { padding: 0 26px; }
.pt-ci { display: grid; grid-template-columns: 72px minmax(0, 1fr) 32px; gap: 6px 16px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--line); }
.pt-ci:last-child { border-bottom: 0; }
.pt-ci img { grid-row: span 2; width: 72px; height: 72px; object-fit: cover; }
.pt-ci-main { display: flex; flex-direction: column; min-width: 0; }
.pt-ci-cap { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--soft); }
.pt-ci-name { font-size: 20px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-ci-price { font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }
.pt-ci-rm { width: 32px; height: 32px; color: var(--soft); }
.pt-ci-rm:hover { color: var(--ivory); }
.pt-ci-row { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.pt-ci-sum { font-size: 17px; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
/* Счётчик количества: крупные кнопки, число между ними */
.pt-qty { display: inline-flex; align-items: stretch; height: 40px; border: 1px solid var(--line); }
.pt-qty button { width: 40px; color: var(--gold); transition: background .2s; }
.pt-qty button:hover { background: rgba(201, 165, 106, .12); }
.pt-qty-n { min-width: 40px; display: grid; place-items: center; border-inline: 1px solid var(--line); font-size: 15px; font-variant-numeric: tabular-nums; }
.drawer .bot { gap: 10px; }
.pt-gift { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--soft); }
.pt-gift svg { width: 18px; height: 18px; stroke: var(--gold); fill: none; stroke-width: 1.3; flex: none; }
.drawer .bot .sum.big { padding-top: 12px; border-top: 1px solid var(--line); }

/* ───── Оформление заказа: три блока вместо множества линий ───── */
.pt-co { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px 32px; padding-block: 30px 100px; align-items: start; }
@media (max-width: 900px) { .pt-co { grid-template-columns: 1fr; } }
/* Заголовок занимает всю ширину: форма и сводка заказа начинаются под ним на одной линии */
.pt-co-title { grid-column: 1 / -1; margin: 0; }
.pt-form { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pt-card { background: var(--night); border: 1px solid var(--line); padding: 26px 28px 28px; display: flex; flex-direction: column; gap: 18px; }
.pt-step { display: flex; align-items: center; gap: 14px; font-weight: 400; font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.pt-step i { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 1px solid var(--gold); font-style: normal; font-size: 12px; letter-spacing: 0; }
.pt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .pt-grid2 { grid-template-columns: 1fr; } .pt-card { padding: 22px 18px; } }
.pt-wide { grid-column: 1 / -1; }
.pt-hint { font-size: 13px; color: var(--soft); }
.pt-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pt-opts.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .pt-opts, .pt-opts.three { grid-template-columns: 1fr; } }
.pt-opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); padding: 14px 16px; cursor: pointer; transition: border-color .2s, background .2s; }
.pt-opt:has(input:checked) { border-color: var(--gold); background: rgba(201, 165, 106, .07); }
.pt-opt input { margin-top: 4px; accent-color: var(--red); flex: none; }
.pt-opt b { display: block; font-weight: 400; font-size: 15px; }
.pt-opt small { display: block; color: var(--soft); font-size: 13px; min-height: 1.6em; }
/* Переключатели: обычная галочка формы, нарисованная дорожкой с бегунком. Так же выглядят галочки согласия в формах лендинга */
.pt-switch { display: flex; align-items: center; gap: 14px; cursor: pointer; font-size: 14.5px; line-height: 1.4; }
.chk { align-items: center; gap: 14px; cursor: pointer; }
.pt-switch input, .chk input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 46px; height: 26px; margin: 0; border: 1px solid rgba(244, 236, 226, .3); border-radius: 13px; background: rgba(12, 9, 9, .45); cursor: pointer; transition: background .2s, border-color .2s; }
.pt-switch input::before, .chk input[type="checkbox"]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--soft); transition: translate .2s, background .2s; }
.pt-switch input:checked, .chk input[type="checkbox"]:checked { background: var(--red); border-color: var(--red); }
.pt-switch input:checked::before, .chk input[type="checkbox"]:checked::before { translate: 20px 0; background: var(--ivory); }
.pt-switch input:focus-visible, .chk input[type="checkbox"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .pt-switch input, .pt-switch input::before, .chk input, .chk input::before { transition: none; } }
.pt-summary { background: var(--night); border: 1px solid var(--line); padding: 26px 28px; position: sticky; top: 96px; display: flex; flex-direction: column; gap: 12px; }
.pt-summary .sum.big { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
#ptPromoNote { grid-column: 1 / -1; }
.pt-promo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 6px; }
.pt-promo .btn { height: 50px; padding: 0 18px; font-size: 11px; }
.pt-promo-label { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--soft); margin-top: 6px; }

/* ───── Заказы в личном кабинете ───── */
.pt-order { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.pt-order small { display: block; color: var(--soft); font-size: 12.5px; }

/* ───── Исправления лендинга ───── */
/* Атрибут hidden должен скрывать всегда. В лендинге у подсказки на фото набора своё правило display:flex его
   перекрывало: пустой прямоугольник был виден постоянно, а крестик (он ставит hidden) ничего не закрывал */
[hidden] { display: none !important; }
/* Крестики окон и подсказки — удобного для пальца размера */
.modal .x, .pop .px { width: 44px; height: 44px; top: 4px; right: 6px; }
.hintbtn { min-height: 40px; }
@media (max-width: 1080px) {
  .icons { gap: 6px; }
  .icons button { width: 40px; height: 40px; }
  .burger { width: 40px; height: 40px; margin-left: -10px; }
  .mnav a { padding: 15px 0; }
}
@media (max-width: 860px) {
  /* Подвал: блок о бренде на всю ширину, а не сжатой колонкой */
  .fgrid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  /* «Пять средств»: пятая ячейка на всю ширину, без оборванной линии */
  .fcap a:nth-child(even) { border-right: 0; }
  .fcap a:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
}
@media (max-width: 640px) {
  /* Подсказка открывается под фото, а не поверх него */
  #pop { position: relative; inset: auto !important; width: auto; margin-top: 14px; box-shadow: none; }
  /* Сравнение наборов помещается в экран без прокрутки вбок */
  .cmp { overflow-x: visible; }
  .cmp table { min-width: 0; table-layout: fixed; }
  .cmp th, .cmp td { padding: 12px 2px; }
  .cmp th:first-child, .cmp td:first-child { width: 36%; padding-left: 12px; font-size: 13px; line-height: 1.35; }
  .cmp th { font-size: 9.5px; letter-spacing: 0; }
  .cmp th span { font-size: 11px; letter-spacing: 0; }
  /* Окна выезжают снизу на всю ширину */
  .modal { place-items: end stretch; padding: 0; }
  .modal .box { width: 100%; max-height: 90dvh; padding: 36px 22px calc(26px + env(safe-area-inset-bottom)); border-width: 1px 0 0; border-top-color: var(--gold); animation: pt-sheet-up .3s cubic-bezier(.2, .8, .2, 1); overscroll-behavior: contain; }
}
@keyframes pt-sheet-up {
  from { translate: 0 100%; }
}

/* ───── Знаки «плюс», «минус» и «крестик»: нарисованы линиями и стоят точно по центру ───── */
/* В лендинге это буквы «+», «−», «×». Буква сидит на строке шрифта, поэтому в круге или кнопке оказывается
   не по центру. Букву прячем (для диктора у кнопок есть подписи), знак рисуем двумя линиями */
.hs, .hs-demo { font-size: 0 !important; }
.hs::before, .hs-demo::before, details summary::after, .qty button::before, .pt-qty button::before { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat; }
/* Раскрывающиеся списки: плюс плавно превращается в минус */
details summary { align-items: center; }
details summary::after { transition: background-size .3s ease, rotate .3s ease; }
details[open] summary::after { content: ""; background-size: 100% 1.5px, 1.5px 0; rotate: 180deg; }
details.pt-closing summary::after { background-size: 100% 1.5px, 1.5px 100%; rotate: 0deg; }
/* Счётчик количества: на странице набора и в корзине */
.qty button, .pt-qty button { display: grid; place-items: center; font-size: 0; }
.qty button::before, .pt-qty button::before { width: 12px; height: 12px; }
.qty button[data-q="-1"]::before, .qty button[data-cq$="|-1"]::before, .pt-qty button[data-cq$="|-1"]::before { background-size: 100% 1.5px, 0 0; }
/* Крестики: окна, подсказка на фото, корзина */
.modal .x, .pop .px, .pt-ci-rm, .drawer .top [data-act="close"] { display: grid; place-items: center; font-size: 0 !important; }
.drawer .top [data-act="close"] { width: 44px; height: 44px; margin-right: -14px; }
.modal .x::before, .pop .px::before, .pt-ci-rm::before, .drawer .top [data-act="close"]::before { content: ""; width: 17px; height: 17px; rotate: 45deg; background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat; }
.modal .x:hover, .pop .px:hover, .drawer .top [data-act="close"]:hover { color: var(--ivory) !important; }
/* Знак привязан к середине кнопки. Буква в кнопке остаётся (нулевого размера), и если знак — обычный элемент
   раскладки, кнопка делит высоту на две строки: знак уезжает вверх на несколько пикселей. Поэтому знак
   позиционируется от краёв кнопки — одинаковые отступы со всех сторон дают точную середину */
.hs-demo, .qty button, .pt-qty button, .pt-ci-rm, .drawer .top [data-act="close"] { position: relative; }
.hs::before, .hs-demo::before, .qty button::before, .pt-qty button::before, .modal .x::before, .pop .px::before, .pt-ci-rm::before, .drawer .top [data-act="close"]::before { position: absolute; inset: 0; margin: auto; }

/* ───── Сообщения внизу экрана: значок и текст ───── */
/* width: max-content — иначе блок, прижатый к середине экрана, на телефоне сжимается в узкий столбик */
.toast { display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); padding: 11px 22px 11px 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.pt-toast-ic { flex: none; position: relative; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(158, 22, 32, .1); color: var(--red); }
.pt-toast-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.pt-toast-tx { min-width: 0; line-height: 1.35; }
/* Сердечко: при добавлении «вспыхивает» и наливается цветом, при удалении — пустеет */
.toast.on .pt-ic-heart-on svg { fill: currentColor; animation: pt-heart-pop .6s cubic-bezier(.3, 1.5, .5, 1) both; }
.toast.on .pt-ic-heart-on::after { content: ""; position: absolute; inset: 0; border-radius: 50%; animation: pt-ring .7s ease-out both; }
.toast.on .pt-ic-heart-off svg { animation: pt-heart-empty .7s ease both; }
.toast.on .pt-ic-bag svg, .toast.on .pt-ic-check svg, .toast.on .pt-ic-info svg { animation: pt-ic-in .4s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes pt-heart-pop {
  0% { scale: .2; }
  55% { scale: 1.28; }
  100% { scale: 1; }
}
@keyframes pt-heart-empty {
  0% { fill: currentColor; scale: 1.15; }
  55% { scale: .8; }
  100% { fill: transparent; scale: 1; }
}
@keyframes pt-ring {
  from { box-shadow: 0 0 0 0 rgba(158, 22, 32, .45); }
  to { box-shadow: 0 0 0 12px rgba(158, 22, 32, 0); }
}
@keyframes pt-ic-in {
  from { scale: .4; opacity: 0; }
}

/* ───── Заголовки и подписи без лишних переносов ───── */
/* «10 предметов, у каждого своя роль в вашем вечере» — в одну строку под заголовком: в лендинге ширина зажата
   до 36 знаков, а на широком экране подпись уезжала вправо от заголовка */
.pdp + section .head-row { flex-direction: column; align-items: flex-start; gap: 14px; }
.pdp + section .head-row .lead { max-width: none !important; }
@media (min-width: 700px) {
  .pdp + section .head-row .lead { white-space: nowrap; }
}
/* Блок курса: видео слева по высоте равно тексту справа, заголовок — в две строки вместо трёх */
@media (min-width: 861px) {
  .course { align-items: stretch; grid-template-rows: minmax(min(600px, 44vw), auto); }
  /* видео не задаёт высоту строки, а занимает ту, что получилась у текста */
  .course > video { height: 0; min-height: 100%; aspect-ratio: auto; }
  .course > div { justify-content: center; }
  .course .display { font-size: clamp(28px, 2.75vw, 44px); }
}

/* ───── Раскрывающиеся списки открываются плавно ───── */
details::details-content { interpolate-size: allow-keywords; overflow: clip; contain: layout; }
details:not([open])::details-content { block-size: 0; }
@media (prefers-reduced-motion: no-preference) {
  details::details-content { transition: block-size, content-visibility, display; transition-duration: .35s; transition-timing-function: ease; transition-behavior: allow-discrete; }
}
/* Там, где браузер не умеет плавно менять высоту сам (Safari, Firefox), высоту ведёт мост (bridge.js) */
.pt-sliding { overflow: hidden; }
/* Меню на телефоне выезжает, а не выскакивает */
.mnav { display: flex; overflow: clip; max-height: 0; padding-block: 0; border-top-width: 0; visibility: hidden; transition: max-height .35s ease, padding .35s ease, visibility 0s .35s; }
.mnav.open { max-height: 440px; padding-block: 10px 20px; border-top-width: 1px; visibility: visible; transition: max-height .35s ease, padding .35s ease, visibility 0s; }

/* ───── Страница набора и каталог на узком экране ───── */
@media (max-width: 1000px) {
  /* Миниатюры — сразу под главным фото, в одну строку на всю его ширину. В лендинге они уходили под блок
     покупки, а тот «прилипал» к верху экрана и наезжал на них текстом */
  .pdp { row-gap: 8px; }
  .pdp > .thumbs { order: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; max-height: none; overflow: visible; }
  .pdp > .thumbs button { width: auto; }
  .pdp > .buy { order: 2; position: static; margin-top: 20px; }
}
/* Каталог: «Наборы» и «Отдельные средства» — в одну строку (общий стиль лендинга ставил их столбиком) */
.head-row > div:has(> [data-act="soon"]) { flex-direction: row; flex-wrap: nowrap !important; }
@media (max-width: 640px) {
  /* Заголовок «Интимные косметички» — в одну строку: на узком экране буквы уменьшаются вместе с шириной */
  .head-row:has([data-act="soon"]) .display { font-size: min(30px, 6.4vw); white-space: nowrap; }
  .head-row > div:has(> [data-act="soon"]) { width: 100%; gap: 8px !important; }
  .head-row > div:has(> [data-act="soon"]) .btn { flex: 1 1 auto; min-width: 0; padding: 0 8px; font-size: clamp(8.5px, 2.5vw, 11px); letter-spacing: .1em; white-space: nowrap; }
}

/* ───── Страница «Миссия» ───── */
@media (min-width: 901px) {
  /* Заголовок — в две строки: колонка текста шире, буквы чуть меньше */
  .mission { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(36px, 5vw, 80px); }
  .mission .h1 { font-size: clamp(24px, 2.3vw, 36px); }
}
/* Блок «Полтора года…»: в общей сетке страницы — видео слева, текст справа; фон продолжает блок выше */
.pt-story { background: linear-gradient(180deg, #1A0508, var(--black) 60%) !important; }
.pt-story > .prose { max-width: 1360px; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(36px, 6vw, 100px); align-items: center; }
.pt-story-media { aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--line); background: var(--night); }
.pt-story-media video { width: 100%; height: 100%; object-fit: cover; }
.pt-story-text { display: flex; flex-direction: column; gap: 20px; max-width: 62ch; }
.pt-story-text > .soft { font-size: clamp(15px, 1.15vw, 17px); }
.pt-story-text > .h3 { margin-top: 10px; padding: 4px 0 4px 20px; border-left: 1px solid var(--gold); line-height: 1.5; }
@media (max-width: 900px) {
  .pt-story > .prose { grid-template-columns: 1fr; }
  .pt-story-media { aspect-ratio: 4 / 3; }
}

/* ───── Подвал ───── */
/* Одной линии сверху подвала достаточно: вторая, над строкой с правами, убрана */
.legal { border-top: 0; margin-top: 36px; padding-top: 0; }
