/* Text preferences change reading type, without zooming photographs or layouts. */
:root {
  --pp-reading-secondary: .875rem;
}
:root:not([data-pp-text-size]),
:root[data-pp-text-size="medium"] { font-size: 18px; }
:root[data-pp-text-size="small"] { font-size: 16px; }
:root[data-pp-text-size="large"] { font-size: 20px; }

:root[data-pp-text-size] body,
:root[data-pp-text-size] body main {
  font-size: 1rem !important;
}

/* Older catalogue pages have fixed pixel sizes. Include their generated content. */
:root[data-pp-text-size] body main :is(
  p, li, dt, dd, blockquote, summary,
  .product-format, .product-lead, .product-fact, .catalogue-card-fact,
  .guide-tagline, .article-deck, .article-intro, .article-body,
  .article-opening, .guide-answer-body, .voice-product,
  .guide-help, .guide-welcome, .guide-asked,
  .comparison-amount, .comparison-values,
  table, td, th
),
:root[data-pp-text-size] body dialog :is(p, li, table, td, th, .comparison-amount, .comparison-values) {
  font-size: 1rem !important;
  line-height: 1.65;
}

:root[data-pp-text-size] body main a,
:root[data-pp-text-size] body dialog a {
  font-size: inherit !important;
}

:root[data-pp-text-size] body main h1 {
  font-size: clamp(2rem, 3.5vw, 2.8rem) !important;
  line-height: 1.18;
}
:root[data-pp-text-size] body main h2,
:root[data-pp-text-size] body dialog h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem) !important;
  line-height: 1.3;
}
:root[data-pp-text-size] body main h3,
:root[data-pp-text-size] body dialog h3 {
  font-size: 1.2rem !important;
  line-height: 1.4;
}
:root[data-pp-text-size] body main :is(h4, h5, h6) {
  font-size: 1.075rem !important;
  line-height: 1.45;
}

:root[data-pp-text-size] body main :is(
  small, caption, .subtle, .affiliate-note, .seller-detail,
  .market-detail, .link-caption, .catalogue-fineprint, .filter-help,
  .guide-note, .guide-results, .guide-privacy, .guide-capability,
  .article-meta, .article-caption, .article-sources li,
  .product-image-note, .pp-photo-credit, .compare-notice,
  .comparison-categories, .card-copy > .brand-name,
  .product-notes .subtle, .label-record th small
),
:root[data-pp-text-size] body dialog :is(small, caption, .compare-notice, .comparison-categories) {
  font-size: var(--pp-reading-secondary) !important;
  line-height: 1.6;
}

:root[data-pp-text-size] body main :is(input, select, textarea, label),
:root[data-pp-text-size] body main button:not(.guide-mic):not([data-compare-scroll]),
:root[data-pp-text-size] body dialog :is(input, select, textarea, label, button),
:root[data-pp-text-size] body :is(.card-actions > a, .shop-link, .copy-product, .compare-bar button) {
  font-family: inherit !important;
  font-size: 1rem !important;
  line-height: 1.45;
}

