/* ==========================================================================
   UncleTrips — Shared UI primitives (added in the overnight run)
   Page heads · panels · notices · forms · steps · status badges · service tags ·
   cross-sell cards · mobile selection bar · tabs · empty / skeleton / error states.
   Builds on tokens.css · base.css · components.css. Logical properties only (RTL-ready).
   ========================================================================== */

/* The hidden attribute always wins over component display rules */
[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------- Page head */
.page-head {
  padding-block: var(--sp-2) var(--sp-6);
}

.page-title {
  font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2.125rem);
  font-weight: var(--fw-extrabold);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.page-lead {
  max-width: 62ch;
  margin-block-start: var(--sp-2);
  font-size: var(--fs-16);
  color: var(--c-grey-600);
}

.eyebrow-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block-end: var(--sp-2);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-orange-600);
}

.eyebrow-text .icon {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------- Two-column page */
.layout-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--sp-8);
  align-items: start;
}

.layout-aside > aside {
  position: sticky;
  inset-block-start: calc(var(--header-h) + var(--sp-4));
}

@media (max-width: 1023px) {
  .layout-aside {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-6);
  }

  .layout-aside > aside {
    position: static;
  }
}

/* ------------------------------------------------------------------ Panel */
.panel {
  padding: var(--sp-5);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}

.panel--raised {
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
}

.panel--muted {
  background: var(--c-grey-50);
}

.panel + .panel {
  margin-block-start: var(--sp-4);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-block-end: var(--sp-4);
}

.panel-title {
  font-size: var(--fs-18);
  font-weight: var(--fw-bold);
  line-height: 1.3;
}

.panel-sub {
  font-size: var(--fs-14);
  color: var(--c-text-muted);
}

@media (max-width: 767px) {
  .panel {
    padding: var(--sp-4);
  }
}

/* ----------------------------------------------------------------- Notice */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--c-navy-100);
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--c-navy-800);
}

.notice .icon {
  width: 20px;
  height: 20px;
  margin-block-start: 1px;
}

.notice strong {
  font-weight: var(--fw-bold);
}

.notice--warm {
  background: var(--c-cream-100);
  color: var(--c-grey-600);
}

.notice--warm .icon {
  color: var(--c-orange-600);
}

.notice--positive {
  background: #e7f5ee;
  color: #1e5f41;
}

.notice--error {
  background: #fdecea;
  color: #8f2a1a;
}

/* --------------------------------------------------------- Service tags */
.service-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding-inline: 0.55rem;
  border-radius: var(--r-pill);
  background: var(--c-grey-100);
  color: var(--c-navy-800);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

.service-tag .icon {
  width: 14px;
  height: 14px;
}

