/* public/themes/_shared/base.css — loaded by every storefront theme (themes::_shared.head) BEFORE the theme's theme.css.
   A small reset plus the pieces every theme shares: skip link, screen-reader text, icons, the tool tile, rich text from the
   merchant / admin (.th-prose), focus rings and reduced motion. Themes override anything here in their own theme.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* accessibility */
.th-skip { position: absolute; left: 12px; top: -48px; z-index: 1000; padding: 8px 14px; border-radius: 8px; background: #111827; color: #fff; text-decoration: none; font-weight: 600; transition: top .15s; }
.th-skip:focus { top: 12px; }
.th-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* icons (themes::_shared.icon) */
.th-icon { display: inline-block; flex: none; vertical-align: middle; }

/* the tool tile (themes::_shared.tile) */
.th-tile { --th-tile: #6366f1; --th-tile-size: 48px; display: inline-grid; place-items: center; flex: none; width: var(--th-tile-size); height: var(--th-tile-size); border-radius: calc(var(--th-tile-size) * .25); background: var(--th-tile); color: #fff; overflow: hidden; }
.th-tile.has-logo { background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.th-tile img { width: 78%; height: 78%; object-fit: contain; }
.th-tile-initials { font-weight: 700; font-size: calc(var(--th-tile-size) * .34); letter-spacing: .02em; line-height: 1; }
/* the initials wait under the logo: a logo that fails to load takes .has-logo off and hides itself (the tile partial, task 795). Both
   share the tile's one grid cell; the hidden logo stays its first item, so the tile keeps the baseline the logo gave it (a tile on a
   line of text does not move) */
.th-tile.has-logo .th-tile-initials { display: none; }
.th-tile > img, .th-tile > .th-tile-initials { grid-area: 1 / 1; }

/* rich text written by the merchant (payment, support) or the admin (tool description): already sanitised (SafeHtml) */
.th-prose { overflow-wrap: anywhere; }
.th-prose > * + * { margin-top: .75em; }
.th-prose h1, .th-prose h2, .th-prose h3, .th-prose h4, .th-prose h5, .th-prose h6 { line-height: 1.25; font-weight: 700; }
.th-prose h1, .th-prose h2 { font-size: 1.25em; }
.th-prose h3, .th-prose h4, .th-prose h5, .th-prose h6 { font-size: 1.05em; }
.th-prose ul, .th-prose ol { padding-left: 1.4em; }
.th-prose li + li { margin-top: .3em; }
.th-prose a { text-decoration: underline; text-underline-offset: 2px; }
.th-prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.th-prose th, .th-prose td { padding: .4em .6em; border: 1px solid currentColor; border-color: rgba(127, 127, 127, .35); text-align: left; }
.th-prose blockquote { padding-left: 1em; border-left: 3px solid currentColor; opacity: .85; }
.th-prose pre, .th-prose code { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.th-prose pre { padding: .8em 1em; overflow-x: auto; border-radius: 8px; background: rgba(127, 127, 127, .12); }

/* the plan picker's selected option (store.js toggles .is-selected) and the buy bar (store.js toggles .is-visible) */
[data-th-buybar] { transition: transform .2s ease, opacity .2s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* the legal pages in a footer (themes::_shared.legal-links, task 540): "Terms · Privacy · Refund policy" */
.th-legal-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.th-legal-links a { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
@media (max-width: 767px) { .th-legal-links a { min-height: 40px; } }
.th-legal-links a:hover, .th-legal-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
.th-legal-links > span { opacity: .55; }

/* the store's currency switcher (themes::_shared.currency, task 780): "₹ INR | $ USD", two toggle buttons in one pill.
   Tune it per theme with custom properties on the theme's body class (or on .<prefix>-cur):
     --th-cur-bg (the pill)  --th-cur-line (its edge)  --th-cur-fg (the idle option)  --th-cur-hover (idle option on hover)
     --th-cur-on-bg / --th-cur-on-fg / --th-cur-on-shadow (the currency shown)  --th-cur-radius  --th-cur-font  --th-cur-size
   Keep it quiet: it is a setting, not an action. The currency shown is a raised chip, a tint or a rule in the theme's own
   language, never the solid fill of the theme's main button (it sits next to "Create account": two look-alike buttons would
   compete). Each option is a 40 px tall tap target (the pill's padding is inside the buttons: .th-cur-face carries the look).
   Place the form in the header row: it stays visible on phones, next to the menu button. */
.th-cur { margin: 0; display: inline-flex; flex: none; }
.th-cur-in { display: inline-flex; align-items: stretch; border-radius: var(--th-cur-radius, 999px); background: var(--th-cur-bg, rgba(127, 127, 127, .12)); box-shadow: inset 0 0 0 1px var(--th-cur-line, transparent); }
.th-cur-opt { position: relative; display: inline-flex; align-items: stretch; min-height: 40px; padding: 2px; margin: 0; border: 0; border-radius: var(--th-cur-radius, 999px); background: none; color: var(--th-cur-fg, inherit); font-family: var(--th-cur-font, inherit); font-size: var(--th-cur-size, 13px); font-weight: 600; line-height: 1; letter-spacing: .02em; white-space: nowrap; cursor: pointer; }
.th-cur-face { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 40px; padding: 0 10px; border-radius: var(--th-cur-radius, 999px); transition: background-color .15s ease, color .15s ease; }
.th-cur-opt:hover .th-cur-face { background: var(--th-cur-hover, rgba(127, 127, 127, .16)); }
.th-cur-opt[aria-pressed="true"] { color: var(--th-cur-on-fg, #fff); cursor: default; }
.th-cur-opt[aria-pressed="true"] .th-cur-face { background: var(--th-cur-on-bg, #111827); box-shadow: var(--th-cur-on-shadow, none); }
.th-cur-opt:focus-visible { outline: 2px solid var(--th-cur-focus, currentColor); outline-offset: 2px; }
.th-cur-sym { font-weight: 700; }
.th-cur[aria-busy="true"] .th-cur-opt { cursor: progress; opacity: .75; }
/* phones: the symbol alone ("₹ | $": the header keeps room for the store's name); the code stays for screen readers */
@media (max-width: 480px) {
  .th-cur-face { padding: 0 8px; }
  .th-cur-sym { font-size: 1.15em; }
  .th-cur-sym + .th-cur-code { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
/* the narrowest phones: each option 40 px wide (still a 40 px tap target), so the store's name keeps a little more room */
@media (max-width: 360px) { .th-cur-face { min-width: 36px; padding: 0 6px; } }
/* a local price's USD figure (themes::_shared.usd): "(14.99 USD)" in the unit's own colour, a step smaller */
.th-usd { font-size: .86em; font-weight: 500; white-space: nowrap; letter-spacing: 0; }
