/* ============================================================
   myshop — спокойный минимализм, mobile-first
   Палитра: тёплая бумага, графитовый текст, шалфейный акцент.
   ============================================================ */

:root {
  --bg:            #f7f5f1;
  --surface:       #ffffff;
  --ink:           #2b2925;
  --muted:         #837c72;
  --line:          #e6e1d8;
  --accent:        #52705e;
  --accent-dark:   #435c4e;
  --accent-soft:   #e9efe9;
  --accent-soft-2: #eef0ea;
  --danger:        #a8503f;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 2px rgba(43, 41, 37, .06), 0 8px 24px rgba(43, 41, 37, .07);
  --container:     1080px;
}

/* --- Минимальный сброс --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1rem; }
.site-main { flex: 1; padding-block: 1.5rem 3rem; }
.muted { color: var(--muted); font-size: .9rem; }
.lead  { color: var(--muted); font-size: 1.02rem; max-width: 60ch; }
.price { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price--lg { font-size: 1.3rem; }

/* --- Шапка --- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 245, 241, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__in {
  display: flex; align-items: center; gap: .75rem;
  min-height: 56px; flex-wrap: wrap; padding-block: .4rem;
}
.site-logo {
  font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none;
}
.site-logo:hover { color: var(--accent-dark); }
.site-nav { display: flex; gap: .25rem; margin-inline: auto; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none; color: var(--muted);
  padding: .35rem .7rem; border-radius: 999px; font-size: .95rem;
}
.site-nav a:hover { color: var(--ink); background: var(--accent-soft-2); }
.site-nav a[aria-current="page"] { color: var(--accent-dark); background: var(--accent-soft); }
.cart-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: .4rem .9rem; font-size: .95rem;
}
.cart-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.cart-btn__count {
  min-width: 1.35rem; height: 1.35rem; padding-inline: .3rem;
  display: inline-grid; place-items: center;
  background: var(--accent); color: #fff;
  border-radius: 999px; font-size: .8rem; font-weight: 700;
}

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  padding: .6rem 1.2rem; font-size: .97rem; font-weight: 600;
  text-decoration: none; transition: background-color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn--sm { padding: .4rem .85rem; font-size: .9rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* --- Главная --- */
.hero { padding-block: 2rem 1.5rem; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: .6rem; }
.hero .lead { font-size: 1.08rem; }

.sections-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .sections-grid { grid-template-columns: 1fr 1fr; } }

.section-card {
  position: relative; display: flex; flex-direction: column; gap: .45rem;
  padding: 1.6rem 1.5rem 1.4rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: var(--ink);
  min-height: 220px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.section-card::after {
  content: ""; position: absolute; inset: auto -20% -55% auto;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(82, 112, 94, .16), transparent);
  pointer-events: none;
}
.section-card--laser::after {
  background: radial-gradient(closest-side, rgba(140, 108, 82, .14), transparent);
}
.section-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: #d8d2c6; color: var(--ink);
}
.section-card__tag {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-dark);
}
.section-card h2 { font-size: 1.5rem; }
.section-card p { color: var(--muted); max-width: 40ch; }
.section-card__meta { font-size: .88rem; color: var(--muted); }
.section-card__more { margin-top: auto; padding-top: .8rem; font-weight: 600; color: var(--accent-dark); }

/* --- Страница раздела: карусель --- */
.page-head { padding-block: 1.5rem 1rem; }
.page-head h1 { margin-bottom: .4rem; }

.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(72vw, 300px);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: .25rem .25rem 1rem;
  scroll-padding-inline: .25rem;
  scrollbar-width: thin;
  scrollbar-color: #cfc8bc transparent;
}
.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-thumb { background: #cfc8bc; border-radius: 4px; }
.carousel > * { scroll-snap-align: start; }
@media (min-width: 720px) {
  .carousel { grid-auto-columns: calc((100% - 2rem) / 3); }
}
@media (min-width: 1080px) {
  .carousel { grid-auto-columns: calc((100% - 3rem) / 4); }
}
.carousel-hint { margin-top: .2rem; }

/* --- Карточка товара --- */
.product-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-card__photo { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--accent-soft-2); }
.product-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.product-card__nophoto { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--accent-soft), #dfe4dc); }
.product-card__body { display: flex; flex-direction: column; gap: .7rem; padding: .9rem 1rem 1.1rem; flex: 1; }
.product-card__title a { color: var(--ink); text-decoration: none; }
.product-card__title a:hover { color: var(--accent-dark); }
.product-card__row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }

