/* OptimusSport widgets: cookie bar, chat, global search, custom controls */
:root {
  --w-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --w-dur: 0.25s;
  --z-cookie: 620;
  --z-chat-launcher: 630;
  --z-chat-panel: 631;
  --z-global-search: 625;
  --cookie-bar-h: 0px;
}

body.is-modal-open .chat-launcher,
body.is-modal-open .chat-panel {
  z-index: 150;
}

body.is-chat-open {
  overflow: hidden;
}

body.has-cookie-bar {
  --cookie-bar-h: 92px;
  padding-bottom: var(--cookie-bar-h);
}

@media (min-width: 768px) {
  body.has-cookie-bar {
    --cookie-bar-h: 80px;
  }
}

/* ——— Remove native search clear ——— */
input[type="search"].global-search__input::-webkit-search-decoration,
input[type="search"].global-search__input::-webkit-search-cancel-button,
input[type="search"].global-search__input::-webkit-search-results-button,
input[type="search"].global-search__input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
input[type="search"].global-search__input {
  appearance: none;
}

.filters input[type="search"]::-webkit-search-cancel-button,
.filters input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

/* ——— Global header search (toggle + expandable row) ——— */
.site-search__toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid #dcd4d0;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #625650;
  transition:
    border-color var(--w-dur) var(--w-ease),
    background var(--w-dur) var(--w-ease),
    color var(--w-dur) var(--w-ease);
}
.site-search__toggle:hover {
  border-color: #c8beb8;
  background: #faf5f2;
  color: #130600;
}
.site-search__toggle[aria-expanded="true"] {
  border-color: #ff5300;
  color: #ff5300;
  background: #fff0eb;
}
.site-search__toggle svg {
  width: 22px;
  height: 22px;
}
.site-search-expand {
  position: relative;
  display: none;
  padding-bottom: 12px;
}
.site-search-expand.is-open {
  display: block;
}
.site-search-expand__inner {
  position: relative;
  max-width: min(520px, 100%);
  margin-left: auto;
}
@media (min-width: 1024px) {
  .site-search-expand__inner {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }
}
.global-search__input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid #dcd4d0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  color: #130600;
  background: #fff;
  transition:
    border-color var(--w-dur) var(--w-ease),
    box-shadow var(--w-dur) var(--w-ease);
}
.global-search__input:hover {
  border-color: #c8beb8;
}
.global-search__input:focus {
  outline: none;
  border-color: #ff5300;
  box-shadow: 0 0 0 3px rgba(255, 83, 0, 0.12);
}
.global-search__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(360px, 50vh);
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid #ebe5e1;
  border-radius: 16px;
  box-shadow:
    0 20px 25px -5px rgba(19, 6, 0, 0.12),
    0 10px 10px -5px rgba(19, 6, 0, 0.06);
  z-index: var(--z-global-search);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity var(--w-dur) var(--w-ease),
    transform var(--w-dur) var(--w-ease),
    visibility 0s linear var(--w-dur);
}
.global-search__panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}
.global-search__panel::-webkit-scrollbar {
  width: 8px;
}
.global-search__panel::-webkit-scrollbar-thumb {
  background: #dcd4d0;
  border-radius: 8px;
}
.global-search__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: #130600;
  border-bottom: 1px solid #f5efec;
  text-decoration: none;
}
.global-search__item:last-child {
  border-bottom: none;
}
.global-search__item:hover,
.global-search__item:focus {
  background: #faf5f2;
  outline: none;
}
.global-search__item:focus-visible {
  outline: 2px solid #ff5300;
  outline-offset: -2px;
}
.global-search__item-title {
  font-weight: 600;
  font-size: 13px;
}
.global-search__item-snippet {
  font-size: 12px;
  color: #7a6d66;
  margin-top: 2px;
}
.global-search__hint {
  padding: 12px 14px;
  font-size: 12px;
  color: #625650;
}
.global-search__fallback-title {
  font-size: 12px;
  font-weight: 600;
  color: #94867f;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px 4px;
}

