/* TASK-20261115-030 (v1.0.0): ШІ-чат GreenDecor, вікно замість повноекранної сторінки. Власний файл, модуль OcBox не змінюємо. Кольори модуля не чіпаємо. */

/* --- 030: кнопка «закрити» велика на всіх ширинах (зона натиску 44x44) --- */
#ocbox-ai .ocbox-ai-close {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  flex: 0 0 44px !important;
  border-radius: 12px !important;
  font-size: 30px !important;
  line-height: 1 !important;
  font-weight: 400 !important;
  background: rgba(255, 255, 255, .28) !important;
  color: #fff !important;
  padding: 0 !important;
}
#ocbox-ai .ocbox-ai-close:hover,
#ocbox-ai .ocbox-ai-close:focus-visible { background: rgba(255, 255, 255, .42) !important; }

/* --- 030: затемнення під вікном чату (елемент створює gd_chat_window.js) --- */
#gdc-chat-dim { display: none; }

@media (max-width: 768px) {
  /* відкритий чат = плаваюче вікно, а не нова сторінка. Висота стежить за клавіатурою через --ai-chat-vh модуля */
  #ocbox-ai #ocbox-ai-chat {
    --gdc-chat-h: min(78vh, calc(var(--ai-chat-vh, 1vh) * 100 - 24px));
    width: min(94vw, 480px) !important;
    max-width: 94vw !important;
    min-width: 0 !important;
    height: var(--gdc-chat-h) !important;
    max-height: var(--gdc-chat-h) !important;
    min-height: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto !important;
    top: calc(var(--ai-chat-vh, 1vh) * 100 - var(--gdc-chat-h) - 12px) !important;
    bottom: auto !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 44px rgba(0, 0, 0, .38), 0 0 0 1px rgba(0, 0, 0, .06) !important;
    padding-bottom: 0 !important;
  }
  #ocbox-ai #ocbox-ai-chat .ocbox-ai-header { padding: 10px 10px 10px 16px !important; }
  #gdc-chat-dim.gdc-on {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 2147483646;
    -webkit-tap-highlight-color: transparent;
  }
}
