/* JAYTRA - dated rate pages (/rates, /rates/<line>, /hi/rates...). Built on the design
   system in site.css (tokens, .s-title, .s-btn, .s-h2, .s-card-sheet). Gold only on dark or
   as a rule; dark gold (--s-gold-text) for accents on light grounds. Phone first: at 640px
   and below every table row is a card, so nothing scrolls sideways. */

.rt-title h1 { max-width: 28ch; }
.rt-meta .rt-stamp { color: var(--s-white); font-weight: 600; }
.rt-meta .rt-stamp::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--s-gold); vertical-align: 1px; }
.rt-lang { margin: 14px 0 0; }
.rt-lang a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid rgba(255,255,255,.7); border-radius: 999px; color: var(--s-white); font-size: 14.5px; font-weight: 500; text-decoration: none; }
.rt-lang a:hover { background: var(--s-gold); border-color: var(--s-gold); color: var(--s-black); }

/* Devanagari needs more room between lines than Latin, and no negative tracking */
.rt[lang="hi"] .rt-title h1 { line-height: 1.32; letter-spacing: 0; max-width: 22ch; }
.rt[lang="hi"] .s-title-lede { line-height: 1.75; }
.rt[lang="hi"] .s-h2, .rt[lang="hi"] .s-h3, .rt[lang="hi"] .rt-line-h { line-height: 1.45; letter-spacing: 0; }
.rt[lang="hi"] .rt-table, .rt[lang="hi"] .rt-notes, .rt[lang="hi"] .rt-facts dd, .rt[lang="hi"] .rt-order-p { line-height: 1.7; }

.rt-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 4vw, 48px); padding-block: clamp(28px, 4.5vw, 64px); font-family: var(--s-f); }
.rt-body > * { min-width: 0; }
/* wide screens: the table on the left with the calculators and the other lines under it,
   delivery and ways to order in a column on the right. Phones keep the source order:
   table, delivery, ways to order, calculators, other lines. */
@media (min-width: 1024px) {
  .rt-body { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); grid-template-rows: auto auto 1fr; column-gap: clamp(32px, 4vw, 56px); row-gap: 0; align-items: start;
    grid-template-areas: "main side" "calc side" "more side"; }
  .rt-rates, .rt-lines { grid-area: main; }
  .rt-side { grid-area: side; }
  .rt-calc { grid-area: calc; margin-top: clamp(32px, 4vw, 48px); }
  .rt-more { grid-area: more; margin-top: clamp(32px, 4vw, 48px); }
}
.rt-side { display: grid; gap: 28px; }
.rt-rates .s-h2 { margin-bottom: 20px; }
.rt-alert { margin: 0 0 16px; padding: 12px 16px; border: 1.5px solid var(--s-black); border-radius: var(--s-r); background: var(--s-gold-light); font-size: 14.5px; font-weight: 500; }

