/* ============================================================
   Language switcher — Amazon-style trigger
   Trigger shows: current flag + language code + caret.
   No box, no chrome — sits flat in the header like amazon.com.
   ============================================================ */

/* Kill the global `details` card rule (brutal.css) on this element. */
details.lang-flags {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  position: relative;
  display: inline-block;
}
details.lang-flags[open] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* ---- trigger ---- */
.lang-flags > summary {
  list-style: none !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.25rem 0.15rem !important;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 0.32rem;
  cursor: pointer;
  color: var(--ink, #111216);
  transition: color 140ms ease;
}

.lang-flags > summary::-webkit-details-marker,
.lang-flags > summary::marker { display: none; content: ""; }

/* current flag */
.lang-flags > summary .lang-cur-flag {
  display: block;
  width: 20px;
  height: 14px;
  object-fit: cover;
  border: 1px solid rgba(17, 18, 22, 0.22);
  border-radius: 1px;
  flex: 0 0 auto;
}

/* language code — the Amazon signature */
.lang-flags > summary .lang-cur-code {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

/* caret */
.lang-flags > summary .lang-caret {
  width: 8px;
  height: 5px;
  flex: 0 0 auto;
  opacity: 0.72;
  transition: transform 160ms ease, opacity 160ms ease;
}
.lang-flags[open] > summary .lang-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.lang-flags > summary:hover,
.lang-flags > summary:focus-visible,
.lang-flags[open] > summary {
  color: var(--pink, #cc2b5e);
}
.lang-flags > summary:hover .lang-caret { opacity: 1; }

.lang-flags > summary:focus-visible {
  outline: 2px solid var(--pink, #cc2b5e);
  outline-offset: 3px;
}

/* ---- dropdown panel ---- */
.lang-flags .lang-flags-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 230px;
  max-height: 60vh;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #fff;
  border: 2px solid var(--ink, #111216);
  box-shadow: 6px 6px 0 var(--ink, #111216);
}

.lang-flags .lang-flags-menu li { margin: 0; }

.lang-flags .lang-flags-menu a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.55rem;
  text-decoration: none;
  color: var(--ink, #111216);
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: 0;
  transition: background 120ms ease;
}
.lang-flags .lang-flags-menu a:hover,
.lang-flags .lang-flags-menu a:focus-visible {
  background: #f3f1ea;
  outline: none;
}
.lang-flags .lang-flags-menu a.current {
  background: var(--pink, #cc2b5e);
  color: #fff;
}
.lang-flags .lang-flags-menu a.current:hover { background: #a81f4d; }

.lang-flags .lang-flags-menu img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border: 1px solid rgba(17, 18, 22, 0.18);
  flex: 0 0 auto;
}

.lang-flags .lang-flags-menu .lf-name {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-flags .lang-flags-menu .lf-code {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.55;
  flex: 0 0 auto;
}
.lang-flags .lang-flags-menu a.current .lf-code { opacity: 0.8; }

.lang-flags .lf-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 14px;
  font-size: 0.55rem;
  font-weight: 800;
  background: #eee;
  border: 1px solid rgba(17, 18, 22, 0.18);
}