/* --- Страница товара --- */
.product { display: grid; gap: 1.5rem; }
@media (min-width: 760px) {
  .product { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; gap: 2.5rem; }
}
.product__gallery { display: grid; gap: .75rem; }
#gallery-main {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--accent-soft-2);
}
.product__thumbs { display: flex; gap: .6rem; flex-wrap: wrap; }
.product__thumb {
  padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm);
  overflow: hidden; background: none; line-height: 0;
}
.product__thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.product__thumb.is-active { border-color: var(--accent); }
.product__cat { font-size: .85rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: .3rem; }
.product__cat a { text-decoration: none; color: var(--accent-dark); }
.product__info h1 { margin-bottom: .5rem; }
.product__desc { margin-block: .7rem 1rem; }
.product__content { color: #55504a; }
.product__content ul { padding-left: 1.2rem; display: grid; gap: .25rem; margin-block: .75rem; }
.product__buy {
  margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  display: flex; align-items: flex-end; gap: .8rem; flex-wrap: wrap;
}
.qty-field { display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); }
.qty-field input {
  width: 5.2rem; padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.product__buy .btn { flex: 1; min-width: 200px; }

/* --- Модальная корзина --- */
.cart-modal { position: fixed; inset: 0; z-index: 50; }
.cart-modal[hidden] { display: none; }
.cart-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(43, 41, 37, .45);
}
.cart-modal__window {
  position: absolute; inset: auto 0 0 0;
  max-height: 92dvh; overflow-y: auto;
  background: var(--bg); border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -12px 40px rgba(43, 41, 37, .25);
}
@media (min-width: 640px) {
  .cart-modal__window {
    inset: 50% auto auto 50%; transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 2rem));
    max-height: min(88dvh, 780px);
    border-radius: var(--radius);
  }
}
.cart-modal__head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.cart-modal__close {
  border: none; background: none; font-size: 1.6rem; line-height: 1;
  color: var(--muted); padding: .2rem .5rem; border-radius: var(--radius-sm);
}
.cart-modal__close:hover { color: var(--ink); background: var(--accent-soft-2); }
.cart-modal__body { padding: 1.1rem 1.25rem 1.5rem; }

.cart-empty { color: var(--muted); padding-block: .5rem 1rem; }
.cart-items { display: grid; }

.cart-item {
  display: grid; grid-template-columns: 1fr auto;
  gap: .3rem .75rem; padding-block: .8rem;
  border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: none; }
.cart-item__name { color: var(--ink); text-decoration: none; font-weight: 600; }
.cart-item__name:hover { color: var(--accent-dark); }
.cart-item__remove {
  border: none; background: none; color: var(--muted);
  font-size: 1.25rem; line-height: 1; padding: .1rem .4rem; border-radius: 6px;
}
.cart-item__remove:hover { color: var(--danger); background: #f4e9e6; }
.cart-item__controls {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
}
.cart-item__price { color: var(--muted); font-variant-numeric: tabular-nums; }
.cart-item__qty {
  width: 4.4rem; padding: .35rem .5rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.cart-item__sum { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }

.cart-total { font-size: 1.08rem; padding-block: .9rem .2rem; }

/* --- Форма заказа --- */
#order-form h3 { margin-block: .8rem .9rem; font-size: 1.1rem; }
.field { display: grid; gap: .3rem; margin-bottom: .85rem; }
.field__label { font-size: .92rem; color: #55504a; }
.field .req { color: var(--danger); font-style: normal; }
.field input {
  width: 100%; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(82, 112, 94, .14); }
.field-hint { font-size: .85rem; color: var(--muted); margin: -.2rem 0 .85rem; }
.form-error {
  background: #f7ebe8; color: var(--danger);
  border: 1px solid #e8cdc5; border-radius: var(--radius-sm);
  padding: .6rem .8rem; font-size: .92rem; margin-bottom: .8rem;
}
.form-note { margin-top: .7rem; }

/* Honeypot: физически убран с экрана, но присутствует в разметке */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

/* --- Спасибо / 404 --- */
.thanks { padding-block: 2.5rem 1rem; }
.thanks h1 { margin-bottom: .7rem; }
.thanks .lead { margin-bottom: 1.4rem; }
.thanks p:last-child { display: flex; gap: .7rem; flex-wrap: wrap; }

/* --- Подвал --- */
.site-footer {
  border-top: 1px solid var(--line); padding-block: 1.5rem 2rem;
  color: var(--muted); font-size: .92rem;
}
.site-footer p + p { margin-top: .25rem; }

/* --- Блокировка прокрутки при открытой модалке --- */
body.no-scroll { overflow: hidden; }

/* --- Glassmorphism ---
   Блок объявлен в конце файла, чтобы его background/border/тени
   перебивали одноимённые свойства .product-card и .cart-modal__window. */
.glass-card {
  background: rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

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