/**
 * Drilldown Menu Styles
 * Mobile-first sliding navigation with offcanvas layout
 */

/* Main container - hidden by default */
.dd-menu,
.menu-mobile {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
  z-index: 9999999999;
  pointer-events: none;
}

/* Open state */
.dd-menu--open,
.menu-mobile.dd-menu--open {
  visibility: visible !important;
  pointer-events: auto !important;
  display: block !important; /* Force display */
}

/* Overlay - darkens background with glass effect */
.dd-menu__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dd-menu--open .dd-menu__overlay {
  opacity: 1;
}

/* Sidebar - slides from left with liquid glass dark theme */
.dd-menu__sidebar,
.dd-menu .container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  max-height: 100%;

  /* Liquid Glass Dark Theme */
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.dd-menu--open .dd-menu__sidebar,
.dd-menu--open .container {
  transform: translateX(0) !important;
}

/* Header section - liquid glass dark */
.dd-menu__header,
.menu-mobile__header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  margin-bottom: 0 !important;
  background: rgba(20, 20, 25, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dd-menu__logo img {
  height: 40px;
  width: auto;
}
.dd-menu__logo .logo-dark {
  display: none !important;
}

.dd-menu__close {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
}

.dd-menu__close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.dd-menu__close img,
.dd-menu__close svg {
  width: 24px;
  height: 24px;
}

/* Panel wrapper - full height, takes all available space between header and footer */
.dd-menu__panel-wrapper {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  background: transparent;
  width: 100%;
}

/* Hide these elements from sidebar - they will be shown in contacts panel */
.dd-menu__sidebar > .menu-mobile__authorisation,
.dd-menu__sidebar > .menu-mobile__contacts-item,
.dd-menu__sidebar > .dd-menu__footer,
.dd-menu__sidebar > .menu-mobile__footer {
  display: none !important;
}

/* Show these elements only inside info panel - unified spacing */
.dd-menu__panel--contacts .menu-mobile__authorisation,
.dd-menu__panel--contacts .menu-mobile__contacts-item {
  display: block;
  flex-shrink: 0;
  padding: 20px;
  margin: 0;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  box-sizing: border-box;
}

.dd-menu__panel--contacts .dd-menu__footer,
.dd-menu__panel--contacts .menu-mobile__footer {
  display: block;
  flex-shrink: 0;
  padding: 20px;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 20, 25, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
}

/* Info panel specific styles */
.dd-menu__panel--contacts {
  display: flex;
  flex-direction: column;
}

.dd-menu__panel--contacts .menu-mobile__authorisation {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: stretch;
}

.dd-menu__panel--contacts .menu-mobile__authorisation .theme-btn {
  flex: 1;
  margin: 0;
}

/* Unified spacing for support list */
.dd-menu__panel--contacts .menu-mobile__support {
  padding: 0;
  margin: 0;
}

.dd-menu__panel--contacts .menu-mobile__support .support-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dd-menu__panel--contacts .menu-mobile__support .support-list__item {
  margin: 0;
  padding: 0;
}

.dd-menu__panel--contacts .menu-mobile__support .support-list__item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dd-menu__panel--contacts
  .menu-mobile__support
  .support-list__item:last-child
  a {
  border-bottom: none;
}

.dd-menu__panel--contacts .menu-mobile__support .support-list__item a:hover {
  color: #ffffff;
}

.dd-menu__panel--contacts .menu-mobile__support .support-list__item a img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Social icons spacing */
.dd-menu__panel--contacts .menu-mobile__social {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  align-items: center;
  margin-top: 15px;
  padding: 0;
}

.dd-menu__panel--contacts .menu-mobile__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
}

/* Compatibility with existing menu-mobile classes - dark glass */
.menu-mobile__authorisation,
.menu-mobile__contacts-item {
  padding: 10px 20px;
  margin: 0;
  background: transparent;
  flex-shrink: 0;
}

.menu-mobile__footer {
  background: rgba(20, 20, 25, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* Individual panel - dark glass, full height of wrapper */
.dd-menu__panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease-out;
  box-sizing: border-box;
}

/* Panel states for animations */
.dd-menu__panel--active {
  transform: translateX(0);
}

.dd-menu__panel--enter-right {
  transform: translateX(100%);
}

.dd-menu__panel--enter-left {
  transform: translateX(-100%);
}

.dd-menu__panel--exit-left {
  transform: translateX(-100%);
}

.dd-menu__panel--exit-right {
  transform: translateX(100%);
}

/* Panel header - dark glass, fixed at top of panel */
.dd-menu__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 20, 25, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
  min-height: 60px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 999999999;
}

.dd-menu__back {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  border-radius: 100px;
  transition: all 0.2s ease;
  background-color: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  min-height: 42px;
  min-width: 42px;
}

.dd-menu__back svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.dd-menu__title {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  flex: 1;
}

