/* Additional language navigation and typography. Base site.css stays unchanged. */

.language-more {
  position: relative;
  flex: 0 0 44px;
}

.language-more > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 5px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 750;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.language-more > summary::-webkit-details-marker {
  display: none;
}

.language-more > summary:hover,
.language-more[open] > summary {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.language-more > .language-current {
  border-color: var(--accent-border);
  background: var(--accent-surface);
}

.language-options {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: min(312px, calc(100vw - 40px));
  max-height: min(65vh, 440px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(23, 50, 77, 0.16);
}

.languages .language-options a {
  justify-content: flex-start;
  min-width: 0;
  padding-inline: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: start;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .languages {
    gap: 2px;
  }

  .language-options {
    width: min(274px, calc(100vw - 32px));
    max-height: max(60px, min(65vh, calc(100svh - 260px - env(safe-area-inset-bottom, 0px))));
  }
}

/* Native shaping and reading order only affect newly added scripts. */
html:lang(ar) h1,
html:lang(ar) h2,
html:lang(ar) h3,
html:lang(ar) .eyebrow,
html:lang(ar) .info-label,
html:lang(ar) .photo-address small,
html:lang(ar) .price-table thead th,
html:lang(zh) h1,
html:lang(zh) h2,
html:lang(zh) h3,
html:lang(ja) h1,
html:lang(ja) h2,
html:lang(ja) h3,
html:lang(ko) h1,
html:lang(ko) h2,
html:lang(ko) h3 {
  letter-spacing: normal;
}

html[dir="rtl"] .price-table,
html[dir="rtl"] .hours-table th {
  text-align: right;
}

html[dir="rtl"] .price-table thead th:last-child,
html[dir="rtl"] .price-table tbody td,
html[dir="rtl"] .hours-table td {
  text-align: left;
}

html[dir="rtl"] .price-table tbody th {
  padding-right: 0;
  padding-left: 30px;
}

html[dir="rtl"] .price-table thead th {
  padding-right: 0;
  padding-left: 20px;
}

html[dir="rtl"] .price-table thead th:last-child {
  padding-left: 0;
}

html[dir="rtl"] .hours-table th {
  padding-right: 0;
  padding-left: 18px;
}

html[dir="rtl"] .brand-name,
html[dir="rtl"] .topbar strong,
html[dir="rtl"] .photo-station strong,
html[dir="rtl"] .contact-id strong,
html[dir="rtl"] .quick-info-item:first-child strong,
html[dir="rtl"] .price-table td strong,
html[dir="rtl"] .hours-table td,
html[dir="rtl"] .contact-address > strong,
html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href^="mailto:"] {
  unicode-bidi: isolate;
}

@media (min-width: 761px) {
  html[dir="rtl"] .quick-info-item {
    border-left: 0;
    border-right: 1px solid var(--border);
  }

  html[dir="rtl"] .quick-info-item:first-child {
    border-right: 0;
    padding-right: 0;
    padding-left: 28px;
  }

  html[dir="rtl"] .quick-info-item:last-child {
    padding-left: 0;
    padding-right: 28px;
  }
}

@media (max-width: 520px) {
  html[dir="rtl"] .price-table tbody th {
    padding-left: 14px;
  }
}
