/* ==========================================================================
   SDS component globals — the descendant/state selectors that can't be
   expressed as UnoCSS utility classes in markup (drawer transitions,
   hamburger morph, mobile menu drawer, language pill toggle).
   Utility/layout classes and the button shortcuts come from UnoCSS (sds.css).
   Ported from spoko-design-system Astro <style is:global> blocks; Tailwind
   theme() colors resolved to tokens.css custom properties.
   ========================================================================== */

/* --- Hamburger icon (three bars → X) ------------------------------------ */
.sds-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
  pointer-events: none;
}
.sds-hamburger > span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition:
    transform 0.25s ease,
    opacity 0.2s ease;
}
body.drawer-open .sds-hamburger > span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.drawer-open .sds-hamburger > span:nth-child(2) {
  opacity: 0;
}
body.drawer-open .sds-hamburger > span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Language toggle — look="pill" (catalog.polo.blue) ------------------ */
.sds-toggle-segmented[data-look='pill'] {
  display: inline-flex;
  padding: 3px;
  background: #fff;
  border: 1px solid rgba(0, 15, 40, 0.14);
  border-radius: 999px;
}
.sds-toggle-segmented[data-look='pill'] .sds-toggle-seg-btn {
  min-width: 38px;
  height: 30px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--color-blue-darkest);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-indent: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}
.sds-toggle-segmented[data-look='pill'] .sds-toggle-seg-btn:hover:not(.is-active) {
  background: rgba(0, 15, 40, 0.04);
}
.sds-toggle-segmented[data-look='pill'] .sds-toggle-seg-btn.is-active {
  background: var(--color-blue-darkest);
  color: #fff;
}

/* --- Drawer ------------------------------------------------------------- */
.sds-drawer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sds-drawer.open {
  opacity: 1;
  pointer-events: auto;
}
.sds-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  cursor: pointer;
  z-index: 1;
}
.sds-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 18rem;
  height: 100%;
  background: white;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 10;
}
.sds-drawer-panel:focus {
  outline: none;
}
.sds-drawer.open .sds-drawer-panel {
  transform: translateX(0);
}
.sds-drawer[data-position='right'] .sds-drawer-panel {
  left: auto;
  right: 0;
  transform: translateX(100%);
}
.sds-drawer[data-position='right'].open .sds-drawer-panel {
  transform: translateX(0);
}
body.drawer-open {
  overflow: hidden;
}

/* --- MenuDrawer (mobile nav contents) ----------------------------------- */
.sds-drawer-menu .sds-drawer-panel {
  width: 380px;
  max-width: 100vw;
  padding: 24px 32px 28px;
  background: #fff;
}
@media (max-width: 480px) {
  .sds-drawer-menu .sds-drawer-panel {
    padding: 20px 20px 24px;
  }
}
.sds-menu {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  color: var(--color-slate-darkest);
}
.sds-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.sds-menu-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.sds-menu-brand-text {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--color-blue-medium);
}
.sds-menu-brand-text span {
  color: var(--color-accent-light);
}
.sds-menu-close {
  background: transparent;
  border: 1px solid rgba(10, 22, 40, 0.1);
  color: inherit;
  cursor: pointer;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    transform 0.3s ease;
}
.sds-menu-close:hover {
  background: rgba(10, 22, 40, 0.05);
  transform: rotate(90deg);
}
.sds-menu-close-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
}
.sds-menu-close-icon > span {
  position: absolute;
  top: calc(50% - 1px);
  left: 0;
  display: block;
  width: 14px;
  height: 1.8px;
  background: currentColor;
  border-radius: 2px;
}
.sds-menu-close-icon > span:first-child {
  transform: rotate(45deg);
}
.sds-menu-close-icon > span:last-child {
  transform: rotate(-45deg);
}
.sds-menu-primary {
  display: flex;
  flex-direction: column;
  margin-bottom: 32px;
}
.sds-menu-primary-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(10, 22, 40, 0.08);
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
.sds-menu-primary-link:hover,
.sds-menu-primary-link.active {
  color: var(--color-blue-medium);
}
.sds-menu-primary-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.sds-menu-primary-arrow {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.55;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.sds-menu-primary-link:hover .sds-menu-primary-arrow {
  opacity: 1;
  transform: translateX(4px);
}
.sds-menu-spacer {
  flex: 1;
  min-height: 16px;
}
.sds-menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(10, 22, 40, 0.1);
}
.sds-menu-lang {
  display: inline-flex;
  border: 1px solid rgba(10, 22, 40, 0.15);
  border-radius: 999px;
  padding: 2px;
}
.sds-menu-lang-btn {
  background: transparent;
  color: inherit;
  border: none;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.sds-menu-lang-btn:hover:not(.is-active) {
  color: var(--color-blue-medium);
}
.sds-menu-lang-btn.is-active {
  background: var(--color-blue-darkest);
  color: #fff;
}
.sds-menu .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
