/* Phones and small tablets. Loaded last on every page (public, account, partner, back office). Nothing here applies from 960px up. */

@media (max-width: 959px) {
  /* iPhone zooms the whole page when a field with text under 16px is tapped */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }

  /* footer and small action links: tall enough for a finger */
  .foot ul { gap: 0; }
  .foot li > a, .foot li > .linklike { display: inline-flex; align-items: center; min-height: 38px; }
  .cmp-scroll a.small, .pf-card > p > a:only-child { display: inline-block; padding: 9px 0; }
  .filters label { min-height: 38px; }

  /* section headings: a long link drops under the heading instead of squeezing it or pushing the page sideways */
  .section-head { flex-wrap: wrap; row-gap: 4px; }
  .section-head > :first-child { flex: 1 1 220px; min-width: 0; }
  .section-head > .more { margin-left: auto; }
  main h2 { line-height: 1.18; }   /* the serif is drawn large: two-line headings need room between the lines */
  .list-layout { grid-template-columns: minmax(0, 1fr); }   /* a wide toolbar wraps instead of pushing the deal grid off the screen */
  .chips > span.small { flex: none; white-space: nowrap; }

  /* compare tray: wraps onto a second line, so "Compare" and "Clear" never leave the screen */
  .compare-tray { flex-wrap: wrap; row-gap: 8px; column-gap: 10px; }
  .cmp-thumb { width: 40px; height: 40px; }
  .cmp-thumbs { gap: 10px; }
  .cmp-say b { white-space: nowrap; }
  .compare-tray .btn { flex: 1 0 auto; justify-content: center; }
  .cmp-clear { min-height: 40px; padding: 6px 10px; }
  .has-tray .toasts { bottom: calc(var(--bar-h) + var(--safe-b) + 136px); }
  body.reels-page .compare-tray { display: none; }   /* DotReels has its own full-screen buttons underneath */

  /* full-screen search: one close button, inside the field */
  .search .icon-btn .ico, .search.open .icon-btn .ico { position: static; }
  .search.open .input { padding-right: 52px; }
  .search.open > .icon-btn { right: calc(var(--gutter) + 4px) !important; top: calc(14px + var(--safe-t)) !important; }
  .search input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

  /* price history: the drawing is shrunk to fit, so its labels are drawn larger */
  .chart text { font-size: 20px; }
}

@media (max-width: 719px) {
  /* comparison table: two products side by side, and the edge of a third to show there is more */
  table.cmp { min-width: calc(92px + var(--n) * 108px); }
  table.cmp thead th:first-child, table.cmp tbody th { width: 92px; }
  table.cmp th, table.cmp td { padding: 10px 8px; font-size: 13px; overflow-wrap: break-word; }
  table.cmp tbody th { font-size: 10.5px; letter-spacing: .04em; }
  table.cmp .btn { white-space: normal; text-align: center; padding-left: 10px; padding-right: 10px; }
  .cmp-pic { height: 92px; }
  .cmp-title { font-size: 13px; }
  .cmp-price { font-size: 18px; }
  .cmp-best { position: static; display: block; margin-top: 4px; }
  .cmp-score { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (max-width: 619px) {
  /* price-fall cards: "date, old price" on one line and "now, price" under it; a price is never broken in half */
  .drop-body { padding-left: 10px; padding-right: 10px; }
  .drop-line { flex-direction: column; align-items: stretch; gap: 4px; }
  .drop-line > span { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 6px; white-space: nowrap; }
  .drop-line > .ico { display: none; }
  .drop-now b { font-size: clamp(17px, 5vw, 20px); margin-left: auto; }

  /* "same product" bars: the whole store name */
  .gap-row { grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto; }
  .gap-row span { white-space: normal; line-height: 1.25; }

  .verdict.verdict-intro { flex-direction: column; }
}

@media (max-width: 639px) {
  /* tick boxes: a full-width row to tap, with the box beside the first line of its text */
  .pf-switch { align-items: flex-start; padding: 8px 0; line-height: 1.4; }
  .pf-switch input { flex: none; width: 20px; height: 20px; margin-top: 1px; }

  .acct-watch-row { grid-template-columns: minmax(0, 1fr); gap: 4px; justify-items: start; }

  .pf-narrow .pf-form ~ p, .pf-narrow > p:last-child { margin-top: 16px; }
  .pf-narrow p > .pf-btn { margin-top: 6px; }

  /* partner feed health: one block per check instead of three crushed columns */
  .pf-wrap table.pf-table.pf-health, .pf-health tbody { display: block; width: 100%; overflow: visible; }
  .pf-wrap table.pf-health tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
  .pf-wrap table.pf-health td { display: block; width: auto !important; padding: 0; border: 0; text-align: left; }
  .pf-wrap table.pf-health td:first-child { grid-column: 1 / -1; }
}

@media (max-width: 359px) {
  /* very small phones: all five dock buttons stay on the dock, even with large text */
  .bar a, .bar button { min-width: 40px; padding: 0 7px; }
  .bar a.on, .bar button.on { flex: 0 1 auto; min-width: 0; padding: 0 10px; gap: 6px; overflow: hidden; }
  .bar .on .lab { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

.rt-pick { display: flex; align-items: center; gap: 10px; }
.rt-pick .pf-switch { flex: 1; min-width: 0; }
.rt-pick .pf-input { flex: none; width: 70px; }
.pf-narrow p a:not(.pf-btn) { text-decoration: underline; }
