/* Образ сайта: бассейн сверху. Вода с сеткой плитки, разделительная дорожка из поплавков,
   разметка дна с Т-образными концами, номера как на стартовых тумбах. */
:root {
  --ink: #0a2a36;         /* глубина: текст, кнопки, подвал */
  --water: #2cc3d6;       /* вода: главный экран и шапки страниц */
  --water-deep: #087a8c;  /* ссылки и наведение (контраст на белом 5:1) */
  --shallow: #e4f6f8;     /* мелкая вода: мягкие секции */
  --grout: #b9d6dc;       /* швы плитки: линии и рамки */
  --float: #ffd21f;       /* жёлтый поплавок: корзина, номера шагов */
  --float-red: #f0493e;   /* красные поплавки у стенок бассейна */
  --muted: #4d6b74;
  /* прежние имена: на них ссылаются inline-стили в html */
  --text: var(--ink); --accent: var(--water-deep); --line: var(--grout); --bg-soft: var(--shallow);
  --radius: 4px;
  --wrap: 1180px;
  --display: "Sofia Sans Extra Condensed", "Arial Narrow", sans-serif;
  --rope-end: 120px;       /* длина красного участка: 5 поплавков */
  /* дорожка: швы между поплавками, красные концы, чередование жёлтых и белых участков */
  --rope:
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(10,42,54,.5) 22px 24px),
    linear-gradient(90deg, var(--float-red) 0 var(--rope-end), transparent var(--rope-end) calc(100% - var(--rope-end)), var(--float-red) calc(100% - var(--rope-end))),
    repeating-linear-gradient(90deg, var(--float) 0 96px, #fff 96px 192px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 84px; }
body {
  margin: 0;
  font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  font-size: 17px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--water-deep); text-underline-offset: .15em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, legend, .logo, .facts dd, .footer h4 { font-family: var(--display); font-style: italic; font-weight: 800; text-transform: uppercase; line-height: 1; }
h1, h2 { margin: 0 0 .35em; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 6.5vw, 4.6rem); }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); }
h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.25; margin: 0 0 .5em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* Шапка */
.header { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 2px solid var(--ink); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 1.9rem; color: var(--ink); text-decoration: none; }
.logo:hover { color: var(--ink); }
.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; padding: 4px 0; border-bottom: 3px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--float); }
.nav .nav-login { border: 2px solid var(--ink); border-radius: var(--radius); padding: 5px 14px; font-weight: 600; }
.nav .nav-login:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.menu-toggle { display: none; background: none; border: 2px solid var(--ink); border-radius: var(--radius); padding: 6px 12px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }

/* Кнопки */
.btn { display: inline-block; background: var(--ink); color: #fff; padding: 14px 24px; border: 2px solid var(--ink); border-radius: var(--radius); text-decoration: none; font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; }
.btn:hover { background: var(--water-deep); border-color: var(--water-deep); color: #fff; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-ghost, .btn-line { background: transparent; color: var(--ink); }
.btn-ghost:hover, .btn-line:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: .92rem; }

/* Вода: главный экран и шапки страниц. Сетка плитки + дорожка поперёк нижнего края */
.hero, .page-head {
  position: relative; overflow: hidden; color: var(--ink);
  background-color: var(--water);
  background-image:
    linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px),
    linear-gradient(transparent 35%, rgba(8,122,140,.4));
  background-size: 44px 44px, 44px 44px, 100% 100%;
}
.hero::after, .page-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 28px; height: 12px; background: var(--rope); box-shadow: 0 14px 10px -2px rgba(6,74,88,.35); }

.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding-top: 76px; padding-bottom: 124px; }
.hero h1 { font-size: clamp(3.3rem, 7.8vw, 6rem); line-height: .9; }
.hero p { font-size: 1.2rem; font-weight: 500; max-width: 33em; margin: 0; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
/* товары "плавают" над дном: наклон и смещённая тень */
.hero-shelf { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: center; }
.hero-shelf img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #fff; border-radius: var(--radius); box-shadow: 14px 20px 22px rgba(6,74,88,.38); animation: bob 7s ease-in-out infinite; }
.hero-shelf img:nth-child(1) { grid-row: span 2; rotate: -4deg; }
.hero-shelf img:nth-child(2) { rotate: 5deg; animation-delay: -2.3s; }
.hero-shelf img:nth-child(3) { rotate: -3deg; animation-delay: -4.6s; }
@keyframes bob { 50% { transform: translateY(8px); } }

/* Секции */
.section { padding: 88px 0; }
.section-soft {
  background-color: var(--shallow);
  background-image: linear-gradient(rgba(255,255,255,.75) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.75) 1px, transparent 1px);
  background-size: 44px 44px;
}
.lead { color: var(--muted); font-size: 1.1rem; max-width: 46em; }
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); align-items: center; gap: 56px; }

