/* ═══════════════════════════════════════════════════════════════
   V71 — читаемость светлой/тёмной темы, шрифты, удобство
   Загружается ПОСЛЕДНИМ. Один слой токенов вместо наслоений v57–v70.
   Контраст: основной текст ≥ 7:1, второстепенный ≥ 4.5:1 (WCAG AA).
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Токены ── */
:root:root{
  --ink:#16141E;
  --ink2:#4B4858;
  --mut:#6A6777;
  --line:#E3E1EB;
  --line2:#EDEBF3;
  --accent-ink:#5B21B6;
  --save:#17653F;
  --del:#B8331F;
  --warn:#8F5200;
  --p63-ink:#16141E; --p63-ink2:#4B4858; --p63-mut:#6A6777;
}
html[data-theme="dark"]:root{
  --ink:#F5F4FA;
  --ink2:#CFCDDA;
  --mut:#A3A1B3;
  --line:#312F3E;
  --line2:#262432;
  --accent-ink:#D2C0FF;
  --save:#4ADE9F;
  --del:#FF8A80;
  --warn:#F5C063;
  --p63-ink:#F5F4FA; --p63-ink2:#CFCDDA; --p63-mut:#A3A1B3;
}

/* ── 2. Шрифты: чёткий кириллический/казахский набор, цифры не прыгают ── */
html{
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;font-synthesis:none;
}
body{
  font-family:var(--bd);font-size:15px;line-height:1.5;
  font-feature-settings:"tnum" 1,"cv11" 1,"ss03" 1;
}
h1,h2,h3,h4{font-family:var(--di);line-height:1.22;letter-spacing:-.012em;text-wrap:balance}
p,li{text-wrap:pretty}
/* Слишком тяжёлые (900) и слишком «сжатые» заголовки → читаемее */
.pdd-cat-title-v48,.pdd-cat-title-v49,.pdd-cat-card-copy-v48 strong{font-weight:800!important;letter-spacing:-.02em!important}
/* Ценам нужны ровные цифры */
.pdd-product-card span,.pdd-product-card strong,.pdd-product-page h1+div,[class*="price"]{font-variant-numeric:tabular-nums}

/* ── 3. Мелкий текст: не меньше 12px, достаточный контраст ── */
.pdd-product-card > div:last-child > div:last-child{font-size:12.5px!important;color:var(--mut)!important}
.pdd-bottom-nav span{font-size:11.5px!important;font-weight:600!important;color:var(--mut)}
.pdd-bottom-nav [aria-current="page"] span,
.pdd-bottom-nav .on span,.pdd-bottom-nav .active span{color:var(--accent-ink)!important;font-weight:700!important}
input::placeholder,textarea::placeholder{color:var(--mut)!important;opacity:1!important}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#9593A6!important}

