/**
 * QSuli Currency & Language Switcher
 * Toggle w headerze + offcanvas + [qsuli_location_lang_switcher]
 */

/* Toggle – reset i base */
.qsuli-lang-currency-toggle,
.qsuli-lang-currency-toggle *,
.qsuli-lang-currency-toggle *::before,
.qsuli-lang-currency-toggle *::after {
  text-decoration: none !important;
}

.qsuli-lang-currency-toggle {
  all: unset;
  display: inline-block;
  cursor: pointer;
  line-height: 1;
}

.qsuli-lang-currency-fraction {
  display: flex;
  flex-direction: column;
  color: #926851;
  align-items: center;
  justify-content: center;
}

.qsuli-lang-currency-fraction .top,
.qsuli-lang-currency-fraction .bottom {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  padding: 0;
  line-height: 1;
}

/* Mobile: ukryj w headerze, pokaż w off-canvas */
@media (max-width: 1024px) {
  .wp-block-kadence-header .qsuli-lang-currency-header,
  .kadence-header-row-container .qsuli-lang-currency-header {
    display: none !important;
  }
  .kb-off-canvas-inner .qsuli-lang-currency-header {
    display: inline-block !important;
  }
}

/* Off-canvas: przycisk z flagą – przyklejony na dole */
.kb-off-canvas-inner-wrap .kb-off-canvas-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.kb-off-canvas-inner .qsuli-lang-currency-offcanvas-wrap {
  margin-top: auto;
  padding: 1rem 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  order: 999;
}

.kb-off-canvas-inner .qsuli-lang-currency-offcanvas {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 14px 16px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  color: #333;
  text-align: left;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  box-sizing: border-box;
}

.kb-off-canvas-inner .qsuli-lang-currency-offcanvas:hover,
.kb-off-canvas-inner .qsuli-lang-currency-offcanvas:focus-visible {
  background: #eee;
  border-color: #ccc;
}

.kb-off-canvas-inner .qsuli-lang-currency-offcanvas-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kb-off-canvas-inner .qsuli-lang-currency-flag {
  width: 28px;
  height: 21px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.kb-off-canvas-inner .qsuli-lang-currency-offcanvas-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.35;
  gap: 2px;
}

.kb-off-canvas-inner .qsuli-lang-currency-offcanvas-top {
  font-size: 15px;
  font-weight: 600;
  color: inherit;
}

.kb-off-canvas-inner .qsuli-lang-currency-offcanvas-bottom {
  font-size: 13px;
  opacity: 0.85;
}

/* Ujednolicony przełącznik [qsuli_location_lang_switcher] */
.qsuli-location-lang-switcher {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.qsuli-lls-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.qsuli-lls-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #666;
  margin: 0;
}

.qsuli-lls-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.qsuli-lls-dropdown {
  position: relative;
}

.qsuli-lls-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  padding: 12px 40px 12px 14px;
  font-size: 1rem;
  font-weight: 500;
  color: #111;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
  position: relative;
}

.qsuli-lls-trigger:disabled {
  opacity: 0.65;
  cursor: default;
  background: #f7f7f7;
}

.qsuli-lls-trigger:focus {
  outline: none;
  border-color: #926851;
  box-shadow: 0 0 0 2px rgba(146, 104, 81, 0.15);
}

.qsuli-lls-flag {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.qsuli-lls-trigger-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qsuli-lls-chevron {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-right: 2px solid #333;
  border-bottom: 2px solid #333;
  transform: rotate(45deg);
  pointer-events: none;
}

.qsuli-lls-list {
  position: absolute;
  z-index: 100;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.qsuli-lls-list [role="option"] {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95rem;
}

.qsuli-lls-list [role="option"]:hover,
.qsuli-lls-list [role="option"][aria-selected="true"] {
  background: #f0f4ff;
}

.qsuli-lls-dropdown--single .qsuli-lls-chevron {
  opacity: 0.35;
}

.qsuli-lls-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 16px 24px;
  border: none;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.qsuli-lls-submit:hover,
.qsuli-lls-submit:focus-visible {
  background: #333;
}

.qsuli-lls-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