/* Табло с фактами о компании */
.facts { margin: 0; padding: 8px 30px; background: var(--ink); color: #fff; border-radius: var(--radius); }
.facts div { display: grid; grid-template-columns: 7em 1fr; gap: 16px; align-items: baseline; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.16); }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--water); font-size: .92rem; }
.facts dd { margin: 0; font-size: 1.9rem; }

/* Ассортимент: дорожки, между ними разметка дна с Т-образными концами */
.lanes { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 40px; }
.lane { position: relative; padding: 30px 28px 34px; }
.lane:first-child { padding-left: 0; }
.lane:last-child { padding-right: 0; }
.lane p { margin: 0; color: var(--muted); font-size: .97rem; }
.lane + .lane::before { content: ""; position: absolute; left: -3px; top: 0; bottom: 0; width: 6px; background: var(--ink); }
.lane + .lane::after { content: ""; position: absolute; left: -17px; top: 0; bottom: 0; width: 34px; background: linear-gradient(var(--ink), var(--ink)) top / 100% 6px no-repeat, linear-gradient(var(--ink), var(--ink)) bottom / 100% 6px no-repeat; }

.stat { padding-top: 20px; border-top: 4px solid var(--ink); }
.stat b { display: block; font-size: 1.15rem; margin-bottom: 6px; }
.stat p { margin: 0; color: var(--muted); font-size: .97rem; }

/* Текстовые страницы */
.page-head { padding: 44px 0 84px; }
.page-head p { margin: 0; max-width: 46em; font-weight: 500; }
.page-head a, .crumbs a { color: var(--ink); }
.crumbs { font-size: .9rem; margin-bottom: 14px; }
.doc { padding: 48px 0 80px; }
.doc .wrap { max-width: 860px; }
.doc h2 { font-size: 2rem; margin-top: 1.5em; }
.doc h3 { margin-top: 1.4em; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-bottom: .4em; }
.note { background: #fff7d1; border: 1px solid #e6cf62; border-radius: var(--radius); padding: 16px 20px; margin: 1.4em 0; }
.table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .97rem; }
.table th, .table td { text-align: left; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--grout); vertical-align: top; }
.table th { width: 38%; color: var(--muted); font-weight: 500; }

/* Шаги: номер на табличке, как на стартовой тумбе. Стоит после .doc, чтобы перебить его отступы списков */
ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; margin: 0; padding: 18px 0 18px 70px; min-height: 84px; border-top: 1px solid var(--grout); }
.steps li:last-child { border-bottom: 1px solid var(--grout); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 17px; width: 48px; height: 48px; border-radius: var(--radius); background: var(--ink); color: var(--float); font: italic 800 2rem/48px var(--display); text-align: center; }
.steps b { display: block; margin-bottom: 2px; }
.steps p { margin: 0; color: var(--muted); }