/* ——— Cookie bar (fixed bottom) ——— */
.site-cookie-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-cookie);
  background: #130600;
  color: #faf5f2;
  padding: 16px 20px 18px;
  box-shadow: 0 -8px 30px rgba(19, 6, 0, 0.18);
  transform: translateY(0);
  opacity: 1;
  transition:
    transform 0.35s var(--w-ease),
    opacity 0.35s var(--w-ease);
}
.site-cookie-bar.is-hiding {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}
.site-cookie-bar__inner {
  width: min(100%, 1440px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  justify-content: space-between;
}
.site-cookie-bar p {
  margin: 0;
  flex: 1 1 280px;
  font-size: 14px;
  line-height: 1.55;
  color: #f5efec;
}
.site-cookie-bar a {
  color: #ffb89e;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.site-cookie-bar a:focus-visible {
  outline: 2px solid #ff5300;
  outline-offset: 3px;
  border-radius: 4px;
}
.site-cookie-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.site-cookie-bar .btn--primary {
  background: #ff5300;
  color: #fff;
  border: none;
}
.site-cookie-bar .btn--primary:hover {
  background: #e64a00;
}
.site-cookie-bar .btn--secondary {
  background: transparent;
  color: #faf5f2;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.site-cookie-bar .btn--secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}
.site-cookie-bar .btn--ghost {
  color: #dcd4d0;
  border: none;
  background: transparent;
}
.site-cookie-bar .btn--ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

/* ——— Chat widget ——— */
.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--cookie-bar-h));
  z-index: var(--z-chat-launcher);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ff5300, #ff8a66);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(255, 83, 0, 0.35);
  display: grid;
  place-items: center;
  transition:
    transform var(--w-dur) var(--w-ease),
    box-shadow var(--w-dur) var(--w-ease);
}
.chat-launcher:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 32px rgba(255, 83, 0, 0.4);
}
.chat-launcher:focus-visible {
  outline: 3px solid #130600;
  outline-offset: 3px;
}
.chat-launcher svg {
  width: 26px;
  height: 26px;
}
.chat-panel {
  position: fixed;
  right: 20px;
  bottom: calc(88px + var(--cookie-bar-h));
  z-index: var(--z-chat-panel);
  width: min(400px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 120px - var(--cookie-bar-h)));
  background: #fff;
  border-radius: 20px;
  border: 1px solid #ebe5e1;
  box-shadow: 0 25px 50px -12px rgba(19, 6, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity var(--w-dur) var(--w-ease),
    transform var(--w-dur) var(--w-ease),
    visibility 0s linear var(--w-dur);
}
.chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}
@media (max-width: 640px) {
  .chat-panel {
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    right: 0;
    bottom: 0;
  }
  .chat-launcher {
    right: 16px;
    bottom: calc(16px + var(--cookie-bar-h));
  }
}
.chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #faf5f2;
  border-bottom: 1px solid #ebe5e1;
}
.chat-panel__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #130600;
}
.chat-panel__close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #625650;
  transition: background var(--w-dur) var(--w-ease);
}
.chat-panel__close:hover {
  background: #f5efec;
}
.chat-panel__close:focus-visible {
  outline: 2px solid #ff5300;
  outline-offset: 2px;
}
.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}
.chat-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(6px);
  animation: chatMsgIn 0.28s var(--w-ease) forwards;
}
@keyframes chatMsgIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-msg {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .chat-panel,
  .global-search__panel,
  .site-cookie-bar,
  .chat-launcher,
  .custom-select__dropdown,
  .custom-checkbox__check {
    transition: none !important;
  }
}
.chat-msg--user {
  align-self: flex-end;
  background: #ff5300;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg--bot {
  align-self: flex-start;
  background: #f5efec;
  color: #130600;
  border-bottom-left-radius: 4px;
}
.chat-msg--bot a {
  color: #cc4100;
  font-weight: 600;
}
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  align-self: flex-start;
  background: #f5efec;
  border-radius: 12px;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94867f;
  animation: chatDot 1s ease-in-out infinite;
}
.chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes chatDot {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-typing span {
    animation: none;
    opacity: 0.6;
  }
}
.chat-panel__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #ebe5e1;
  background: #faf5f2;
}
.chat-panel__form input[type="search"],
.chat-panel__form input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #dcd4d0;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
}
.chat-panel__form input:focus {
  outline: none;
  border-color: #ff5300;
  box-shadow: 0 0 0 3px rgba(255, 83, 0, 0.1);
}
.chat-panel__send {
  height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: #ff5300;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--w-dur) var(--w-ease);
}
.chat-panel__send:hover {
  background: #e64a00;
}
.chat-panel__send:focus-visible {
  outline: 2px solid #130600;
  outline-offset: 2px;
}

