/* ============================================================
   Faberlik shop — index.css
   Палитра, темы и все компоненты. Токены сверху — меняй их.
   ============================================================ */

:root {
  /* палитра (светлая тема) — пресет «Синяя». Переопределяется из настроек через theme.js */
  --bg:           #F8FAFC;
  --surface:      #FFFFFF;
  --surface-2:    #EEF2F7;
  --ink:          #0F172A;
  --muted:        #64748B;
  --primary:      #1D4ED8;
  --primary-ink:  #FFFFFF;
  --primary-soft: #E6EEFB;
  --accent:       #DC2626;
  --line:         #E2E8F0;
  --shadow:       0 6px 24px rgba(15, 23, 42, 0.08);
  --shadow-sm:    0 2px 8px rgba(15, 23, 42, 0.06);

  /* типографика */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body:    "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* размеры */
  --maxw: 1100px;
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 18px;
  --header-h: 64px;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

[data-theme="dark"] {
  --bg:           #0E1626;
  --surface:      #16203A;
  --surface-2:    #1E2A45;
  --ink:          #EAF0FA;
  --muted:        #9FB0C8;
  --primary:      #6FA8FF;
  --primary-ink:  #08152B;
  --primary-soft: #16233D;
  --accent:       #F87171;
  --line:         #27324C;
  --shadow:       0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-sm:    0 2px 10px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--ease), color .3s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0 0 .4em; letter-spacing: .2px; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
h3 { font-size: 1.2rem; }

.eyebrow {
  font-family: var(--font-body); font-size: .72rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 .6em;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; gap: 14px;
  height: var(--header-h);
}
.brand { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--primary); white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: .95rem; font-weight: 600;
  color: var(--muted); transition: color .15s, background .15s;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.active { color: var(--primary); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); transition: background .15s, border-color .15s;
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

.lang-select {
  height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: .82rem;
  padding: 0 28px 0 10px; cursor: pointer; letter-spacing: .03em;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.lang-select:hover { background-color: var(--surface-2); }

.cart-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--accent); color: #fff; border-radius: 9px;
  font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center;
}
.cart-count[hidden] { display: none; }