/* Подвал */
.footer { background: var(--ink); color: #a7c6cd; padding: 56px 0 28px; font-size: .95rem; }
.footer a { color: #fff; text-decoration: none; }
.footer a:hover { color: var(--float); }
.footer :focus-visible { outline-color: var(--float); }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer h4 { color: var(--water); margin: 0 0 14px; font-size: 1.5rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer .legal { border-top: 1px solid rgba(255,255,255,.14); margin-top: 40px; padding-top: 20px; font-size: .85rem; color: #86a8b0; }

@media (max-width: 960px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr; gap: 28px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 44px; }
  .hero-shelf { max-width: 440px; }
  /* на узком экране разметка дна превращается в полосу над каждой дорожкой */
  .lanes { grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .lane, .lane:first-child, .lane:last-child { padding: 20px 0 26px; border-top: 6px solid var(--ink); }
  .lane + .lane::before, .lane + .lane::after { content: none; }
}
@media (max-width: 760px) {
  :root { --rope-end: 48px; }
  body { font-size: 16px; }
  .menu-toggle { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; gap: 0; border-bottom: 2px solid var(--ink); }
  .nav.open { display: flex; }
  .nav a, .nav .nav-login { padding: 14px 20px; border: 0; border-top: 1px solid var(--grout); border-radius: 0; }
  .nav a[aria-current="page"] { box-shadow: inset 6px 0 var(--float); }
  .hero .wrap { padding-top: 52px; padding-bottom: 104px; }
  .section { padding: 60px 0; }
  .lanes { grid-template-columns: 1fr; }
  .facts { padding: 4px 20px; }
  .facts div { grid-template-columns: 1fr; gap: 2px; padding: 14px 0; }
  .table th { width: auto; display: block; border-bottom: 0; padding-bottom: 0; }
  .table td { display: block; padding-top: 4px; }
}

/* Кабинет, каталог, корзина */
.nav-cart { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius); background: var(--float); color: var(--ink); font-weight: 600; font-size: .95rem; text-decoration: none; }
.header .nav-cart { order: 2; }
.nav-cart:hover { background: #ffc400; color: var(--ink); }
.cart-badge { background: var(--ink); color: var(--float); border-radius: 999px; min-width: 22px; padding: 0 7px; font-size: .8rem; line-height: 22px; text-align: center; }
.nav-cart.bump { animation: bump .45s ease; }
@keyframes bump { 30% { transform: scale(1.15); } 60% { transform: scale(.95); } }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
input, select, textarea { font: inherit; padding: 11px 13px; border: 1px solid #8fb3bc; border-radius: var(--radius); background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .93rem; }

.auth { min-height: 62vh; display: grid; align-items: center; }
.auth-box { max-width: 440px; margin: 0 auto; background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); padding: 34px; display: grid; gap: 16px; }
.auth-box h1 { font-size: 2.6rem; margin: 0; }
.auth-box p { margin: 0; }
.form-error { color: #c0262d; font-weight: 600; }

.shop { padding: 36px 0 80px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.toolbar input { max-width: 320px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { font: inherit; font-size: .9rem; font-weight: 600; padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--grout); background: #fff; color: var(--ink); cursor: pointer; }
.chips button:hover { border-color: var(--ink); }
.chips button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
/* каталог выложен плиткой: карточки встык, общий шов */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); padding: 1px 0 0 1px; }
.pcard { background: #fff; border: 1px solid var(--grout); margin: -1px 0 0 -1px; display: flex; flex-direction: column; }
.pcard img { aspect-ratio: 1/1; object-fit: contain; width: 100%; padding: 10px; }
.pbody { padding: 6px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcat { font-size: .8rem; color: var(--muted); }
.pname { font-weight: 700; line-height: 1.3; flex: 1; }
.pprice b { font-size: 1.2rem; }
.pprice s { color: var(--muted); font-size: .85rem; margin-left: 8px; }
.pbuy { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.pbuy input { padding: 8px; text-align: center; }
.pcard .stock { font-size: .82rem; color: #16794a; }

.steps-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 26px; padding: 0; list-style: none; font-weight: 600; font-size: .92rem; }
.steps-bar li { padding: 7px 14px; border-radius: var(--radius); background: var(--shallow); color: var(--muted); }
.steps-bar li.on { background: var(--ink); color: var(--float); }
.cart-table img { width: 56px; height: 72px; object-fit: contain; }
.cart-table td, .cart-table th { vertical-align: middle; width: auto; }
.cart-table input { width: 72px; padding: 7px; text-align: center; }
.cart-table .x { background: none; border: 0; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.cart-total { display: flex; flex-wrap: wrap; gap: 16px; justify-content: flex-end; align-items: center; margin-top: 20px; font-size: 1.15rem; }
.checkout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: start; }
.checkout fieldset { border: 1px solid var(--grout); border-radius: var(--radius); padding: 22px; margin: 0 0 20px; display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.checkout legend { font-size: 1.6rem; padding: 0 8px; }
.checkout .full { grid-column: 1 / -1; }
.summary { position: sticky; top: 90px; background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); padding: 22px; display: grid; gap: 10px; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; font-size: .93rem; }
.summary .row.total { font-size: 1.2rem; font-weight: 700; border-top: 2px solid var(--ink); padding-top: 12px; }
.cat-tile { background: #fff; border: 1px solid var(--grout); border-radius: var(--radius); padding: 20px; }
.minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini { color: var(--ink); font-size: .82rem; font-weight: 600; line-height: 1.3; display: grid; gap: 4px; align-content: start; }
.mini span { min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini b { font-size: 1rem; margin-top: 2px; }
.mini s { color: var(--muted); font-size: .78rem; font-weight: 400; }
.mini img { aspect-ratio: 3/4; object-fit: contain; width: 100%; }
@media (max-width: 960px) { .checkout { grid-template-columns: 1fr; } .summary { position: static; } }
@media (max-width: 760px) {
  .checkout fieldset { grid-template-columns: 1fr; }
  .pgrid { grid-template-columns: repeat(2, 1fr); }
  .cart-table thead { display: none; }
  .cart-table tr { display: grid; grid-template-columns: 64px 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--grout); }
  .cart-table td { border: 0; padding: 0; }
  .header .nav-cart { order: 0; margin-left: auto; padding: 6px 12px; }
  .header .wrap { gap: 10px; }
  .logo { font-size: 1.55rem; gap: 8px; }
  .logo img { width: 30px; height: 30px; }
}
/* на телефоне корзина без подписи, иначе не помещается рядом с логотипом; для скринридеров подпись остаётся */
@media (max-width: 480px) { .cart-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }

/* Увеличение фото товара (shop.js) */
.pcard img, .mini img, .cart-table img, .hero-shelf img { cursor: zoom-in; }
.zoom { padding: 0; border: 0; outline: 0; border-radius: var(--radius); background: #fff; cursor: zoom-out; max-width: 92vw; max-height: 92vh; }
.zoom::backdrop { background: rgba(10,42,54,.8); }
.zoom img { display: block; height: min(85vh, 700px); width: auto; max-width: 92vw; object-fit: contain; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-shelf img, .nav-cart.bump { animation: none; }
}