/* ——— Custom checkbox ——— */
.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  position: relative;
}
.custom-checkbox__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.custom-checkbox__ui {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 6px;
  border: 2px solid #c8beb8;
  background: #fff;
  display: grid;
  place-items: center;
  transition:
    border-color var(--w-dur) var(--w-ease),
    background-color var(--w-dur) var(--w-ease),
    box-shadow var(--w-dur) var(--w-ease);
}
.custom-checkbox__check {
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0.6);
  opacity: 0;
  margin-bottom: 2px;
  transition:
    transform 0.22s var(--w-ease),
    opacity 0.22s var(--w-ease);
}
.custom-checkbox__input:checked + .custom-checkbox__ui {
  background: #ff5300;
  border-color: #ff5300;
}
.custom-checkbox__input:checked + .custom-checkbox__ui .custom-checkbox__check {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}
.custom-checkbox__input:focus-visible + .custom-checkbox__ui {
  outline: 2px solid #ff5300;
  outline-offset: 2px;
}
.custom-checkbox:hover .custom-checkbox__ui {
  border-color: #ff8a66;
}

/* ——— Custom select ——— */
.custom-select {
  position: relative;
  width: 100%;
}
.custom-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.custom-select__trigger {
  width: 100%;
  min-height: 44px;
  padding: 10px 36px 10px 14px;
  border: 1px solid #dcd4d0;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: #130600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition:
    border-color var(--w-dur) var(--w-ease),
    box-shadow var(--w-dur) var(--w-ease);
}
.custom-select__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.custom-select__trigger:hover {
  border-color: #c8beb8;
}
.custom-select__trigger:focus {
  outline: none;
  border-color: #ff5300;
  box-shadow: 0 0 0 3px rgba(255, 83, 0, 0.1);
}
.custom-select__trigger[aria-expanded="true"] .custom-select__chev {
  transform: rotate(225deg) translateY(-4px);
}
.custom-select__chev {
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -8px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #625650;
  border-bottom: 2px solid #625650;
  transform: rotate(45deg);
  transition: transform 0.22s var(--w-ease);
  pointer-events: none;
}
.custom-select__dropdown {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 6px;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid #ebe5e1;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(19, 6, 0, 0.12);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.22s var(--w-ease),
    transform 0.22s var(--w-ease),
    visibility 0s linear 0.22s;
}
.custom-select__dropdown.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}
.custom-select__dropdown::-webkit-scrollbar {
  width: 8px;
}
.custom-select__dropdown::-webkit-scrollbar-thumb {
  background: #dcd4d0;
  border-radius: 8px;
}
.custom-select__option {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  color: #130600;
  opacity: 0;
  transform: translateY(4px);
  transition:
    background var(--w-dur) var(--w-ease),
    opacity 0.2s var(--w-ease),
    transform 0.2s var(--w-ease);
}
.custom-select__dropdown.is-open .custom-select__option {
  opacity: 1;
  transform: translateY(0);
}
.custom-select__option:hover,
.custom-select__option[aria-selected="true"] {
  background: #faf5f2;
}
.custom-select__option:focus {
  outline: none;
  background: #fff0eb;
}
.custom-select__option:focus-visible {
  outline: 2px solid #ff5300;
  outline-offset: -2px;
}
.custom-select__option[aria-selected="true"] {
  font-weight: 600;
  color: #ff5300;
}