.service-tag--tour { background: var(--c-orange-100); color: var(--c-orange-600); }
.service-tag--hotel { background: var(--c-navy-100); color: var(--c-navy-800); }
.service-tag--transfer { background: #e8f1fb; color: var(--c-blue-600); }
.service-tag--chauffeur { background: #eef0f4; color: var(--c-grey-600); }

/* ----------------------------------------------------------- Status badge */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding-inline: 0.6rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status--confirmed { background: #e7f5ee; color: #1e7a50; }
.status--pending { background: var(--c-orange-100); color: #b04812; }
.status--cancelled { background: var(--c-grey-100); color: var(--c-grey-600); }
.status--info { background: var(--c-navy-100); color: var(--c-navy-800); }

/* ------------------------------------------------------------------ Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.form-grid .field--full {
  grid-column: 1 / -1;
}

@media (max-width: 599px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  color: var(--c-navy-900);
}

.field-label .optional {
  font-weight: var(--fw-regular);
  color: var(--c-text-muted);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--c-grey-300);
  border-radius: var(--r-md);
  background: var(--c-white);
  font: inherit;
  font-size: var(--fs-15);
  color: var(--c-navy-900);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.select {
  appearance: none;
  padding-inline-end: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23071937' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.5 9.5 5.5 5.5 5.5-5.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px;
  background-position: right 0.8rem center;
  cursor: pointer;
}

[dir="rtl"] .select {
  background-position: left 0.8rem center;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--c-text-muted);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--c-grey-500);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--c-navy-600);
  box-shadow: 0 0 0 3px rgba(29, 58, 99, 0.12);
}

.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea {
  border-color: #b4351f;
}

.field-hint {
  font-size: var(--fs-13);
  color: var(--c-text-muted);
}

.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  color: #b4351f;
}

.field-error .icon {
  width: 16px;
  height: 16px;
}

.field-error[hidden] {
  display: none;
}

/* input with a leading control (e.g. phone country code) */
.input-group {
  display: flex;
  gap: var(--sp-2);
}

.input-group > .select {
  flex: 0 0 auto;
  width: auto;
  min-width: 104px;
}

.input-group > .input {
  flex: 1;
  min-width: 0;
}

/* input with an action inside (password show/hide) */
.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-inline-end: 3rem;
}

.input-action {
  position: absolute;
  inset-block: 2px;
  inset-inline-end: 2px;
  display: grid;
  place-items: center;
  width: 44px;
  border-radius: var(--r-md);
  color: var(--c-grey-600);
}

.input-action:hover {
  color: var(--c-navy-900);
}

/* Selectable card (radio / checkbox) */
.choice-list {
  display: grid;
  gap: var(--sp-3);
}

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1.5px solid var(--c-grey-200);
  border-radius: var(--r-lg);
  background: var(--c-white);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.choice:hover {
  border-color: var(--c-grey-300);
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.choice-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  margin-block-start: 1px;
  border: 1.5px solid var(--c-grey-300);
  border-radius: 50%;
  background: var(--c-white);
}

.choice input[type="checkbox"] + .choice-mark {
  border-radius: 5px;
}

.choice input:checked + .choice-mark {
  border-color: var(--c-orange-500);
  background: var(--c-orange-500);
}

.choice input[type="radio"]:checked + .choice-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-white);
}

.choice input[type="checkbox"]:checked + .choice-mark::after {
  content: "";
  width: 10px;
  height: 5px;
  border: solid var(--c-white);
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}

.choice:has(input:checked) {
  border-color: var(--c-orange-500);
  background: #fffaf6;
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--c-orange-500);
  outline-offset: 2px;
}

.choice:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.choice-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.choice-title {
  font-size: var(--fs-15);
  font-weight: var(--fw-bold);
  color: var(--c-navy-900);
}

.choice-text {
  font-size: var(--fs-13);
  color: var(--c-text-muted);
}

.choice-aside {
  flex: none;
  font-size: var(--fs-14);
  font-weight: var(--fw-bold);
  text-align: end;
}

/* Inline checkbox (terms, preferences) */
.checkline {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--c-grey-600);
  cursor: pointer;
}

.checkline input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--c-orange-500);
  cursor: pointer;
}

.checkline a {
  color: var(--c-blue-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Toggle switch */
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--tap);
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-track {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--c-grey-300);
  transition: background-color var(--dur) var(--ease);
}

.switch-track::after {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-white);
  box-shadow: var(--sh-xs);
  transition: transform var(--dur) var(--ease);
}

.switch input:checked + .switch-track {
  background: var(--c-navy-800);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

[dir="rtl"] .switch input:checked + .switch-track::after {
  transform: translateX(-18px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--c-orange-500);
  outline-offset: 2px;
}

.switch-text {
  display: flex;
  flex-direction: column;
  font-size: var(--fs-15);
  font-weight: var(--fw-semibold);
}

.switch-text small {
  font-size: var(--fs-13);
  font-weight: var(--fw-regular);
  color: var(--c-text-muted);
}

/* ----------------------------------------------------- Progress steps */
.steps {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
}

.steps li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  white-space: nowrap;
}

.steps li:not(:last-child)::after {
  content: "";
  width: clamp(16px, 4vw, 48px);
  height: 2px;
  border-radius: 2px;
  background: var(--c-grey-200);
}

.step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--c-grey-300);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
}

.steps .is-done {
  color: var(--c-navy-900);
}

.steps .is-done .step-num {
  border-color: var(--c-navy-800);
  background: var(--c-navy-800);
  color: var(--c-white);
}

.steps .is-done:not(:last-child)::after {
  background: var(--c-navy-800);
}

.steps [aria-current="step"] {
  color: var(--c-navy-900);
}

.steps [aria-current="step"] .step-num {
  border-color: var(--c-orange-500);
  background: var(--c-orange-500);
  color: var(--c-white);
}