/* The chooser stays compact and usable at every reading size. */
:root[data-pp-text-size] body .topbar {
  flex-wrap: wrap;
}
:root[data-pp-text-size] body .topbar .app-context {
  min-width: 0;
}
.pp-text-size-control {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  max-width: 100%;
  margin: 0;
  color: #274c40;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.pp-text-size-label {
  color: #274c40;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.4;
}
:root[data-pp-text-size] body .pp-text-size-select {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: auto;
  min-width: 106px;
  max-width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 9px 34px 9px 12px;
  border: 1px solid #aabeb5;
  border-radius: 10px;
  background-color: #fff;
  background-image: linear-gradient(45deg, transparent 50%, #365c4c 50%),
    linear-gradient(135deg, #365c4c 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  color: #183d30;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.pp-text-size-select:hover {
  border-color: #365c4c;
}
.pp-text-size-select:focus-visible {
  outline: 3px solid #17694b;
  outline-offset: 3px;
}
.pp-text-size-fallback {
  display: flex;
  justify-content: flex-end;
  margin-block: 12px 20px;
  max-width: 100%;
}

@media (max-width: 640px) {
  :root[data-pp-text-size] body .pp-text-size-select {
    font-size: 16px !important;
  }
  :root[data-pp-text-size] body .topbar .pp-text-size-control {
    flex-basis: 100%;
    justify-content: flex-end;
  }
  :root[data-pp-text-size] body main :is(h1, h2, h3) {
    overflow-wrap: anywhere;
  }
}

@media print {
  .pp-text-size-control,
  .pp-text-size-fallback { display: none !important; }
}

/* Visitor language and reading preferences. Sizes never scale images or data. */
:root { --pp-line-height: 1.65; --pp-letter-spacing: 0em; }
:root[data-pp-font="sans"] body { font-family: Arial, "Noto Sans", system-ui, sans-serif !important; }
:root[data-pp-font="serif"] body { font-family: Georgia, "Noto Serif", "Times New Roman", serif !important; }
:root[data-pp-font="sans"] body :is(main,header,aside,footer,dialog) :is(p,a,span,strong,small,li,dt,dd,label,input,select,textarea,button,h1,h2,h3,h4,h5,h6,td,th,summary),
:root[data-pp-font="serif"] body :is(main,header,aside,footer,dialog) :is(p,a,span,strong,small,li,dt,dd,label,input,select,textarea,button,h1,h2,h3,h4,h5,h6,td,th,summary) { font-family: inherit !important; }
:root[data-pp-text-size] body main :is(p,li,dt,dd,blockquote,td,th),
:root[data-pp-text-size] body dialog :is(p,li,td,th) { line-height: var(--pp-line-height) !important; }
:root[data-pp-spacing="custom"] body :is(p,li,dt,dd,blockquote,summary,h1,h2,h3,h4,h5,h6,a,span,strong,small,label,button,input,select,textarea,td,th) { letter-spacing: var(--pp-letter-spacing) !important; }
/* Preserve the joining behaviour of cursive scripts. */
:root[data-pp-spacing] body :is([lang="ur"],[lang="ar"]),
:root[data-pp-spacing] body :is([lang="ur"],[lang="ar"]) * { letter-spacing: normal !important; }
.pp-reading { position: relative; flex: 0 0 auto; max-width: 100%; color: #183d30; font-size: 16px; text-align: start; }
.pp-reading > summary { display: flex; align-items: center; justify-content: center; gap: 9px; list-style: none; min-height: 44px; padding: 9px 13px; border: 1px solid #aabeb5; border-radius: 12px; background: #fff; color: #183d30; font-size: 14px !important; font-weight: 650; line-height: 1.4; cursor: pointer; }
.pp-reading > summary::-webkit-details-marker { display: none; }
.pp-reading > summary::after { content: ''; width: 6px; height: 6px; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg); margin-inline-start: 4px; margin-block-end: 4px; }
.pp-reading[open] > summary { background: #e8f1eb; border-color: #17694b; }
.pp-reading-symbol { font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.pp-reading-panel { position: absolute; right: 0; left: auto; inset-block-start: calc(100% + 10px); width: min(380px, calc(100vw - 32px)); max-height: min(80vh, 740px); overflow: auto; overscroll-behavior: contain; padding: 20px; border: 1px solid #b9cec2; border-radius: 20px; background: #fff; box-shadow: 0 18px 65px #123f3b26; z-index: 150; box-sizing: border-box; text-transform: none; white-space: normal; }
.pp-reading:not([open]) > .pp-reading-panel { display: none; }
.pp-reading-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-block-end: 16px; }
.pp-reading-heading strong { font-size: 18px; line-height: 1.4; }
:root[data-pp-text-size] body .pp-reading :is(select,button,input,label) { font-size: 16px !important; font-family: inherit !important; line-height: 1.4; }
:root[data-pp-text-size] body .pp-reading button { width: auto; min-height: 44px; padding: 9px 12px; border: 1px solid #b9cec2; border-radius: 10px; background: #f4f8f4; color: #183d30; cursor: pointer; }
:root[data-pp-text-size] body .pp-reading .pp-reading-close { min-width: 44px; flex-shrink: 0; margin-block-start: -8px; margin-inline-end: -8px; font-size: 25px !important; background: transparent; border-color: transparent; }
.pp-reading-field { display: flex; flex-direction: column; gap: 8px; margin: 0; min-width: 0; }
.pp-reading-field > span:first-child { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; font-weight: 650; }
:root[data-pp-text-size] body .pp-reading select { appearance: none; -webkit-appearance: none; width: 100%; min-height: 46px; height: auto; padding: 10px 34px 10px 12px; border: 1px solid #aabeb5; border-radius: 10px; color: #183d30; background-color: #fff; background-image: linear-gradient(45deg, transparent 50%, #365c4c 50%),linear-gradient(135deg, #365c4c 50%, transparent 50%); background-position: calc(100% - 17px) 20px,calc(100% - 12px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }
:root[data-pp-text-size] body .pp-reading p.pp-reading-scope { font-size: 14px !important; line-height: 1.55 !important; margin-block: 10px 8px; color: #4d665b; }
:root[data-pp-text-size] body .pp-reading .pp-reading-guide { display: inline-block; font-size: 14px !important; line-height: 1.5; color: #17694b; text-decoration: underline; text-underline-offset: 3px; margin-block-end: 20px; }
.pp-reading-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pp-reading-range { margin-block-start: 20px; }
.pp-reading output { font-size: 14px; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; font-weight: 400; }
:root[data-pp-text-size] body .pp-reading input[type="range"] { width: 100%; height: 34px; min-height: 34px; padding: 0; accent-color: #17694b; cursor: pointer; direction: ltr; }
.pp-reading-scale { direction: ltr; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: #4d665b; }
.pp-reading-preview { padding: 14px; background: #edf4ef; border-radius: 12px; margin-block: 18px; }
.pp-reading-preview small { font-size: 14px !important; color: #4d665b; }
:root[data-pp-text-size] body .pp-reading .pp-reading-preview p { font-size: 1rem !important; line-height: var(--pp-line-height) !important; margin-block: 8px 0; overflow-wrap: anywhere; }
.pp-reading-footer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.pp-reading-footer [role="status"] { font-size: 14px; line-height: 1.4; color: #4d665b; }
.pp-reading :is(summary,select,button,input,a):focus-visible { outline: 3px solid #17694b; outline-offset: 3px; }
.pp-reading [dir="rtl"] select { padding: 10px 12px 10px 34px !important; background-position: 12px 20px,17px 20px !important; }
:root[data-pp-text-size] .topbar:has(.pp-reading[open]) { z-index: 160; overflow: visible; backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (max-width: 640px) {
  .topbar .pp-reading { flex-basis: 100%; }
  .pp-reading > summary { width: 100%; box-sizing: border-box; }
  .pp-reading-panel { position: fixed; left: 12px; right: 12px; inset-block-start: 12px; inset-block-end: auto; width: auto; max-height: calc(100dvh - 24px); padding: 18px; }
  .pp-reading-fields { grid-template-columns: 1fr 1fr; }
}
@media print { .pp-reading { display: none !important; } }