/* ── the rate table ── */
.rt-table { width: 100%; border-collapse: collapse; border: 1px solid var(--s-black); background: var(--s-white); font-size: 15px; }
.rt-table th, .rt-table td { padding: 14px 16px; border-bottom: 1px solid var(--s-line); text-align: left; vertical-align: top; }
.rt-table thead th { background: var(--s-black); color: var(--s-white); font-size: 13px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.rt-th-s { font-weight: 400; color: var(--s-on-dark-2); }
.rt-brand th { padding: 10px 16px; border-left: 4px solid var(--s-gold); border-bottom: 1px solid var(--s-black); background: var(--s-bg); color: var(--s-black); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.rt-table tbody:last-child tr:last-child > * { border-bottom: 0; }
.rt-name { font-weight: 400; min-width: 220px; }
.rt-name a { color: var(--s-black); font-weight: 600; text-decoration: underline; text-decoration-color: var(--s-gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.rt-name a:hover { text-decoration-thickness: 3px; }
.rt-opt { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 1px solid var(--s-black); border-radius: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.rt-std, .rt-sub { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--s-muted); }
.rt-std { color: var(--s-ink-2); font-weight: 500; }
.rt-bulk { color: var(--s-gold-text); font-weight: 500; }
.rt-unit { color: var(--s-ink-2); white-space: nowrap; }
.rt-rate { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rt-price strong { font-size: 18px; font-weight: 700; }
.rt-per { display: none; color: var(--s-muted); font-size: 13.5px; }
.rt-gst, .rt-mrp, .rt-prior { display: block; font-size: 12.5px; color: var(--s-muted); }
.rt-prior { white-space: normal; max-width: 30ch; }
.rt-stock { min-width: 110px; }
.rt-st { display: inline-block; font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.rt-st.is-in, .rt-st.is-out { white-space: nowrap; }
.rt-st.is-in { color: var(--s-ok); }
.rt-st.is-out { color: var(--s-err); }
.rt-st.is-low, .rt-st.is-order { color: var(--s-ink-2); font-weight: 500; }
.rt-row.is-out .rt-price strong { color: var(--s-muted); }
.rt-act { min-width: 140px; }
.rt-act .s-btn { white-space: nowrap; }
.rt-act .s-btn[aria-busy="true"] { opacity: .6; }
.rt-msg { display: block; margin-top: 6px; font-size: 13px; color: var(--s-ink-2); }
.rt-msg:empty { display: none; }

/* phones: each row is a card (name, then rate and stock side by side, then the button) */
@media (max-width: 640px) {
  .rt-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rt-table, .rt-table tbody { display: block; width: 100%; }
  .rt-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; border-bottom: 1px solid var(--s-line); }
  .rt-table tbody:last-child tr:last-child { border-bottom: 0; }
  .rt-table th, .rt-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .rt-table tr.rt-brand { display: block; padding: 0; border-bottom: 1px solid var(--s-black); }
  .rt-brand th { padding: 10px 16px; border-left: 4px solid var(--s-gold); border-bottom: 0; }
  .rt-name { grid-column: 1 / -1; font-size: 15.5px; }
  .rt-unit { display: none !important; }
  .rt-per { display: inline; }
  .rt-rate { grid-column: 1; white-space: normal; }
  .rt-price { white-space: nowrap; }
  .rt-prior { max-width: none; }
  .rt-stock { grid-column: 2; text-align: right; }
  .rt-stock.rt-stock-long { grid-column: 1 / -1; text-align: left; }
  .rt-act { grid-column: 1 / -1; margin-top: 4px; }
  .rt-act .s-btn { width: 100%; }
}

.rt-notes { margin-top: 14px; display: grid; gap: 6px; font-size: 14px; color: var(--s-muted); max-width: 80ch; }
.rt-notes p { margin: 0; }
.rt-notes .rt-note-own { color: var(--s-ink-2); font-weight: 500; }

/* ── side column: delivery facts, ways to order, other lines ── */
.rt-del .s-h3, .rt-order .s-h3, .rt-more .s-h3 { margin-bottom: 10px; }
.rt-facts { margin: 0; display: grid; }
.rt-facts > div { padding: 10px 0; border-bottom: 1px solid var(--s-line); }
.rt-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.rt-facts dt { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--s-gold-text); }
.rt[lang="hi"] .rt-facts dt { font-size: 14px; letter-spacing: 0; }
.rt-facts dd { margin: 2px 0 0; font-size: 15px; line-height: 1.5; color: var(--s-ink-2); }
.rt-order-p { margin: 0 0 12px; font-size: 14.5px; color: var(--s-ink-2); }
.rt-order-btns { display: grid; gap: 10px; }
.rt-order-btns .s-btn { width: 100%; text-align: center; }
.rt-more ul { margin: 0; padding: 0; list-style: none; }
.rt-more .s-chip { text-decoration: none; }
.rt-more-links { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.rt-more-links a { display: inline-flex; min-height: 44px; align-items: center; }
.rt-calc:empty { display: none; }

/* ── index: one card per product line ── */
.rt-line-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.rt-line { position: relative; display: grid; align-content: start; gap: 6px; padding: 18px 18px 16px; border: 1px solid var(--s-black); border-left: 4px solid var(--s-gold); background: var(--s-white); }
.rt-line:hover, .rt-line:focus-within { background: var(--s-bg); }
.rt-line-h { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.25; }
.rt-line-h a { color: var(--s-black); text-decoration: none; }
.rt-line-h a::after { content: ""; position: absolute; inset: 0; }
.rt-line-b { margin: 0; font-size: 14px; color: var(--s-ink-2); }
.rt-line-m { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--s-muted); }
.rt-line-go { margin: 6px 0 0; font-size: 14.5px; font-weight: 600; color: var(--s-black); text-decoration: underline; text-decoration-color: var(--s-gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* the "Today's rates" link other pages print (ratesLinkHtml()) needs nothing beyond .s-link */