@media (max-width: 599px) {
  .steps .step-label {
    display: none;
  }

  .steps [aria-current="step"] .step-label {
    display: inline;
  }
}

/* --------------------------------------------------------- Segmented tabs */
.tabs {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  scrollbar-width: none;
  border-block-end: 1px solid var(--c-border);
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding-inline: var(--sp-3);
  font-size: var(--fs-15);
  font-weight: var(--fw-semibold);
  color: var(--c-grey-600);
  white-space: nowrap;
}

.tab::after {
  content: "";
  position: absolute;
  inset-inline: var(--sp-3);
  inset-block-end: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-orange-500);
  transform: scaleX(0);
  transition: transform var(--dur) var(--ease);
}

.tab:hover {
  color: var(--c-navy-900);
}

.tab[aria-selected="true"],
.tab[aria-current="page"] {
  color: var(--c-navy-900);
}

.tab[aria-selected="true"]::after,
.tab[aria-current="page"]::after {
  transform: scaleX(1);
}

.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: var(--r-pill);
  background: var(--c-grey-100);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  color: var(--c-navy-800);
}

/* --------------------------------------------------------- Key-value rows */
.kv {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
  font-size: var(--fs-14);
}

.kv > div {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
}

.kv dt {
  color: var(--c-text-muted);
}

.kv dd {
  margin: 0;
  font-weight: var(--fw-semibold);
  color: var(--c-navy-900);
  text-align: end;
}

/* -------------------------------------------------------- Cross-sell cards */
.xsell-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
}

.xsell-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  height: 100%;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-white);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.xsell-card:hover {
  border-color: var(--c-grey-300);
  box-shadow: var(--sh-sm);
}

.xsell-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-navy-100);
  color: var(--c-navy-800);
}

.xsell-icon .icon {
  width: 24px;
  height: 24px;
}

.xsell-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.xsell-kind {
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.xsell-body strong {
  font-size: var(--fs-15);
  line-height: 1.35;
}

.xsell-price {
  margin-block-start: 4px;
  font-size: var(--fs-13);
  color: var(--c-grey-600);
}

.xsell-price [data-price] {
  font-weight: var(--fw-bold);
  color: var(--c-navy-900);
}

.xsell-inline {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-block-start: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: var(--fs-14);
  color: var(--c-grey-600);
}

.xsell-inline > .icon:first-child {
  width: 22px;
  height: 22px;
  color: var(--c-blue-600);
}

.xsell-inline span {
  flex: 1;
}

.xsell-inline strong {
  color: var(--c-navy-900);
}

.xsell-inline:hover {
  background: var(--c-grey-50);
}

@media (max-width: 1023px) {
  .xsell-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-3);
  }
}

/* ------------------------------------------- Mobile selection bar */
.selection-bar {
  display: none;
}

