/* 3.2: comfortable spacing, readable type and touch controls on narrow screens. */
.xh-mode-toggle { display: none; }
@media (max-width: 760px) {
  .xh-theme { font-size: 15px; line-height: 1.7; }
  .xh-wrap { width: calc(100% - 32px); }
  .xh-main { padding-top: 22px; }
  .xh-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    gap: 12px 16px;
    padding-top: 16px;
  }
  .xh-header .xh-brand { min-width: 0; white-space: normal; font-size: 18px; line-height: 1.35; gap: 9px; }
  .xh-header .xh-brand>span { min-width: 0; overflow-wrap: anywhere; }
  .xh-header .xh-logo-icon { width: 36px; height: 36px; }
  .xh-tools { margin: 0; gap: 8px; }
  .xh-appearance { display: none; }
  .xh-mode-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--xh-line);
    border-radius: 11px;
    background: var(--xh-surface);
    color: var(--xh-orange);
    flex-shrink: 0;
  }
  .xh-mode-toggle svg { width: 20px; height: 20px; }
  .xh-mode-toggle .xh-icon-sun { display: none; }
  :root[data-xh-mode="dark"] .xh-mode-toggle .xh-icon-moon { display: none; }
  :root[data-xh-mode="dark"] .xh-mode-toggle .xh-icon-sun { display: block; }
  .xh-language { min-height: 44px; padding: 0 6px; border-radius: 11px; gap: 0; }
  .xh-language>span[aria-hidden] { display: none; }
  .xh-language select { font-size: 16px; height: 42px; max-width: 90px; padding: 0; }
  .xh-header nav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    height: auto;
    min-height: 48px;
    margin-top: 2px;
  }
  .xh-header nav a,.xh-header nav button {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 8px 2px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
  }
  .xh-header nav a.is-active:after { left: 18%; right: 18%; border-radius: 3px 3px 0 0; }
  .xh-welcome { min-height: 0; padding: 20px; border-radius: 14px; gap: 16px; }
  .xh-kicker { font-size: 12px; line-height: 1.6; letter-spacing: .3px; }
  .xh-welcome h1 { font-size: 22px; line-height: 1.5; letter-spacing: 0; margin: 8px 0 10px; }
  .xh-welcome p { font-size: 14px; line-height: 1.85; }
  .xh-guide-cta { min-height: 44px; font-size: 14px; padding: 9px 16px; }
  .xh-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
  /* The guide remains available in the banner and navigation. */
  .xh-shortcuts>*:first-child { display: none; }
  .xh-shortcuts>a,.xh-shortcuts>button { flex-direction: row; padding: 16px 12px; gap: 10px; text-align: left; min-height: 72px; }
  .xh-shortcuts strong { font-size: 14px; line-height: 1.5; font-weight: 600; }
  .xh-shortcuts small,.xh-shortcuts>*>span:last-child { display: none; }
  .xh-shortcut-icon { width: 34px; height: 34px; font-size: 22px; }
  .xh-notice { padding: 16px; gap: 8px; margin-top: 16px; font-size: 14px; line-height: 1.8; flex-direction: column; }
  .xh-notice strong { font-size: 13px; }
  .xh-layout { display: block; margin: 28px 0 40px; }
  .xh-catalog,.xh-sidebar { min-width: 0; }
  .xh-groups { gap: 10px; margin-bottom: 22px; padding: 2px 2px 8px; scroll-padding: 2px; scroll-snap-type: x proximity; }
  .xh-groups button { flex-shrink: 0; min-height: 44px; font-size: 14px; line-height: 1.5; padding: 10px 16px; border-radius: 10px; scroll-snap-align: start; }
  .xh-toolbar { gap: 22px; }
  .xh-toolbar>div { flex-wrap: wrap; column-gap: 10px; row-gap: 3px; }
  .xh-toolbar h2 { font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }
  .xh-toolbar #xh-count { font-size: 12px; }
  .xh-search { min-height: 50px; padding: 2px 4px 2px 14px; align-items: center; border-radius: 12px; }
  .xh-search input { min-width: 0; height: 44px; font-size: 16px; line-height: 1.5; }
  .xh-search button { min-width: 44px; min-height: 44px; font-size: 27px; }
  .xh-filter-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 12px; align-items: center; margin: 14px 0 20px; }
  .xh-stock-filter { min-height: 44px; font-size: 14px; gap: 9px; white-space: normal; }
  .xh-stock-filter input { width: 18px; height: 18px; flex-shrink: 0; }
  .xh-sort { min-width: 0; width: 100%; margin: 0; }
  .xh-sort select { width: 100%; max-width: 100%; min-height: 44px; padding: 7px 8px; font-size: 16px; border: 1px solid var(--xh-line); border-radius: 9px; background: var(--xh-surface); }
  .xh-filter-row>button { grid-column: 1 / -1; grid-row: 2; justify-self: start; min-height: 40px; font-size: 13px; padding: 5px 0; }
  .xh-grid { gap: 16px; }
  .xh-product { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: start; column-gap: 14px; row-gap: 0; padding: 18px; border-radius: 14px; min-height: 0; }
  .xh-product-visual { grid-column: 1; grid-row: 1 / 3; width: 64px; height: 64px; margin: 0; border-radius: 11px; aspect-ratio: 1; }
  .xh-placeholder { border-radius: 11px; }
  .xh-placeholder>span { font-size: 29px; }
  .xh-placeholder small { font-size: 10px; margin-top: 3px; }
  .xh-product-body { display: contents; }
  .xh-category-name { grid-column: 2; grid-row: 1; font-size: 12px; line-height: 1.6; letter-spacing: 0; overflow-wrap: anywhere; }
  .xh-product h3 { grid-column: 2; grid-row: 2; margin: 4px 0 0; min-height: 0; font-size: 15px; line-height: 1.65; font-weight: 600; }
  .xh-meta { grid-column: 1 / -1; grid-row: 3; margin-top: 16px; gap: 7px; line-height: 1.5; }
  .xh-meta>span,.xh-meta .xh-delivery { font-size: 12px; padding: 3px 8px; border-radius: 7px; white-space: normal; overflow-wrap: anywhere; }
  .xh-product-bottom { grid-column: 1 / -1; grid-row: 4; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--xh-line); }
  .xh-price { min-width: 0; max-width: 100%; font-size: 22px; line-height: 1.4; font-weight: 650; white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
  .xh-price small { font-size: 12px; margin-left: 5px; white-space: nowrap; }
  .xh-product-bottom .xh-buy { width: auto; min-height: 44px; margin-left: auto; padding: 9px 15px; font-size: 14px; line-height: 1.6; border-radius: 9px; justify-content: center; flex-shrink: 0; }
  .xh-product-bottom .xh-buy span { font-size: 15px; }
  .xh-empty { padding: 36px 20px; }
  .xh-empty p { font-size: 14px; line-height: 1.8; }
  .xh-empty .xh-buy { min-height: 44px; font-size: 14px; padding: 10px 16px; }
  .xh-footer { padding: 24px 0 max(24px, env(safe-area-inset-bottom)); }
  .xh-footer-top { display: flex; flex-wrap: wrap; gap: 12px 20px; }
  .xh-footer-top .xh-brand { font-size: 17px; white-space: normal; }
  .xh-footer-top>a:last-child { min-height: 44px; display: flex; align-items: center; font-size: 14px; }
  .xh-footer-top>span { display: none; }
  .xh-footer-bottom { flex-direction: column; gap: 12px; margin-top: 20px; padding-top: 18px; font-size: 12px; line-height: 1.8; }
  .xh-footer-bottom>div { max-width: 100%; }
  /* Keep order fields, payment choices and long order data readable. */
  .xh-theme .page-wrapper { background: var(--xh-bg); }
  .xh-theme .main-container { padding: 22px 0 36px; }
  .xh-theme .main-container>.container { padding-left: 16px; padding-right: 16px; }
  .xh-theme .main-container .card { border-radius: 14px; min-width: 0; }
  .xh-theme .main-container .card.m-3 { margin: 0!important; }
  .xh-theme .main-container .card-body { padding: 20px; font-size: 15px; line-height: 1.8; }
  .xh-theme .main-container .card-body.p-4 { padding: 20px!important; }
  .xh-theme .main-container .card-title { font-size: 21px; line-height: 1.5; margin-bottom: 16px; }
  .xh-theme .main-container .card-header { padding: 16px 20px; }
  .xh-theme .main-container .card-header h5 { font-size: 17px; line-height: 1.6; margin-bottom: 0; }
  .xh-theme .main-container .card-img-top { max-height: 200px; width: 100%; height: auto; object-fit: contain; padding: 20px!important; }
  .xh-theme .main-container .text-muted { font-size: 13px; line-height: 1.8; }
  .xh-theme .main-container .badge { font-size: 12px; line-height: 1.6; white-space: normal; }
  .xh-theme .main-container .buy-form { margin-top: 24px!important; }
  .xh-theme .main-container .form-group.row { row-gap: 16px; }
  .xh-theme .main-container .form-group.row+.form-group.row { margin-top: 20px; }
  .xh-theme .main-container .col-form-label { padding: 0 0 8px; font-size: 14px; line-height: 1.7; }
  .xh-theme .main-container .form-control,.xh-theme .main-container .form-select { min-width: 0; min-height: 48px; padding: 10px 12px; font-size: 16px; line-height: 1.6; }
  .xh-theme .main-container .input-group .btn { min-width: 44px; min-height: 48px; font-size: 16px; }
  .xh-theme .main-container .input-group { align-items: center; row-gap: 10px; }
  .xh-theme .main-container #imageCode { flex-shrink: 0; max-width: 42%; }
  .xh-theme .main-container .form-check-inline { display: block; margin: 8px 0; padding: 12px 12px 12px 38px; border: 1px solid var(--xh-line); border-radius: 10px; min-height: 48px; }
  .xh-theme .main-container .form-check-label { display: block; font-size: 14px; line-height: 1.7; cursor: pointer; }
  .xh-theme .main-container .btn[type="submit"],.xh-theme .main-container .xh-copy-card { width: 100%; min-height: 48px; padding: 11px 16px; font-size: 15px; border-radius: 10px; }
  .xh-theme .main-container .nav-pills { display: flex; gap: 6px; }
  .xh-theme .main-container .nav-pills .nav-item { flex: 1 1 0; min-width: 0; }
  .xh-theme .main-container .nav-pills .nav-link { display: flex; justify-content: center; align-items: center; height: 100%; min-height: 48px; padding: 8px 6px; font-size: 13px; line-height: 1.6; text-align: center; white-space: normal; overflow-wrap: anywhere; }
  .xh-theme .main-container .card-body table { display: block; overflow-x: auto; }
  .xh-theme .modal-dialog { margin: 16px; }
  .xh-theme .modal-body { padding: 20px; font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
  .xh-theme .modal-header,.xh-theme .modal-footer { padding: 14px 20px; }
  .xh-theme .modal-title { font-size: 18px; line-height: 1.6; }
  .xh-theme .modal-footer .btn { min-height: 44px; font-size: 14px; padding: 9px 18px; }
  .xh-theme .modal-header .btn-close { min-width: 32px; min-height: 32px; }
  .xh-help-dialog { width: calc(100vw - 32px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); border-radius: 16px; }
  .xh-help-dialog[open] { display: flex; flex-direction: column; }
  .xh-help-head,.xh-help-footer { flex-shrink: 0; padding: 16px 20px; }
  .xh-help-head h2 { font-size: 19px; line-height: 1.5; }
  .xh-help-head button { min-width: 44px; min-height: 44px; }
  .xh-help-content { min-height: 0; max-height: none; padding: 22px 20px; overscroll-behavior: contain; }
  .xh-help-content section { padding-left: 40px; padding-bottom: 26px; }
  .xh-help-content h3 { font-size: 16px; line-height: 1.6; margin-bottom: 10px; }
  .xh-help-content p { font-size: 14px; line-height: 1.9; }
  .xh-help-footer .xh-buy { min-height: 44px; font-size: 14px; padding: 9px 18px; }
}
@media (max-width: 359px) {
  .xh-header-inner { column-gap: 10px; }
  .xh-header .xh-brand { font-size: 17px; gap: 7px; }
  .xh-header .xh-logo-icon { width: 32px; height: 32px; }
  .xh-welcome { padding: 18px; }
  .xh-welcome h1 { font-size: 21px; }
  .xh-shortcuts>a,.xh-shortcuts>button { gap: 8px; padding: 14px 10px; }
  .xh-shortcut-icon { width: 28px; height: 28px; font-size: 20px; }
  .xh-product { padding: 16px; grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; }
  .xh-product-visual { width: 56px; height: 56px; }
  .xh-theme .main-container .card-body,.xh-theme .main-container .card-body.p-4 { padding: 18px!important; }
}