.dd-menu__title--right {
  display: flex;
  align-items: center;
  gap: 8px;
  background: 0 0;
  border: none;
  padding: 8px 12px;
  text-align: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  border-radius: 100px;
  transition: all 0.2s ease;
  background-color: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  justify-content: center;
  line-height: normal;
  text-wrap-style: balance;
  min-height: 42px;
}

/* Header auth buttons (left side) */
.dd-menu__header-auth {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.dd-menu__auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.9);
}

.dd-menu__auth-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.dd-menu__auth-btn:active {
  transform: translateY(0);
}

.dd-menu__auth-btn svg {
  width: 18px;
  height: 18px;
}

/* Header language selector (right side) */
.dd-menu__header-lang {
  position: relative;
  flex-shrink: 0;
}

.dd-menu__lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dd-menu__lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.dd-menu__lang-btn:active {
  transform: translateY(0);
}

.dd-menu__lang-btn img {
  width: 30px;
  height: 30px;
  border-radius: 2px;
  object-fit: cover;
}

/* Language dropdown */
.dd-menu__lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(20, 20, 25, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
  overflow: hidden;
}

.dd-menu__lang-dropdown--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dd-menu__lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dd-menu__lang-item:last-child {
  border-bottom: none;
}

.dd-menu__lang-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.dd-menu__lang-item--current {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.dd-menu__lang-item img {
  width: 25px;
  height: 25px;
  border-radius: 100px;
  object-fit: cover;
  flex-shrink: 0;
}

.dd-menu__lang-item span {
  font-size: 14px;
  font-weight: 400;
}

/* Menu list - scrollable content, takes remaining space */
.dd-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  max-height: 100%;
}

.dd-menu__item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dd-menu__item:last-child {
  border-bottom: none;
}

/* Menu links and buttons - dark glass */
.dd-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 400;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.dd-menu__icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 20px;
  line-height: 1;
  filter: brightness(11);
}

.dd-menu__icon.dashicons {
  font-family: dashicons;
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.dd-menu__icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.dd-menu__link > span:not(.dd-menu__icon) {
  flex: 1;
  text-align: left;
}

.dd-menu__link:hover,
.dd-menu__link:focus {
  /* background-color: rgba(255, 255, 255, 0.1); */
  color: #ffffff;
  outline: none;
}

.dd-menu__item--has-children .dd-menu__link:hover {
  background-color: transparent;
}

.dd-menu__link:active {
  background-color: rgba(255, 255, 255, 0.15);
}

.dd-menu__item--has-children .dd-menu__link {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: transparent;
  border: none;
}

.dd-menu__icon-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.dd-menu__icon-btn:hover {
  opacity: 0.8;
}

.dd-menu__text-link {
  flex: 1;
  text-decoration: none;
  color: inherit;
  padding: 0;
  display: flex;
  align-items: center;
  font-weight: 500;
  line-height: normal;
  text-wrap-style: balance;
}

.dd-menu__text-link:hover {
  text-decoration: underline;
}

.dd-menu__arrow-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  width: 35px;
  height: 35px;
}

.dd-menu__arrow-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
}

.dd-menu__arrow-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Footer section - dark glass */
.dd-menu__footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 20, 25, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}

/* Body lock when menu is open */
body.dd-menu-active {
  overflow: hidden;
}

/* Tablet and larger screens */
@media (min-width: 768px) {
  .dd-menu__sidebar {
    width: 400px;
  }
}

/* Desktop - hide or adjust as needed */
@media (min-width: 1025px) {
  /* Desktop styles can be added here if needed */
}

/* Accessibility improvements - dark theme */
.dd-menu__link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: -2px;
  background-color: rgba(255, 255, 255, 0.15);
}

.dd-menu__back:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Smooth scrolling for panels */
.dd-menu__panel {
  scroll-behavior: smooth;
}

/* Loading state (optional) */
.dd-menu--loading .dd-menu__panel-wrapper {
  opacity: 0.5;
  pointer-events: none;
}

/* Additional dark glass styles for support list and social icons */
.menu-mobile__support,
.menu-mobile__support ul {
  background: transparent;
}

.menu-mobile__support .support-list__item a {
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.2s ease;
}

.menu-mobile__support .support-list__item a:hover {
  color: #ffffff;
}

.menu-mobile__social a {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.menu-mobile__social a:hover {
  opacity: 1;
}

/* Theme buttons in dark menu */
.menu-mobile__authorisation .theme-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.menu-mobile__authorisation .theme-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Language selector in dark menu */
.menu-mobile__contacts-item .select-mobile {
  color: rgba(255, 255, 255, 0.9);
}

.menu-mobile__contacts-item .lang-list-mobile {
  background: rgba(20, 20, 25, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-mobile__contacts-item .lang-list__item a {
  color: rgba(255, 255, 255, 0.9);
}

.menu-mobile__contacts-item .lang-list__item a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Animation timing adjustments for better UX */
@media (prefers-reduced-motion: reduce) {
  .dd-menu__sidebar,
  .dd-menu__overlay,
  .dd-menu__panel,
  .dd-menu__link,
  .dd-menu__back {
    transition-duration: 0.01ms !important;
  }
}
