/* ===== Cookie Bar ===== */
.cookiebar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
}
.cookiebar[hidden]{ display:none !important; }

.cookiebar__inner{
  max-width: var(--container-max, 1200px);
  margin: 0 auto;
  background: var(--brand-yellow);
  color: var(--brand-gray, #2A2F33);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  overflow: hidden;
  padding: 24px 28px 20px;
  position: relative;
}

.cookiebar__panel{
  padding: 0 80px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.cookiebar__panel[hidden]{ display:none !important; }

/* Текст */
.cookiebar__text{
  font-size: 19px;
  line-height: 1.6;
}
.cookiebar__text a{
  color: inherit;
  text-decoration: underline;
}

/* Кнопки */
.cookiebar__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 4px;
}
.cookiebar .btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1.5px solid currentColor; background: transparent; color: var(--brand-gray, #2A2F33);
  text-decoration:none; cursor:pointer;
  transition: background .15s ease, box-shadow .15s ease, opacity .15s;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.cookiebar .btn:hover{ background: rgba(0,0,0,.06); }
.cookiebar .btn--outline{ background: transparent; border-color: currentColor; }
.cookiebar .btn--ghost{ background: rgba(255,255,255,.3); border-color: currentColor; }
.cookiebar .btn--primary{ background:#fff; border-color:#fff; font-weight:600; }
.cookiebar .btn--primary:hover{ box-shadow: 0 6px 14px rgba(0,0,0,.12); }

/* Иконка в кнопке */
.cookiebar .btn__ico{
  width: 28px; height: 28px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: inline-flex; align-items:center; justify-content:center;
  font-size: 14px; line-height: 1;
}
.cookiebar .btn__ico::before{
  content: "→";
  font-size: 14px;
}

/* Во втором состоянии делаем кнопку выше */
.cookiebar__panel--full .btn--ok{
  height: 52px;
  font-size: 16px;
}
.cookiebar__panel--full .btn__ico{
  width: 32px; height: 32px;
  font-size: 16px;
}

/* Крестик */
.cookiebar__close{
  position:absolute;
  top:10px; right:12px;
  width:28px; height:28px;
  border-radius:50%;
  background: transparent;
  border:0;
  color:inherit;
  cursor:pointer;
  font-size:20px;
  line-height:1;
  display:inline-grid;
  place-items:center;
}
.cookiebar__close:hover{ opacity:.85; }

/* ===== Настройки cookie ===== */
.cookie-settings{
  margin:24px 0;
  padding:16px;
  background:rgba(255,255,255,.2);
  border-radius:12px;
}
.cookie-settings__header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
  flex-wrap:wrap;
  gap:12px;
}
.cookie-toggle-all{
  display:flex;
  gap:8px;
}
.cookie-toggle-all .btn--small{
  height:32px;
  padding:0 12px;
  font-size:12px;
}
.cookie-item{
  border-top:1px solid rgba(0,0,0,.1);
  padding-top:16px;
  margin-top:16px;
}
.cookie-item__header{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.cookie-item__name{
  font-weight:600;
  font-size:15px;
}
.cookie-item__description{
  margin-top:8px;
}
.cookie-item__description a{
  color:inherit;
  text-decoration:underline;
}

/* Переключатель (toggle switch) */
.cookie-switch{
  position:relative;
  display:inline-block;
  width:48px;
  height:24px;
}
.cookie-switch input{
  opacity:0;
  width:0;
  height:0;
}
.cookie-switch__slider{
  position:absolute;
  cursor:pointer;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background-color:#ccc;
  transition:.3s;
  border-radius:24px;
}
.cookie-switch__slider:before{
  position:absolute;
  content:"";
  height:18px;
  width:18px;
  left:3px;
  bottom:3px;
  background-color:#fff;
  transition:.3s;
  border-radius:50%;
}
.cookie-switch input:checked + .cookie-switch__slider{
  background-color:#EEC024;
}
.cookie-switch input:checked + .cookie-switch__slider:before{
  transform:translateX(24px);
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 767px){
  .cookiebar__inner{
    border-radius: 0;
    padding: 16px 16px 20px;
  }
  
  .cookiebar__panel{
    padding: 0;
    gap: 12px;
  }
  
  .cookiebar__text{
    font-size: 14px;
    line-height: 1.5;
  }
  
  .cookiebar__text p{
    font-size: 14px !important;
  }
  
  .cookiebar__actions{
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
  }
  
  .cookiebar .btn{
    width: 100%;
    justify-content: center;
    height: 48px;
    font-size: 15px;
  }
  
  .cookiebar .btn__ico{
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  
  .cookiebar__close{
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    font-size: 24px;
  }
  
  /* Настройки cookie на мобильных */
  .cookie-settings{
    margin: 16px 0;
    padding: 12px;
  }
  
  .cookie-settings h4{
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }
  
  .cookie-settings__header{
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .cookie-toggle-all{
    width: 100%;
  }
  
  .cookie-toggle-all .btn--small{
    flex: 1;
    height: 36px;
    font-size: 13px;
  }
  
  .cookie-item__description p{
    font-size: 13px !important;
    line-height: 1.5 !important;
  }
  
  /* Заголовок в расширенном состоянии */
  .cookiebar__panel--full h3{
    font-size: 18px !important;
    margin-bottom: 16px !important;
  }
}

/* Планшеты */
@media (min-width: 768px) and (max-width: 899px){
  .cookiebar__inner{
    padding: 20px 24px;
  }
  
  .cookiebar__panel{
    padding: 0 20px;
  }
  
  .cookiebar__text{
    font-size: 16px;
  }
  
  .cookiebar__actions{
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .cookiebar .btn{
    flex: 1 1 auto;
    min-width: 140px;
  }
}

/* На десктопе одна колонка */
@media (min-width: 900px){
  .cookiebar__panel{
    grid-template-columns: 1fr;
    align-items: start;
  }
  .cookiebar__actions{ justify-self: start; }
}