@media (max-width: 1023px) {
  .selection-bar:not([hidden]) {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: calc(var(--z-bottom-nav) - 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--gutter) calc(var(--sp-3) + env(safe-area-inset-bottom));
    background: var(--c-white);
    border-block-start: 1px solid var(--c-border);
    box-shadow: 0 -6px 18px rgba(7, 25, 55, 0.1);
  }

  .selection-bar-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
  }

  .selection-bar-text strong {
    font-size: var(--fs-18);
    font-weight: var(--fw-extrabold);
  }

  .selection-bar-text span {
    overflow: hidden;
    font-size: var(--fs-12);
    color: var(--c-text-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

@media (max-width: 767px) {
  .selection-bar:not([hidden]) {
    inset-block-end: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    padding-block-end: var(--sp-3);
  }
}

/* --------------------------------------------------------- Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
  background: var(--c-grey-50);
  border: 1px dashed var(--c-grey-300);
  border-radius: var(--r-lg);
  color: var(--c-grey-600);
}

.empty-state[hidden] {
  display: none;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--c-white);
  color: var(--c-navy-600);
  box-shadow: var(--sh-xs);
}

.empty-icon .icon {
  width: 30px;
  height: 30px;
  stroke-width: 1.6;
}

.empty-icon img {
  width: 64px;
  border-radius: 50%;
}

.empty-title {
  font-size: var(--fs-18);
  font-weight: var(--fw-bold);
  color: var(--c-navy-900);
}

.empty-state p:not(.empty-title) {
  max-width: 46ch;
  font-size: var(--fs-15);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  margin-block-start: var(--sp-2);
}

/* --------------------------------------------------------- Skeleton */
.skeleton {
  display: block;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--c-grey-100) 0%, #f7f8fa 45%, var(--c-grey-100) 90%);
  background-size: 300% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
}

@keyframes skeleton {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.skeleton--text { height: 0.9em; }
.skeleton--title { height: 1.3em; width: 70%; }
.skeleton--media { aspect-ratio: 16 / 10; border-radius: var(--r-md); }
.skeleton--pill { height: 22px; width: 90px; border-radius: var(--r-pill); }

/* ----------------------------------------------------------- Link list */
.link-list {
  display: grid;
  gap: 0;
}

.link-list a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 52px;
  border-block-end: 1px solid var(--c-border);
  font-weight: var(--fw-semibold);
}

.link-list a > .icon:first-child {
  color: var(--c-navy-600);
}

.link-list a > span {
  flex: 1;
}

.link-list a:hover {
  color: var(--c-navy-600);
}

/* ------------------------------------------------------ Small utilities */
.muted {
  color: var(--c-text-muted);
}

.stack-sm > * + * {
  margin-block-start: var(--sp-2);
}

.stack > * + * {
  margin-block-start: var(--sp-4);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.text-link {
  color: var(--c-blue-600);
  font-weight: var(--fw-semibold);
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.divider {
  height: 1px;
  margin-block: var(--sp-4);
  border: 0;
  background: var(--c-border);
}

/* Toasts clear the mobile selection bar when it is showing */
@media (max-width: 1023px) {
  body:has(.selection-bar:not([hidden])) .toast {
    inset-block-end: calc(var(--sp-6) + 72px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 767px) {
  body:has(.selection-bar:not([hidden])) .toast {
    inset-block-end: calc(var(--bottom-nav-h) + 84px + env(safe-area-inset-bottom));
  }
}

/* ------------------------------------------------ Summary total · trust list */
/* Same look as the tour booking card (detail.css) for pages that don't load it */
.sum-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block-start: var(--sp-3);
  border-block-start: 1px solid var(--c-border);
  font-size: var(--fs-15);
  font-weight: var(--fw-bold);
}

.sum-total small {
  display: block;
  font-size: var(--fs-12);
  font-weight: var(--fw-regular);
  color: var(--c-text-muted);
}

.sum-total strong {
  font-size: 1.5rem;
  font-weight: var(--fw-extrabold);
  white-space: nowrap;
}

.trust-list {
  display: grid;
  gap: var(--sp-3);
}

.trust-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-13);
  line-height: 1.4;
  color: var(--c-grey-600);
}

.trust-list .icon {
  width: 20px;
  height: 20px;
  color: var(--c-navy-600);
}

.trust-list strong {
  display: block;
  color: var(--c-navy-900);
}

.fine-print {
  font-size: var(--fs-12);
  color: var(--c-text-muted);
  text-align: center;
}

.tab-count[hidden] {
  display: none;
}

/* Selects forced to LTR (e.g. phone codes) keep their chevron on the right */
[dir="rtl"] .select[dir="ltr"] {
  background-position: right 0.8rem center;
}

/* Focused header: brand + back link only */
.site-header--focus .header-inner {
  justify-content: space-between;
}

.site-header--focus .header-tools .tool-btn {
  font-weight: var(--fw-semibold);
}

@media (max-width: 767px) {
  .site-header--focus .brand-tagline {
    display: none;
  }

  .site-header--focus .header-tools .tool-btn {
    padding-inline: 0.4rem;
    font-size: var(--fs-13);
  }
}

/* Full-width buttons may wrap on very narrow screens instead of widening the page */
.btn--block {
  white-space: normal;
}

.layout-aside > *,
.checkout-layout > * {
  min-width: 0;
}

@media (max-width: 399px) {
  .site-header--focus .header-tools .tool-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Final sweep: icons inside text links stay on the same line (base.css makes svg block) */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.text-link .icon {
  width: 1em;
  height: 1em;
}

/* Headings focused by script after a state change (for screen readers) don't show a ring */
h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus,
h3[tabindex="-1"]:focus {
  outline: none;
}
