/* ================================================================
   Cookie Consent — eurochemgroup
   БЭМ: .cookie, .cookie__banner, .cookie__modal, .cookie__acc-*
   Стилистика: ProximaNova / accordion-one (Уралхим)
   ================================================================ */

   .cookie-resolved .cookie__banner {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  
  /* ── ОБЩИЙ КОНТЕЙНЕР ── */
  .cookie { 
  }
  
  .cookie-resolved .cookie__banner {
    display: none !important;
  }
  
  /* По умолчанию скрыт — показывается только через JS (.is-ready) */
  .cookie__banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40%;
    min-width: 320px;
    max-width: 500px;
    background: #fff;
    border-top: 5px solid #f5c400;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: none;
  }
  
  .cookie__banner.is-ready {
    visibility: visible;
    transform: translateX(0) translateY(0);
    opacity: 1;
    pointer-events: all;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  }
  
  .cookie__banner.is-hidden {
    transform: translateX(-120%) translateY(0);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  }
  
  .cookie__banner-text {
    font-size: 14px;
    font-weight: 300;
    color: #383838;
    line-height: 1.6;
    margin: 0;
  }
  
  .cookie__banner-text a {
    color: #048ec9;
    text-decoration: none;
  }
  
  .cookie__banner-text a:hover {
    color: #383838;
  }
  
  .cookie__banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
  }
  
  /* Кнопки в баннере на всю ширину */
  .cookie__banner-actions .cookie__btn {
    flex: 1;
    text-align: center;
    min-width: 0;
  }
  
  /* ================================================================
     КНОПКИ
     ================================================================ */
  .cookie__btn { 
    font-size: 14px;
    font-weight: 300;
    padding: 10px 22px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    letter-spacing: 0.03em;
    border: 1.5px solid transparent;
  }
  
  /* Жёлтая — Accept All */
  .cookie__btn--yellow {
    background: #f5c400;
    color: #383838;
    border-color: #f5c400;
    font-weight: 700;
  }
  
  .cookie__btn--yellow:hover {
    background: #e6b800;
    border-color: #e6b800;
  }
  
  /* Контурная синяя — Save / Settings */
  .cookie__btn--outline {
    background: #fff;
    color: #048ec9;
    border-color: #048ec9;
  }
  
  .cookie__btn--outline:hover {
    background: #f0f8fc;
  }
  
  /* Серая — Settings в баннере */
  .cookie__btn--ghost {
    background: transparent;
    color: #888;
    border-color: #d0d0d0;
  }
  
  .cookie__btn--ghost:hover {
    background: #f5f5f5;
    color: #383838;
  }
  
  /* Красная контурная — Reject */
  .cookie__btn--danger {
    background: #fff;
    color: #c0392b;
    border-color: #c0392b;
  }
  
  .cookie__btn--danger:hover {
    background: #fdf0ef;
  }
  
  /* ================================================================
     OVERLAY + MODAL
     ================================================================ */
  .cookie__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .cookie__overlay.is-open {
    opacity: 1;
    pointer-events: all;
  }
  
  .cookie__modal {
    background: #fff;
    border-top: 5px solid #f5c400;
    width: 100%;
    max-width: 780px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(20px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
  }
  
  .cookie__overlay.is-open .cookie__modal {
    transform: translateY(0);
  }
  
  .cookie__modal-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    flex-shrink: 0;
  }
  
  .cookie__modal-title {
    font-size: 26px;
    font-weight: 300;
    color: #048ec9;
    margin-bottom: 10px;
  }
  
  .cookie__modal-desc {
    font-size: 15px;
    font-weight: 300;
    color: #383838;
    line-height: 1.7;
  }
  
  .cookie__modal-desc a {
    color: #048ec9;
    text-decoration: none;
  }
  
  .cookie__modal-desc a:hover {
    color: #383838;
  }
  
  .cookie__modal-body {
    padding: 0 32px 24px;
    overflow-y: auto;
    flex: 1;
  }
  
  /* ================================================================
     АККОРДЕОН (accordion-one стиль)
     ================================================================ */
  .cookie__acc-item {
    background: #fff;
    border-top: 3px solid #f5c400;
    margin-top: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
  }
  
  .cookie__acc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    cursor: pointer;
    user-select: none;
    background: #fff;
  }
  
  .cookie__acc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
  }
  
  .cookie__acc-title {
    font-size: 17px;
    font-weight: 300;
    color: #048ec9;
    letter-spacing: 0.01em;
  }
  
  /* Бейдж "Always active" */
  .cookie__acc-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #e8f7f0;
    color: #1a7a4a;
    border: 1px solid #b2dfc9;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Плюс/крест тоггл */
  .cookie__acc-toggle {
    font-size: 24px;
    font-weight: 300;
    color: #2a90d4;
    line-height: 1;
    transition: transform 0.35s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 12px;
  }
  
  .cookie__acc-item.is-open .cookie__acc-toggle {
    transform: rotate(45deg);
  }
  
  /* Тело — анимация как в accordion-one */
  .cookie__acc-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease,
      padding 0.35s ease;
    opacity: 0;
    padding: 0 24px;
    background-color: #f8f7f5;
  }
  
  .cookie__acc-item.is-open .cookie__acc-body {
    max-height: 1400px;
    opacity: 1;
    padding: 18px 24px 20px;
  }
  
  .cookie__acc-desc {
    font-size: 14px;
    font-weight: 300;
    color: #383838;
    line-height: 1.7;
    margin-bottom: 16px;
  }
  
  /* ================================================================
     TOGGLE SWITCH
     ================================================================ */
  .cookie__switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  
  /* Клик по строке не открывает аккордеон */
  .cookie__switch-row--stop {
    pointer-events: all;
  }
  
  .cookie__switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
  }
  
  .cookie__switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
  }
  
  .cookie__switch-slider {
    position: absolute;
    inset: 0;
    background: #d0d0d0;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s;
  }
  
  .cookie__switch-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }
  
  .cookie__switch input:checked + .cookie__switch-slider {
    background: #048ec9;
  }
  
  .cookie__switch input:checked + .cookie__switch-slider::before {
    transform: translateX(18px);
  }
  
  /* Disabled = всегда включён (технические куки) */
  .cookie__switch input:disabled + .cookie__switch-slider {
    background: #1a7a4a;
    cursor: not-allowed;
    opacity: 0.85;
  }
  
  .cookie__switch input:disabled + .cookie__switch-slider::before {
    transform: translateX(18px);
  }
  
  .cookie__switch-label {
    font-size: 13px;
    color: #888;
    font-weight: 300;
    min-width: 30px;
  }
  
  /* ================================================================
     ТАБЛИЦА КУКИ
     ================================================================ */
  .cookie__table-wrap {
    overflow-x: auto;
    margin-top: 10px;
  }
  
  .cookie__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-weight: 300;
    color: #383838;
    min-width: 420px;
  }
  
  .cookie__table thead tr {
    background: #f0f0f0;
  }
  
  .cookie__table th {
    font-weight: 700;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid #e0e0e0;
    color: #555;
    letter-spacing: 0.03em;
    font-size: 12px;
    text-transform: uppercase;
  }
  
  .cookie__table td {
    padding: 8px 12px;
    border-bottom: 1px solid #ececec;
    vertical-align: top;
    line-height: 1.5;
  }
  
  .cookie__table tbody tr:last-child td {
    border-bottom: none;
  }
  
  .cookie__table tbody tr:hover {
    background: #fafafa;
  }
  
  .cookie__table td:first-child {
    font-family: monospace;
    font-size: 12px;
    color: #048ec9;
    white-space: nowrap;
  }
  
  .cookie__table td:last-child {
    white-space: nowrap;
    color: #888;
  }
  
  /* ================================================================
     MODAL FOOTER
     ================================================================ */
  .cookie__modal-footer {
    padding: 20px 32px 28px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
    background: #fff;
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
  }
  
  /* ================================================================
     TOAST
     ================================================================ */
  .cookie__toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #048ec9;
    color: #fff;
    font-family: "ProximaNova", Arial, sans-serif;
    font-size: 14px;
    font-weight: 300;
    padding: 12px 22px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    z-index: 20000;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
  }
  
  .cookie__toast.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* ================================================================
     АДАПТИВ
     ================================================================ */
  
  /* Планшеты (768px - 1024px) */
  @media (min-width: 768px) and (max-width: 1024px) {
    .cookie__banner {
      width: 60%;
      min-width: 350px;
      max-width: 450px;
      left: 20px;
      bottom: 20px;
    }
  
    .cookie__modal {
      max-width: 90%;
      margin: 20px;
    }
  
    .cookie__modal-title {
      font-size: 24px;
    }
  
    .cookie__modal-header {
      padding: 24px 28px 18px;
    }
  
    .cookie__modal-body {
      padding: 0 28px 20px;
    }
  
    .cookie__modal-footer {
      padding: 18px 28px 24px;
    }
  
    .cookie__acc-header {
      padding: 16px 20px;
    }
  
    .cookie__acc-title {
      font-size: 16px;
    }
  }
  
  /* Маленькие планшеты и большие телефоны (576px - 767px) */
  @media (max-width: 767px) {
    .cookie__banner {
      left: 16px;
      right: 16px;
      bottom: 16px;
      width: auto;
      min-width: auto;
      max-width: none;
      padding: 20px;
    }
  
    .cookie__banner-actions {
      width: 100%;
    }
  
    .cookie__banner-actions .cookie__btn {
      flex: 1;
      text-align: center;
    }
  
    .cookie__modal {
      max-width: 95%;
      margin: 10px;
    }
  
    .cookie__modal-header {
      padding: 20px 20px 16px;
    }
  
    .cookie__modal-title {
      font-size: 22px;
    }
  
    .cookie__modal-desc {
      font-size: 14px;
    }
  
    .cookie__modal-body {
      padding: 0 20px 20px;
    }
  
    .cookie__modal-footer {
      padding: 16px 20px 20px;
      flex-direction: column;
    }
  
    .cookie__modal-footer .cookie__btn {
      width: 100%;
      text-align: center;
    }
  
    .cookie__acc-header {
      padding: 16px 16px;
    }
  
    .cookie__acc-title {
      font-size: 15px;
    }
  
    .cookie__acc-badge {
      font-size: 10px;
      padding: 2px 8px;
    }
  }
  
  /* Мобильные телефоны (до 575px) */
  @media (max-width: 575px) {
    .cookie__banner {
      left: 12px;
      right: 12px;
      bottom: 12px;
      padding: 16px;
      gap: 16px;
    }
  
    .cookie__banner-text {
      font-size: 13px;
    }
  
    .cookie__banner-actions {
      gap: 8px;
    }
  
    .cookie__banner-actions .cookie__btn {
      padding: 8px 16px;
      font-size: 13px;
    }
  
    .cookie__modal-header {
      padding: 16px 14px 12px;
    }
  
    .cookie__modal-title {
      font-size: 18px;
    }
  
    .cookie__modal-desc {
      font-size: 13px;
    }
  
    .cookie__modal-body {
      padding: 0 14px 16px;
    }
  
    .cookie__modal-footer {
      padding: 12px 14px 16px;
      gap: 8px;
    }
  
    .cookie__acc-header {
      padding: 12px 14px;
    }
  
    .cookie__acc-item.is-open .cookie__acc-body {
      padding: 12px 14px 14px;
    }
  
    .cookie__acc-title {
      font-size: 14px;
    }
  
    .cookie__acc-badge {
      display: none;
    }
  
    .cookie__acc-desc {
      font-size: 13px;
    }
  
    .cookie__switch-label {
      font-size: 12px;
      min-width: 25px;
    }
  
    .cookie__table {
      font-size: 12px;
      min-width: 360px;
    }
  
    .cookie__table th,
    .cookie__table td {
      padding: 6px 8px;
    }
  
    .cookie__toast {
      bottom: 16px;
      right: 16px;
      left: 16px;
      text-align: center;
      font-size: 13px;
      padding: 10px 16px;
    }
  }
  
  /* Очень маленькие телефоны (до 380px) */
  @media (max-width: 380px) {
    .cookie__banner {
      padding: 14px;
    }
  
    .cookie__banner-text {
      font-size: 12px;
    }
  
    .cookie__banner-actions .cookie__btn {
      padding: 6px 12px;
      font-size: 12px;
    }
  
    .cookie__modal-header {
      padding: 14px 12px 10px;
    }
  
    .cookie__modal-title {
      font-size: 16px;
    }
  
    .cookie__modal-body {
      padding: 0 12px 14px;
    }
  
    .cookie__acc-header {
      padding: 10px 12px;
    }
  
    .cookie__acc-title {
      font-size: 13px;
    }
  }