.burger { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: .95rem; white-space: nowrap; cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .15s, filter .15s, background .15s;
}
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--primary) 60%, transparent); }
.btn-primary:hover { box-shadow: 0 8px 22px -6px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-wa { background: #25D366; color: #ffffff; box-shadow: 0 4px 14px -4px rgba(37,211,102,.55); }
.btn-wa:hover { box-shadow: 0 8px 22px -6px rgba(37,211,102,.6); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.hero-actions .btn { padding: 14px 28px; font-size: 1rem; border-radius: 14px; }

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 8vw, 90px) 0 clamp(30px, 5vw, 60px); }
.hero-inner { max-width: 640px; }
.hero h1 { margin-bottom: .25em; }
.hero p { font-size: 1.12rem; color: var(--muted); margin: 0 0 1.6em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- sections ---------- */
.section { padding: clamp(28px, 5vw, 52px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head a { color: var(--accent); font-weight: 700; font-size: .92rem; }

/* ---------- category chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: .92rem;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .ph {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted);
  font-family: var(--font-display); font-size: 2.4rem; opacity: .5;
}
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 4px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .03em;
}
.badge-hit { background: var(--accent); color: #fff; }
.badge-oos { background: var(--ink); color: var(--bg); }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-family: var(--font-body); font-weight: 700; font-size: .98rem; line-height: 1.3; }
.card-desc { color: var(--muted); font-size: .85rem; flex: 1; }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price { font-weight: 800; font-size: 1.1rem; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: .9rem; }

/* ---------- product page ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding: clamp(24px,4vw,44px) 0; }
.product-detail .media { aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.product-detail .media img { width: 100%; height: 100%; object-fit: cover; }
.product-detail .ph { width:100%; height:100%; display:grid; place-items:center; color:var(--muted); font-family:var(--font-display); font-size:4rem; opacity:.5; }
.gallery-thumbs { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.gal-thumb { width:64px; height:64px; border-radius:var(--radius-sm); overflow:hidden; border:2px solid var(--line); background:var(--surface-2); padding:0; }
.gal-thumb img { width:100%; height:100%; object-fit:cover; }
.gal-thumb.active { border-color:var(--primary); }
.product-meta { color: var(--muted); font-size: .88rem; }
.product-detail .price { font-size: 1.8rem; }
.footnote { color: var(--muted); font-size: .8rem; border-left: 2px solid var(--line); padding-left: 12px; margin: 10px 0; }
.qty-pick { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.qty-pick button { width: 38px; height: 42px; border: 0; background: var(--surface); color: var(--ink); font-size: 1.2rem; }
.qty-pick button:hover { background: var(--surface-2); }
.qty-pick span { min-width: 40px; text-align: center; font-weight: 700; }

/* ---------- cart ---------- */
.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.cart-item .thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); }
.cart-item .ph-sm { width:64px;height:64px;border-radius:var(--radius-sm);background:var(--surface-2);display:grid;place-items:center;color:var(--muted);font-family:var(--font-display);font-size:1.4rem; }
.cart-item .name { font-weight: 700; font-size: .95rem; }
.cart-item .li-price { color: var(--muted); font-size: .85rem; }
.cart-foot { margin-top: 20px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.2rem; margin-bottom: 14px; }
.cart-total b { font-size: 1.5rem; }
.cart-actions { display: flex; justify-content: flex-end; }
.cart-actions .btn-wa { width: auto; padding: 11px 22px; }
@media (max-width: 480px) { .cart-actions .btn-wa { width: 100%; justify-content: center; } }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 2px 4px; }

/* ---------- empty / generic states ---------- */
.empty-state { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty-state .big { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); margin-bottom: 6px; }

/* ---------- prose (about/contacts) ---------- */
.prose { max-width: 720px; }
.prose p { color: var(--ink); margin: 0 0 1em; }
.info-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.info-block h3 { color: var(--primary); margin-bottom: .3em; }
.socials a { display:inline-flex; gap:8px; align-items:center; color: var(--primary); font-weight: 700; margin-right: 16px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 60px; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .container { padding-top: 32px; padding-bottom: 28px; }
.footer-brand { margin-bottom: 18px; }
.footer-brand .brand { font-family: var(--font-display); font-size: 1.3rem; color: var(--primary); }
.footer-tag { color: var(--muted); font-size: .85rem; margin: 2px 0 0; }
.footer-legal { color: var(--muted); font-size: .78rem; max-width: 820px; border-top: 1px solid var(--line); padding-top: 16px; }
.footer-legal p { margin: 0 0 .7em; line-height: 1.5; }
.footer-copy { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 13px; border-radius: var(--radius-sm); font-size: 1rem; }
  .burger { display: inline-flex; }
  .brand { font-size: 1.15rem; }
  .product-detail { grid-template-columns: 1fr; }
  .lang-select { padding: 0 24px 0 8px; height: 38px; font-size: .78rem; }
  .header-tools { gap: 4px; }
  .icon-btn { width: 38px; height: 38px; }
  .container { padding: 0 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .footer-top { flex-direction: column; gap: 14px; }
  .hero { padding: 32px 0 24px; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .brand { font-size: 1.05rem; }
}

/* ---------- utils ---------- */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fade-in { animation: fadeIn .3s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* подкатегории + фасетные фильтры (этап 6) */
.chips-sub { margin-top: -2px; }
.chip-sub { font-size: .82rem; padding: 6px 12px; background: var(--surface-2); }
.catalog-body { display: grid; grid-template-columns: 220px 1fr; gap: 26px; align-items: start; }
.catalog-body.no-facets { grid-template-columns: 1fr; }
.facets { position: sticky; top: calc(var(--header-h) + 12px); display: flex; flex-direction: column; gap: 16px; }
.facet-group { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.facet-name { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.facet-vals { display: flex; flex-wrap: wrap; gap: 6px; }
.facet-val { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 11px; font-size: .8rem; cursor: pointer; }
.facet-val:hover { border-color: var(--primary); }
.facet-val.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

/* характеристики на странице товара */
.spec { margin: 14px 0; border-top: 1px solid var(--line); }
.spec-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.spec-row dt { color: var(--muted); }
.spec-row dd { margin: 0; text-align: right; color: var(--ink); font-weight: 600; }

@media (max-width: 760px) {
  .catalog-body { grid-template-columns: 1fr; gap: 16px; }
  .facets { position: static; flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .facet-group { border-bottom: 0; padding-bottom: 0; width: 100%; }
}

/* главная: услуги, обо мне, баннер под заказ */
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.service-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.service-card.service-join { border-color: var(--primary); background: var(--primary-soft); }
.service-card h3 { font-family: var(--font-display); font-size: 1.4rem; margin: 0; }
.service-card p { color: var(--muted); flex: 1; line-height: 1.55; margin: 0; }
.service-card .btn { align-self: flex-start; }
.about-home { max-width: 760px; }
.about-home h2 { margin-bottom: 10px; }
.about-home p { color: var(--muted); line-height: 1.7; margin: 0; }
.about-home .btn { margin-top: 18px; background: transparent; border-color: var(--line); color: var(--ink); }
.about-home .btn:hover { background: transparent; border-color: var(--primary); color: var(--primary); }
.underorder { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--primary-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; flex-wrap: wrap; }
.underorder span:first-child { color: var(--ink); font-weight: 600; }
.underorder .underorder-cta { color: var(--primary); font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .services { grid-template-columns: 1fr; } }

/* адреса на странице «О нас» */
.addr-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; background: var(--surface); }
.addr-label { font-weight: 700; margin-bottom: 4px; }
.addr-text { color: var(--muted); margin-bottom: 10px; }
.addr-map { width: 100%; height: 260px; border: 0; border-radius: var(--radius-sm); margin-bottom: 10px; display: block; }
.addr-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.addr-btns .btn { padding: 8px 16px; }

/* лендинг: меню каталога Faberlic */
.section-lead { color: var(--muted); margin: -8px 0 18px; }
.catalog-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.cat-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; font-weight: 700; font-size: 1.02rem; color: var(--ink); transition: border-color .15s, transform .12s var(--ease), box-shadow .15s, background .15s; }
.cat-link::after { content: "→"; color: var(--primary); font-size: 1.1rem; transition: transform .15s; }
.cat-link:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.cat-link:hover::after { transform: translateX(3px); }
.wa-icon svg { width: 20px; height: 20px; }
@media (max-width: 480px){ .catalog-menu { grid-template-columns: 1fr 1fr; } .cat-link { padding: 16px; font-size: .92rem; } }

/* верхняя полоса меню каталога */
.catalog-bar { border-top: 1px solid var(--line); background: var(--surface-2); }
.catalog-bar-inner { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; }
.cat-bar-link { white-space: nowrap; padding: 11px 14px; font-size: .9rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.cat-bar-link:hover { color: var(--primary); border-bottom-color: var(--primary); }
@media (max-width: 760px) {
  .catalog-bar-inner { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .catalog-bar-inner::-webkit-scrollbar { display: none; }
}

/* контакты команды */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.contact-label { font-weight: 700; font-size: 1.02rem; }
.contact-card .btn-wa { width: 100%; justify-content: center; }

/* свободные блоки на «О нас» */
.custom-html { line-height: 1.7; }
.custom-html img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.custom-html a { color: var(--primary); }