/* ── 4. Бейджи скидки и кнопки на светлом акценте: текст читается всегда ── */
html[data-theme="dark"] span[style*="var(--save)"][style*="#fff"],
html[data-theme="dark"] [style*="background: var(--save)"],
html[data-theme="dark"] [style*="background:var(--save)"]{color:#06281A!important}
html[data-theme="dark"] button[style*="var(--accent)"][style*="#fff"],
html[data-theme="dark"] button[style*="var(--brand)"][style*="#fff"]{color:#140B2E!important}
html[data-theme="dark"] .pdd-cta:not(.is-off){color:#140B2E}

/* ── 5. Ссылки «Барлығы ›» не ломаются на две строки ── */
button[style*="accent-ink"],button[style*="var(--accent)"]{white-space:nowrap}
button[style*="accent-ink"]{color:var(--accent-ink)}

/* ── 6. Удобство: размер зон нажатия ≥ 44px, видимый фокус ── */
button,[role="button"],a.btn,select{min-height:40px}
.pdd-bottom-nav button{min-height:56px}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:8px}
input:focus-visible,textarea:focus-visible,select:focus-visible{outline:none}
input:focus,textarea:focus,select:focus{border-color:var(--accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 28%,transparent)}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* ── 7. Тёмная тема: слои и границы различимы ── */
html[data-theme="dark"] .pdd-product-card,
html[data-theme="dark"] .pdd-card{border-color:var(--line)}
html[data-theme="dark"] img{filter:none}
html[data-theme="dark"] hr{border-color:var(--line)}

/* ── 8. Точечные исправления по аудиту контраста ── */
button[style*="--p63-brand"]{color:var(--accent-ink)!important}
html[data-theme="dark"] .pdd-product-card button[aria-label]:not(.pdd-fav){
  background:var(--surf2)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] .pdd-product-card button[aria-label]:not(.pdd-fav) svg{stroke:currentColor}

/* Центральная кнопка «Тауарлар»: в тёмной теме остаётся насыщенной, иконка белая */
html[data-theme="dark"] .pdd-center-tab{
  background:linear-gradient(145deg,#8B5CF6,#6D3AF2)!important;
  border-color:var(--bg)!important;color:#fff}
html[data-theme="dark"] .pdd-center-tab svg{stroke:#fff!important;color:#fff!important}

/* V79.1 — главная: компактные карточки «AI көмекші / Бонустар», баннер скидки и плотные отступы */
.pdd-home .pdd-qgrid{margin-bottom:14px!important;gap:10px!important}
.pdd-home button.pdd-qcard{
  min-height:0!important;
  padding:11px 12px!important;
  gap:10px!important;
  border-radius:16px!important;
  align-items:center!important;
  white-space:normal!important;
}
.pdd-home button.pdd-qcard > div{width:34px!important;height:34px!important;border-radius:10px!important}
.pdd-home button.pdd-qcard span span:first-child{font-size:13px!important;line-height:1.2!important}
.pdd-home button.pdd-qcard span span:last-child{font-size:11px!important;line-height:1.25!important;margin-top:1px!important}
.pdd-home button.pdd-discount{
  min-height:0!important;
  margin-bottom:14px!important;
  padding:10px 14px!important;
  border-radius:14px!important;
  white-space:normal!important;
}
.pdd-home button.pdd-discount span span:first-child{white-space:normal!important;line-height:1.25!important}
.pdd-home .pdd-cats-clean > div:first-child button{
  min-height:0!important;
  padding:4px 0 4px 8px!important;
  white-space:nowrap!important;
  flex-direction:row!important;
}

/* ═══ V79.2 ═══════════════════════════════════════════════════════
   1) Верхний нав на ПК: v63 держал .pdd-bottom-nav в 560px с отступами 8px
      (width:calc(100% - 16px)!important) и перебивал полноширинный нав.
   2) Категории: один компактный ряд с цветными иконками.
   3) AI / Бонусы / скидка: одной строкой на ПК.
   ═══════════════════════════════════════════════════════════════ */

/* ── Нав на ПК ── */
@media(min-width:1100px){
  html body .pdd-bottom-nav{
    left:0!important;right:0!important;top:0!important;bottom:auto!important;
    width:100%!important;max-width:none!important;margin:0!important;
    height:64px!important;min-height:64px!important;padding:0!important;
    border-radius:0!important;border:0!important;
    border-bottom:1px solid var(--line)!important;
    background:color-mix(in srgb,var(--surf) 90%,transparent)!important;
    box-shadow:0 8px 24px -12px rgba(17,19,24,.14)!important;
    -webkit-backdrop-filter:saturate(1.6) blur(18px)!important;backdrop-filter:saturate(1.6) blur(18px)!important;
  }
  html body .pdd-bottom-nav>div:last-child{
    height:64px!important;min-height:64px!important;max-width:1440px!important;
    margin:0 auto!important;padding:0 24px 0 176px!important;
    display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:4px!important;
  }
  html body .pdd-bottom-nav>div:last-child::before{left:24px!important;font-size:21px!important}
  html body .pdd-nav-item{
    height:40px!important;min-height:40px!important;padding:0 14px!important;gap:8px!important;
    border-radius:12px!important;flex:0 0 auto!important;color:var(--ink2)!important;
  }
  html body .pdd-nav-item:hover{background:var(--surf2)!important;color:var(--ink)!important}
  html body .pdd-nav-item[aria-current="page"]{background:var(--accent-wash)!important}
  html body .pdd-nav-item>span{font-size:14px!important;font-weight:600!important;color:inherit!important}
  html body .pdd-nav-item[aria-current="page"]>span{color:var(--accent-ink)!important;font-weight:700!important}
  html body .pdd-center-tab{width:34px!important;height:34px!important;border-radius:10px!important;margin:0!important;box-shadow:none!important;animation:none!important}
  html body .pdd-center-tab svg{width:18px!important;height:18px!important}
  html body .pdd-topbar{top:64px!important}
  .scr{padding-top:80px!important}

}

/* ── AI / Бонусы / скидка ── */
.pdd-home .pdd-quickrow .pdd-qgrid{padding:0!important;margin:0 0 10px!important}
.pdd-home .pdd-quickrow .pdd-discount{margin:0 0 14px!important;width:100%!important}
@media(min-width:900px){
  .pdd-home .pdd-quickrow{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:12px;margin-bottom:18px}
  .pdd-home .pdd-quickrow .pdd-qgrid{display:contents}
  .pdd-home .pdd-quickrow .pdd-qgrid>button,
  .pdd-home .pdd-quickrow .pdd-discount{margin:0!important;width:auto!important;height:100%}
}

/* ── Категории: компактный ряд ── */
.pdd-home .pdd-cats-clean{padding:0 0 12px!important}
.pdd-home .pdd-cats-clean>div:first-child{padding:0 0 10px!important}
.pdd-home .pdd-cats-clean>div:first-child h2{font-size:19px!important}
.pdd-home .pdd-cats-clean .pdd-cats-grid{
  display:flex!important;gap:10px!important;overflow-x:auto!important;
  margin:0 -16px!important;padding:2px 16px 8px!important;
  scroll-snap-type:x proximity;scroll-padding-left:16px;scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.pdd-home .pdd-cats-clean .pdd-cats-grid::-webkit-scrollbar{display:none}
.pdd-home .pdd-cats-grid>button{
  --tc:var(--accent);
  flex:0 0 auto!important;width:auto!important;height:56px!important;min-height:0!important;
  flex-direction:row!important;justify-content:flex-start!important;align-items:center!important;
  gap:10px!important;padding:0 18px 0 9px!important;border-radius:18px!important;
  background:var(--surf)!important;border:1px solid var(--line)!important;
  box-shadow:0 1px 2px rgba(17,19,24,.04),0 8px 18px -12px rgba(17,19,24,.18)!important;
  scroll-snap-align:start;white-space:nowrap;
  transition:transform .15s,box-shadow .15s,border-color .15s!important;
}
.pdd-home .pdd-cats-grid>button:nth-child(1){--tc:#E2763F}
.pdd-home .pdd-cats-grid>button:nth-child(2){--tc:#3E74DE}
.pdd-home .pdd-cats-grid>button:nth-child(3){--tc:#D6428A}
.pdd-home .pdd-cats-grid>button:nth-child(4){--tc:#7C4DEB}
.pdd-home .pdd-cats-grid>button:nth-child(5){--tc:#E0475F}
.pdd-home .pdd-cats-grid>button:nth-child(6){--tc:#1FA37A}
.pdd-home .pdd-cats-grid>button>div{
  width:38px!important;height:38px!important;border-radius:13px!important;
  background:color-mix(in srgb,var(--tc) 14%,transparent)!important;
}
.pdd-home .pdd-cats-grid>button>div svg,
.pdd-home .pdd-cats-grid>button>div svg *{stroke:var(--tc)!important}
.pdd-home .pdd-cats-grid>button>span{
  font-size:13.5px!important;font-weight:700!important;line-height:1.1!important;
  text-align:left!important;white-space:nowrap!important;letter-spacing:-.01em!important;
}
@media(min-width:700px){
  .pdd-home .pdd-cats-clean .pdd-cats-grid{
    display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;
    margin:0!important;padding:2px 0 8px!important;overflow:visible!important;
  }
  .pdd-home .pdd-cats-grid>button{width:100%!important;height:62px!important;padding:0 14px 0 11px!important;border-radius:20px!important}
  .pdd-home .pdd-cats-grid>button>div{width:42px!important;height:42px!important}
  .pdd-home .pdd-cats-grid>button>span{overflow:hidden;text-overflow:ellipsis}
}
@media(hover:hover){
  .pdd-home .pdd-cats-grid>button:hover{transform:translateY(-2px);border-color:color-mix(in srgb,var(--tc) 45%,var(--line))!important;box-shadow:0 12px 24px -14px color-mix(in srgb,var(--tc) 60%,transparent)!important}
}


/* ═══ V79.3 — главная: единая система отступов + компактные баннеры ═══
   .pdd-home сам задаёт боковой отступ (16px); блоки внутри его не дублируют. */
html body .pdd-home>.pdd-h-top,
html body .pdd-home>.pdd-h-popular{padding-left:0!important;padding-right:0!important}
html body .pdd-home>.pdd-h-deals>div{padding-left:0!important;padding-right:0!important}
html body .pdd-home .pdd-cats-clean>div:first-child{padding-left:0!important;padding-right:0!important}

/* — Розыгрыш — */
html body .pdd-home .rf-banner{
  display:block;width:100%;margin:2px 0 10px!important;padding:13px 14px 12px;border:0;border-radius:18px;
  text-align:left;cursor:pointer;color:#fff;position:relative;overflow:hidden;
  background:linear-gradient(120deg,#17122b 0%,#2d1a78 60%,#5b34d6 125%);
  box-shadow:0 10px 24px -16px rgba(45,26,120,.7);
}
.rf-banner::after{content:"";position:absolute;right:-30px;top:-50px;width:120px;height:120px;border-radius:50%;background:rgba(255,255,255,.06);pointer-events:none}
.rf-b-row{display:flex;align-items:center;gap:12px;position:relative;z-index:1}
.rf-b-ico{flex:0 0 40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.13);box-shadow:inset 0 0 0 1px rgba(255,255,255,.14)}
.rf-b-txt{flex:1;min-width:0;display:block}
.rf-b-kick{display:block;font:700 10.5px/1 var(--bd);letter-spacing:.06em;text-transform:uppercase;opacity:.7}
.rf-b-title{display:block;font:800 16.5px/1.2 var(--di);margin:4px 0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rf-b-sub{display:block;font:500 12px/1.35 var(--bd);opacity:.85}
.rf-b-prog{display:flex;align-items:center;gap:10px;margin-top:11px;position:relative;z-index:1}
.rf-b-bar{flex:1;height:5px;border-radius:5px;background:rgba(255,255,255,.2);overflow:hidden}
.rf-b-bar i{display:block;height:100%;border-radius:5px;background:linear-gradient(90deg,#fff,#d9ccff)}
.rf-b-cnt{font:700 11px/1 var(--bd);opacity:.9;white-space:nowrap;font-variant-numeric:tabular-nums}

/* — Промо «Жеңіл тауарлар» — */
html body .pdd-home .pdd-promo{
  display:flex;align-items:center;gap:12px;width:100%;margin:0 0 14px!important;padding:13px 14px;border:0;border-radius:18px;
  text-align:left;cursor:pointer;color:#fff;position:relative;overflow:hidden;
  background:var(--brand-grad);box-shadow:0 10px 24px -16px rgba(108,43,217,.7);
}
.pdd-promo::after{content:"";position:absolute;right:-26px;bottom:-56px;width:110px;height:110px;border-radius:50%;background:rgba(255,255,255,.10);pointer-events:none}
.pdd-promo>*{position:relative;z-index:1}
.pdd-promo-ico{flex:0 0 40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.16);box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}
.pdd-promo-txt{flex:1;min-width:0;display:block}
.pdd-promo-title{display:block;font:800 16.5px/1.2 var(--di);letter-spacing:-.01em}
.pdd-promo-sub{display:block;font:500 12px/1.35 var(--bd);opacity:.88;margin-top:3px}
@media(hover:hover){.pdd-promo,.rf-banner{transition:transform .15s}.pdd-promo:hover,.rf-banner:hover{transform:translateY(-1px)}}

/* — ПК: два баннера в один ряд — */
@media(min-width:900px){
  .pdd-home{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:14px;align-content:start}
  .pdd-home>*{grid-column:1/-1;min-width:0}
  .pdd-home>.rf-banner,.pdd-home>.pdd-promo{grid-column:auto;align-self:stretch;display:flex;flex-direction:column;justify-content:center}
  .pdd-home>.rf-banner{margin:2px 0 14px!important}
  .pdd-home>.rf-banner~.pdd-promo{margin-top:2px!important}
  .pdd-home>.pdd-promo{flex-direction:row}
  .pdd-home:not(:has(.rf-banner))>.pdd-promo{grid-column:1/-1}
  .pdd-home .pdd-quickrow .pdd-qgrid{display:contents!important}
}

/* Поиск — одна чистая плашка */
html body .pdd-home>.pdd-h-top form{
  background:var(--surf)!important;border:1px solid var(--line)!important;border-radius:16px!important;
  padding:3px 6px 3px 14px!important;gap:8px!important;
  box-shadow:0 1px 2px rgba(17,19,24,.04),0 10px 22px -16px rgba(17,19,24,.22)!important;
}
html body .pdd-home>.pdd-h-top form:focus-within{border-color:var(--accent)!important;box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 16%,transparent)!important}
html body .pdd-home>.pdd-h-top form input:not([type="file"]){
  background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;
  outline:none!important;min-height:42px;padding-left:0!important;font-size:14.5px!important;
}

@media(min-width:1100px){
  .pdd-home>.pdd-h-top{position:relative}
  .pdd-home>.pdd-h-top>div:first-child{position:absolute!important;top:19px;right:0;padding:0!important;margin:0!important}
  .pdd-home>.pdd-h-top>div:first-child>:first-child{display:none!important}
  .pdd-home>.pdd-h-top form{margin-right:108px}
}

/* ═══ V79.9 — главная: плотный ритм без «воздуха», AI/Бонусы вверху ═══
   Единый интервал между блоками (14px) через gap; внешние margin блоков обнулены. */
html body div.pdd-home.pdd-home{padding-top:8px!important;padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))!important;row-gap:14px!important}
@media(max-width:899px){html body div.pdd-home.pdd-home{display:flex!important;flex-direction:column}}
html body div.pdd-home.pdd-home>*{margin:0!important;min-width:0}

/* Шапка и поиск */
html body div.pdd-home .pdd-h-top{padding:0!important;gap:10px!important}
html body div.pdd-home .pdd-h-top>div:last-child{margin-top:0!important}

/* AI-помощник + Бонусы */
html body div.pdd-home .pdd-hq{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px!important}
html body div.pdd-home .pdd-hq-card{
  display:flex;align-items:center;gap:10px;min-width:0;min-height:56px;padding:9px 12px;
  border:1px solid var(--line);border-radius:16px!important;background:var(--surf);color:var(--ink);
  text-align:left;cursor:pointer;font-family:var(--bd);box-shadow:none!important;white-space:normal;
}
html body div.pdd-home .pdd-hq-ai{background:var(--brand-grad);border-color:transparent;color:#fff;box-shadow:0 8px 18px -12px rgba(108,43,217,.85)!important}
html body div.pdd-home .pdd-hq-card:active{transform:scale(.98)}
.pdd-hq-ico{flex:0 0 34px;width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:var(--accent-wash)}
.pdd-hq-ai .pdd-hq-ico{background:rgba(255,255,255,.18)}
.pdd-hq-txt{display:block;min-width:0;flex:1}
.pdd-hq-t{display:block;font:700 13.5px/1.2 var(--di);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pdd-hq-s{display:block;font:500 11.5px/1.25 var(--bd);margin-top:2px;opacity:.82;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pdd-hq-bonus .pdd-hq-s{color:var(--accent-ink);opacity:1;font-weight:700}
html[data-theme="dark"] .pdd-hq-bonus .pdd-hq-s{color:var(--accent)}
html[data-theme="dark"] .pdd-hq-bonus .pdd-hq-ico{background:var(--accent-wash)}

/* Категории */
html body div.pdd-home .pdd-cats-clean{padding:0!important}
html body div.pdd-home .pdd-cats-clean>div:first-child{padding:0 0 8px!important}
html body div.pdd-home .pdd-cats-clean .pdd-cats-grid{padding-top:0!important;padding-bottom:2px!important}

/* Заголовки секций, сетки, ленты */
html body div.pdd-home .pdd-h-popular>div:first-child,
html body div.pdd-home .pdd-h-cheap>div:first-child>div,
html body div.pdd-home .pdd-h-deals>div:first-child>div{margin-bottom:10px!important}
html body div.pdd-home .pdd-h-cheap>div:first-child{padding:0!important}
/* Горизонтальные ленты товаров */
.pdd-shelf{position:relative;min-width:0}
.pdd-shelf-track{display:flex;gap:12px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding:2px 0 8px}
.pdd-shelf-track::-webkit-scrollbar{display:none}
@media(max-width:899px){.pdd-shelf-track{margin:0 -16px;padding:2px 16px 8px;scroll-padding-left:16px}}
.pdd-shelf-i{flex:0 0 auto;width:clamp(146px,43vw,176px);scroll-snap-align:start;min-width:0}
@media(min-width:900px){.pdd-shelf-i{width:200px}}
html body div.pdd-home .pdd-shelf-end{flex:0 0 auto;width:112px;scroll-snap-align:start;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:12px;border:1.5px dashed var(--line);border-radius:20px!important;background:var(--surf);color:var(--ink);font:700 13px/1.25 var(--bd);text-align:center;cursor:pointer;box-shadow:none!important}
.pdd-shelf-endico{width:40px;height:40px;border-radius:50%;background:var(--accent-wash);display:flex;align-items:center;justify-content:center}
.pdd-shelf-nav{display:none}
@media(hover:hover) and (min-width:900px){
  html body div.pdd-home .pdd-shelf-nav{display:flex;position:absolute;top:36%;z-index:3;width:40px;height:40px;padding:0;border-radius:50%!important;border:1px solid var(--line);background:var(--surf);box-shadow:0 6px 18px rgba(23,21,31,.16);align-items:center;justify-content:center;cursor:pointer}
  html body div.pdd-home .pdd-shelf-nav[hidden]{display:none}
  .pdd-shelf-prev{left:-14px}.pdd-shelf-next{right:-14px}
}

/* Розыгрыш и личная скидка */
html body div.pdd-home .rf-banner{margin:0!important}
html body div.pdd-home .pdd-discount{margin:0!important;width:100%!important;padding:10px 14px!important}
