/* Баннер/настройки cookies, чекбокс согласия на обработку ПДн и ссылки на
   юридические документы в футерах (03.10.2026, docs/LEGAL_DOCS.md).
   Только токены tokens.css → светлая/тёмная/авто тема без дублей.
   Селекторы с префиксом контейнера: глобальные стили button/input из
   public.css и cabinet.css не должны их перебивать. */

/* ---------- Баннер ---------- */
.cc-banner{position:fixed;left:16px;right:16px;bottom:16px;z-index:1000;
  background:var(--color-surface);color:var(--color-text);
  border:1px solid var(--color-border-strong);border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);max-width:1040px;margin:0 auto;
  /* 11.10.2026: на невысоком окне (ноутбук 700-800 px, Safari с панелью вкладок) баннер не занимает больше
     ~55% высоты - остальное прокручивается внутри; отступ снизу учитывает вырез/жест «домой» (safe-area) */
  bottom:calc(16px + env(safe-area-inset-bottom,0px));
  max-height:min(55vh,460px);max-height:min(55dvh,460px);overflow-y:auto;overscroll-behavior:contain}
.cc-banner[hidden]{display:none}
.cc-banner-inner{display:flex;flex-direction:column;gap:14px;padding:16px 18px}
.cc-banner-title{margin:0 0 4px;font-weight:600;font-size:15px;color:var(--color-heading)}
.cc-banner-text{margin:0;font-size:14px;line-height:1.5;color:var(--color-text-2)}
.cc-banner a,.cc-dialog a{color:var(--color-link);text-decoration:underline}
.cc-actions{display:flex;flex-wrap:wrap;gap:8px}
@media (min-width:760px){
  .cc-banner-inner{flex-direction:row;align-items:center;justify-content:space-between;gap:24px;padding:16px 20px}
  .cc-actions{flex-wrap:nowrap;flex-shrink:0}
}

/* Кнопки — свои классы, не зависят от .btn сайта/кабинета */
.cc-banner button.cc-btn,.cc-dialog button.cc-btn{display:inline-flex;align-items:center;justify-content:center;
  min-height:40px;padding:0 16px;border-radius:var(--radius-md);border:1px solid transparent;
  font:inherit;font-size:14px;font-weight:600;line-height:1.2;cursor:pointer;white-space:nowrap;
  box-shadow:none;transform:none;text-transform:none;letter-spacing:normal}
.cc-banner button.cc-btn-primary,.cc-dialog button.cc-btn-primary{background:var(--color-action);border-color:var(--color-action);color:var(--color-on-action)}
.cc-banner button.cc-btn-primary:hover,.cc-dialog button.cc-btn-primary:hover{background:var(--color-action-hover);border-color:var(--color-action-hover)}
.cc-banner button.cc-btn-secondary,.cc-dialog button.cc-btn-secondary{background:var(--color-surface);border-color:var(--color-border-strong);color:var(--color-text)}
.cc-banner button.cc-btn-secondary:hover,.cc-dialog button.cc-btn-secondary:hover{background:var(--color-surface-hover)}
.cc-banner button.cc-btn-ghost{background:transparent;color:var(--color-link);text-decoration:underline;padding:0 8px}
.cc-banner button.cc-btn-ghost:hover{background:var(--color-surface-hover)}
.cc-banner button.cc-btn:focus-visible,.cc-dialog button:focus-visible,.cc-dialog .cc-switch:focus-visible,
[data-cc-open]:focus-visible{outline:3px solid var(--color-focus);outline-offset:2px}
@media (max-width:480px){
  .cc-banner{left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom))}
  .cc-banner-inner{gap:10px;padding:12px 14px}
  .cc-banner-text{font-size:14px;line-height:1.45}
  /* 09.10.2026: на телефоне баннер занимал больше половины экрана (3 кнопки столбиком):
     все три кнопки - в один ряд («Настроить» ссылкой слева), высота кнопок 44px. */
  .cc-banner .cc-actions{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(0,1fr);gap:6px}
  .cc-banner button.cc-btn{min-height:44px;padding:0 8px;min-width:0}
  .cc-banner button.cc-btn.cc-btn-ghost{padding:0 6px}
  .cc-dialog .cc-actions{flex-direction:column-reverse}
  .cc-dialog button.cc-btn{width:100%;min-height:44px}
}
/* Совсем узкие экраны (320px): три кнопки в ряд не помещаются - «Настроить» отдельной строкой. */
@media (max-width:359px){
  .cc-banner .cc-actions{grid-template-columns:1fr 1fr}
  .cc-banner .cc-actions .cc-btn-ghost{grid-column:1/-1;grid-row:2}
}

/* ---------- Диалог настроек ---------- */
.cc-dialog{border:1px solid var(--color-border-strong);border-radius:var(--radius-xl);padding:0;
  width:min(560px,calc(100vw - 24px));max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;
  background:var(--color-surface);color:var(--color-text);box-shadow:var(--shadow-lg)}
.cc-dialog::backdrop{background:var(--color-overlay, rgba(15,23,42,.55))}
.cc-dialog.cc-dialog-fallback{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1001}
.cc-dialog-body{padding:20px 22px 22px}
.cc-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px}
.cc-dialog-head h2,.cc-dialog-title{margin:0;font-size:19px;color:var(--color-heading)}
.cc-dialog-title{font-weight:650;line-height:1.25;letter-spacing:-.015em}
.cc-dialog button.cc-close{min-height:36px;min-width:36px;width:36px;padding:0;border:0;border-radius:var(--radius-pill);
  background:transparent;color:var(--color-text-2);font-size:24px;line-height:1;cursor:pointer}
.cc-dialog button.cc-close:hover{background:var(--color-surface-hover);color:var(--color-text)}
.cc-dialog-desc{margin:0 0 14px;color:var(--color-text-2);font-size:14px;line-height:1.5}
.cc-cats{list-style:none;margin:0 0 18px;padding:0;display:flex;flex-direction:column;gap:10px}
.cc-cat{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:12px 14px;
  border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface-2)}
.cc-cat-text{display:flex;flex-direction:column;gap:4px;min-width:0}
.cc-cat-title{font-weight:600;color:var(--color-heading);cursor:pointer}
.cc-cat-desc{font-size:13px;line-height:1.45;color:var(--color-text-muted)}
.cc-dialog-actions{justify-content:flex-end}

/* Переключатель на базе checkbox (role=switch) */
.cc-dialog input.cc-switch{appearance:none;-webkit-appearance:none;flex-shrink:0;margin:2px 0 0;
  width:44px;height:24px;min-height:0;border-radius:999px;border:1px solid var(--color-border-strong);
  background:var(--color-surface-3);position:relative;cursor:pointer;transition:background .15s}
.cc-dialog input.cc-switch::after{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;
  border-radius:50%;background:var(--color-surface);box-shadow:var(--shadow-sm);transition:transform .15s}
.cc-dialog input.cc-switch:checked{background:var(--color-action);border-color:var(--color-action)}
.cc-dialog input.cc-switch:checked::after{transform:translateX(20px)}
.cc-dialog input.cc-switch:disabled{opacity:.6;cursor:not-allowed}
@media (prefers-reduced-motion:reduce){.cc-dialog input.cc-switch,.cc-dialog input.cc-switch::after{transition:none}}

/* ---------- Чекбокс согласия на обработку ПДн ---------- */
.pd-consent{display:flex;flex-direction:column;gap:6px;margin:4px 0 6px;flex-basis:100%;text-align:left}
.pd-consent-label{display:flex;align-items:flex-start;gap:10px;font-size:13.5px;line-height:1.45;
  color:var(--color-text-2);cursor:pointer;font-weight:400}
.pd-consent-label input[type="checkbox"]{flex-shrink:0;width:18px;height:18px;min-height:0;margin:1px 0 0;
  accent-color:var(--color-action);cursor:pointer}
.pd-consent-label a{color:var(--color-link);text-decoration:underline}
.pd-consent-error{margin:0 0 0 28px;font-size:13px;line-height:1.4;color:var(--color-danger);font-weight:500}
.pd-consent-error[hidden]{display:none}
.pd-consent.is-invalid .pd-consent-label input[type="checkbox"]{outline:2px solid var(--color-danger);outline-offset:2px}
.is-pd-blocked{opacity:.55;cursor:not-allowed}

/* ---------- Ссылки на документы ---------- */
button.cc-link,.cc-link{display:inline;min-height:0;padding:0;margin:0;border:0;background:none;box-shadow:none;
  font:inherit;color:inherit;text-decoration:underline;cursor:pointer}
button.cc-link:hover{background:none;color:var(--color-link)}
@media (min-width:960px){.site-footer .footer-grid.has-legal{grid-template-columns:2fr 1fr 1fr 1fr}}
.cabinet-legal{margin-top:32px;padding-top:14px;border-top:1px solid var(--color-border);
  display:flex;flex-wrap:wrap;gap:6px 16px;font-size:12.5px;color:var(--color-text-muted)}
.cabinet-legal a,.cabinet-legal button.cc-link{color:var(--color-text-muted)}
.cabinet-legal a:hover,.cabinet-legal button.cc-link:hover{color:var(--color-link)}
/* 04.10.2026: реквизиты оператора в футерах сайта и кабинета (_legal_footer_operator.html). */
.footer-operator{flex-basis:100%;font-size:12.5px;color:var(--color-text-muted)}
.footer-operator a{color:inherit}
/* Баннер не должен перекрывать последний контент: место снизу, пока он виден. */
body:has(.cc-banner:not([hidden])){padding-bottom:180px}
@media (max-width:480px){body:has(.cc-banner:not([hidden])){padding-bottom:230px}}
@media (min-width:760px){body:has(.cc-banner:not([hidden])){padding-bottom:110px}}
