/*
 * Fair Trade House of Iran — site styles.
 * Colours come from the brand guide. Layout uses logical properties
 * (inline-start/end) so the same CSS works for RTL Persian and LTR English.
 */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Regular.cdc140628f11.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Medium.dd2193b32cbe.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Bold.7958481fe611.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* Persian digits: Latin digits 0-9 typed or stored in the database are drawn as ۰-۹ on
   Persian pages, wherever they come from (Wagtail's own counts and page numbers, prices,
   dates). It is a 4 KB cut of Vazirmatn's "Farsi digits" variant that holds only 0-9,
   so every other character still comes from the next font. The text stays 0-9, so a
   copied number or a code pasted into a form still works. Things that are Latin by
   nature (dir="ltr": codes, Sheba, phone, e-mail, URL) keep Latin digits. */
@font-face {
  font-family: "FtFaDigits";
  src: url("../fonts/Vazirmatn-FD-digits-Regular.0dcee8796af8.woff2") format("woff2");
  font-weight: 100 400;
  font-display: swap;
  unicode-range: U+0030-0039;
}
@font-face {
  font-family: "FtFaDigits";
  src: url("../fonts/Vazirmatn-FD-digits-Medium.95619a0006c9.woff2") format("woff2");
  font-weight: 500 600;
  font-display: swap;
  unicode-range: U+0030-0039;
}
@font-face {
  font-family: "FtFaDigits";
  src: url("../fonts/Vazirmatn-FD-digits-Bold.3a9c293c3fd1.woff2") format("woff2");
  font-weight: 700 900;
  font-display: swap;
  unicode-range: U+0030-0039;
}

:root {
  /* Brand guide colours (source-docs/brand-guide.pdf). Gold is the main
     colour, with navy and white; cyan, blue and gray are accents. The guide's
     brown is kept for print only (it reads as orange on screen). */
  --gold: #cf9d2b;
  --navy: #1c1f4a;
  --cyan: #14e6e0;
  --blue: #031bff;
  --gray: #929e98;

  /* Shades made from those colours, for states and readable text */
  --gold-light: #e0b95a;   /* hover on gold buttons */
  --gold-dark: #a87d1c;    /* borders and large gold marks */
  --gold-text: #8a6512;    /* gold for small text on white (5.3:1) */
  --cyan-text: #0b6b68;    /* cyan for small text on white */

  --bg: #f6f7f9;           /* page background: white with a touch of navy */
  --surface: #ffffff;
  --text: #1f2033;
  --text-muted: #5d6062;
  --line: #e2e5ec;
  --field-border: #878c9f; /* form fields (3:1 on white) */
  --tint: #eef0f7;         /* light navy for highlights, active menu, notes */
  --tint-line: #d5d9e7;
  --gold-soft: #f7efdc;    /* light gold, only for "waiting" badges */

  /* IRANSans is the brand typeface. If the house has a licence, drop the
     font files in static/fonts and put "IRANSans" first in this list. */
  --font-fa: "FtFaDigits", "IRANSans", "Vazirmatn", Tahoma, sans-serif;
  --font-fa-latin-digits: "IRANSans", "Vazirmatn", Tahoma, sans-serif;
  --font-en: Arial, "Helvetica Neue", sans-serif;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 31, 74, 0.06), 0 4px 16px rgba(28, 31, 74, 0.06);
  --container: 1160px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-fa);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text);
  background: var(--bg);
}
html[lang="en"] body { font-family: var(--font-en); line-height: 1.65; }
/* Codes, Sheba, phone, e-mail and links written left to right keep Latin digits. */
html[lang="fa"] :is([dir="ltr"], code, kbd, samp, .ft-latin) { font-family: var(--font-fa-latin-digits); }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-text); text-decoration-thickness: 2px; }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.4; margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .container { padding-inline: 24px; } }

.skip-link {
  position: absolute; inset-inline-start: 8px; top: -48px;
  background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { top: 8px; }

/* Test copy (DEMO_MODE=1) */
.demo-banner {
  background: var(--gold);
  color: var(--navy);
  text-align: center;
  font-size: .85rem;
  line-height: 1.5;
  padding-block: 5px;
  padding-inline: 16px;
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  display: flex; align-items: center; gap: 16px;
  min-height: 72px;
}
.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.site-logo img { height: 48px; width: auto; }
.site-logo__text { font-weight: 700; color: var(--navy); font-size: 0.95rem; line-height: 1.3; }

.main-nav { margin-inline-start: auto; min-width: 0; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; flex-wrap: nowrap; }
.main-nav a {
  display: block; padding: 8px 10px; border-radius: 8px; white-space: nowrap;
  color: var(--navy); text-decoration: none; font-weight: 500;
}
.main-nav a:hover { background: var(--tint); color: var(--navy); }
.main-nav a[aria-current="page"] { background: var(--tint); color: var(--navy); box-shadow: inset 0 -2px 0 var(--gold); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch {
  font-size: 0.9rem; text-decoration: none; color: var(--text-muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
}
.lang-switch:hover { border-color: var(--gold); color: var(--navy); }
.lang-switch__short { display: none; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; cursor: pointer; color: var(--navy); font: inherit;
}

/* The menu folds into the "Menu" button on narrow screens, and also on wider
   ones when the admin's menu items do not fit on one line (the script in
   base.html adds --tight, then --compact). */
.site-header--tight .site-logo__text { display: none; }
.site-header--compact .nav-toggle { display: inline-flex; margin-inline-start: auto; }
.site-header--compact .main-nav {
  display: none; position: absolute; inset-inline: 0; top: 100%;
  background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
}
.site-header--compact .main-nav.is-open { display: block; }
@media (min-width: 901px) {
  .site-header--compact .main-nav {
    inset-inline: auto max(16px, calc((100% - var(--container)) / 2 + 24px));
    min-width: 260px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 24px rgba(28, 31, 74, 0.12);
  }
}
.site-header--compact .main-nav ul { flex-direction: column; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; margin-inline-start: auto; }
  .main-nav {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; }
  .site-logo__text { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn--primary { background: var(--gold); color: var(--navy); }
.btn--primary:hover { background: var(--gold-light); color: var(--navy); }
.btn--outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn--outline:hover { background: var(--navy); color: #fff; }
.btn--light { background: #fff; color: var(--navy); }
.btn--light:hover { background: var(--tint); color: var(--navy); }

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  background: var(--navy); color: #fff;
  padding-block: clamp(48px, 9vw, 112px);
}
.hero::after {
  /* a thin band of the brand palette, like woven trim */
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, var(--gold) 0 40%, var(--cyan) 40% 60%, var(--blue) 60% 80%, var(--gray) 80% 100%);
}
.hero__grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .hero__grid { grid-template-columns: 1.2fr 1fr; } }
.hero h1 { color: #fff; }
.hero__text { font-size: 1.15rem; color: rgba(255, 255, 255, 0.85); max-width: 40em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero__image img { border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }
.hero__image .hero__logo { max-width: 380px; margin-inline: auto; box-shadow: none; border-radius: 0; }
@media (max-width: 859px) { .hero__image .hero__logo { max-width: 240px; } }

/* ---------- Sections ---------- */

.section { padding-block: clamp(40px, 7vw, 80px); }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section__head h2 { margin: 0; }
.eyebrow { color: var(--gold-text); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; margin-bottom: 6px; }

.page-header { padding-block: clamp(32px, 6vw, 64px) 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.page-header .lead { font-size: 1.1rem; color: var(--text-muted); max-width: 46em; margin: 0; }
.page-cover img { width: 100%; max-height: 420px; object-fit: cover; }

.prose { max-width: 46em; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose blockquote { margin: 1.5em 0; }

/* ---------- Cards and grids ---------- */

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }

.principles { list-style: none; padding: 0; margin: 0;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
/* Each principle has its WFTO colour (set in the admin, or by number) */
.principle {
  --principle-colour: var(--gold);
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 4px solid var(--principle-colour);
  padding: 20px; box-shadow: var(--shadow);
}
.principle__icon {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 16px;
  display: grid; place-items: center;
}
.principle__icon--image { padding: 8px; }
.principle__icon img { width: 100%; height: 100%; object-fit: contain; }
.principle__body { min-width: 0; }
.principle__number { margin: 0 0 2px; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.principle h3 { margin-bottom: 0.3em; }
.principle p { margin: 0; color: var(--text-muted); }
.principle p.principle__number { margin-bottom: 2px; }

.quote {
  border-inline-start: 4px solid var(--gold); background: var(--tint);
  padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 1.1rem;
}
html[dir="rtl"] .quote { border-radius: var(--radius) 0 0 var(--radius); }
.quote footer { font-size: 0.9rem; color: var(--text-muted); margin-top: 8px; }

figure { margin: 1.5em 0; }
figcaption { font-size: 0.9rem; color: var(--text-muted); margin-top: 6px; }
figure img { border-radius: var(--radius); }

.doc-link {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none;
}
.doc-link small { color: var(--text-muted); }

.cta-band {
  background: var(--navy); color: #fff; border-inline-start: 6px solid var(--gold); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px); display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.cta-band h2 { margin: 0 0 0.3em; color: #fff; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, 0.85); }
.cta-band .btn--outline { border-color: #fff; color: #fff; }
.cta-band .btn--outline:hover { background: #fff; color: var(--navy); }
.cta-band a:not(.btn) { color: #fff; }

/* ---------- Forms ---------- */

.form { max-width: 720px; }
.form-row { margin-bottom: 18px; }
.form label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--navy); }
.form input[type="text"], .form input[type="email"], .form input[type="tel"], .form input[type="url"],
.form input[type="number"], .form select, .form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--field-border); border-radius: 10px;
  background: #fff; font: inherit; color: var(--text);
}
.form textarea { min-height: 120px; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(207, 157, 43, 0.3); }
.form .helptext { font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: #b42318; font-size: 0.9rem; }

.messages { list-style: none; padding: 0; margin: 16px 0; }
.messages li { padding: 12px 16px; border-radius: 10px; background: #e8f5ee; border: 1px solid #b7dfc7; }
.messages li.error { background: #fdecea; border-color: #f5c2bd; }

/* ---------- Membership ---------- */

.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.subnav a {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--navy); font-size: 0.95rem; background: var(--bg);
}
.subnav a:hover { background: var(--tint); border-color: var(--tint-line); }
.subnav a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.member-type { display: flex; flex-direction: column; gap: 12px; }
.member-type p { color: var(--text-muted); margin: 0; }
.member-type .btn { margin-top: auto; }
.fee-list { margin: 0; display: grid; gap: 6px; }
.fee-list > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.fee-list dt { color: var(--text-muted); }
.fee-list dd { margin: 0; font-weight: 700; color: var(--navy); text-align: end; white-space: nowrap; }
.member-type .btn { align-self: flex-start; }
html[lang="fa"] .prose ol { list-style-type: persian; }
.fees-note { margin-top: 20px; color: var(--text-muted); }
.muted { color: var(--text-muted); font-weight: 400; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.step {
  counter-increment: step; position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; padding-top: 56px;
}
.step::before {
  content: counter(step, persian); position: absolute; inset-inline-start: 20px; top: 16px;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 700;
}
html[lang="en"] .step::before { content: counter(step); }
.step h3 { margin-bottom: 0.3em; }
.step p { margin: 0; color: var(--text-muted); }

.notice { padding: 14px 18px; border-radius: 10px; background: var(--tint); border: 1px solid var(--tint-line); border-inline-start: 4px solid var(--gold); margin-bottom: 20px; }
.notice p:last-child { margin: 0; }
.notice--error { background: #fdecea; border-color: #f5c2bd; border-inline-start-color: #b42318; }
.notice--ok { background: #e8f5ee; border-color: #b7dfc7; border-inline-start-color: #2f855a; }

.application-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; margin: 0 0 24px; }
.application-form legend { font-weight: 700; color: var(--navy); padding-inline: 8px; }
.form-cols { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .form-cols { grid-template-columns: 1fr 1fr; } }
.form input[type="file"] { display: block; max-width: 100%; }
.form input[type="date"] { padding: 10px 12px; border: 1px solid var(--field-border); border-radius: 10px; font: inherit; }
.form-row--check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); }
.form-row--check input { margin-top: 0.45em; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--navy); }
.form .req { color: #b42318; }
.has-error input, .has-error select, .has-error textarea { border-color: #b42318; }
.commitment { background: var(--tint); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bank-details { display: grid; gap: 8px; margin: 0 0 18px; padding: 14px 16px; border: 1px dashed var(--gold); border-radius: 10px; }
.bank-details > div { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.bank-details dt { color: var(--text-muted); min-width: 7em; }
.bank-details dd { margin: 0; font-weight: 700; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.04em; }

.tracking-code { display: inline-flex; flex-direction: column; gap: 4px; padding: 16px 24px; margin-bottom: 20px;
  background: var(--navy); color: #fff; border-radius: var(--radius); }
.tracking-code strong { font-size: 1.6rem; letter-spacing: 0.08em; color: var(--gold); }

.track-card { max-width: 760px; }
.track-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.track-card__head h2 { margin: 0; }
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--tint); color: var(--navy); font-weight: 700; font-size: 0.9rem; }
.status-badge--rejected, .status-badge--not_accepted, .status-badge--withdrawn { background: #fdecea; color: #8a1c12; }
.status-badge--member, .status-badge--approved { background: #e8f5ee; color: #14532d; }
.status-badge--incomplete, .status-badge--fix_requested { background: var(--gold-soft); color: var(--gold-text); }
.timeline { list-style: none; padding: 0; margin: 0 0 20px; border-inline-start: 2px solid var(--line); }
.timeline li { padding-inline-start: 16px; margin-bottom: 12px; }
.timeline p { margin: 0; }
.track-card h3 { margin-top: 24px; }
.linklike { background: none; border: 0; padding: 0; color: var(--navy); text-decoration-color: var(--gold); text-decoration: underline; cursor: pointer; font: inherit; }
.track-logout { margin-top: 16px; }

.form--inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 24px; }
.form--inline .form-row { margin: 0; flex: 1 1 240px; }
.cert-result { max-width: 640px; border-inline-start: 6px solid var(--gray); }
.cert-result--valid { border-inline-start-color: #2f855a; }
.cert-result--invalid { border-inline-start-color: #b42318; }
.cert-result__state { font-weight: 700; font-size: 1.15rem; color: var(--navy); }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy); color: rgba(255, 255, 255, 0.8); padding-block: 48px 24px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--gold); }
.site-footer__grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h2 { color: var(--gold); font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer__logo img { height: 64px; width: auto; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.15); margin-top: 32px; padding-top: 16px; font-size: 0.875rem;
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.site-footer__legal { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer__badges { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.site-footer__badges img { background: #fff; border-radius: 8px; padding: 4px; }
.social { display: flex; gap: 12px; flex-wrap: wrap; }

.empty { color: var(--text-muted); padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- News, events and articles ---------- */

.grid--news { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.news-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.news-card__image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.news-card__body { padding: 18px 20px 20px; }
.news-card h3 a { color: var(--navy); text-decoration: none; }
.news-card h3 a:hover { color: var(--gold-text); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 8px; }
.news-event-line { font-size: 0.9rem; color: var(--cyan-text); font-weight: 500; }
.tag {
  display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  background: var(--gold-soft); color: var(--gold-text); text-decoration: none;
}
.tag--event { background: #e3f7f6; color: var(--cyan-text); }
.tag--article { background: var(--tint); color: var(--navy); }

.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter-tabs a {
  padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--navy); text-decoration: none; font-weight: 500;
}
.filter-tabs a[aria-current] { background: var(--navy); border-color: var(--navy); color: #fff; }

.upcoming { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--cyan); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 28px; }
.upcoming h2 { font-size: 1.1rem; margin-bottom: 8px; }
.upcoming__list { list-style: none; margin: 0; padding: 0; }
.upcoming__list li { padding-block: 6px; border-top: 1px solid var(--line); }
.upcoming__list li:first-child { border-top: 0; }
.upcoming__list span { display: block; font-size: 0.875rem; color: var(--text-muted); }

.event-box {
  display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; max-width: 46em;
  background: var(--tint); border: 1px solid var(--tint-line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 28px;
}
.event-box dt { font-size: 0.8rem; color: var(--text-muted); }
.event-box dd { margin: 0; font-weight: 700; color: var(--navy); }
.event-box .btn { margin-inline-start: auto; }
.event-box__note { margin: 0; color: var(--text-muted); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.back-link { margin-top: 32px; }

/* ---------- Documents archive ---------- */

.doc-section { margin-bottom: 40px; }
.doc-section__desc { color: var(--text-muted); max-width: 46em; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.doc-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.doc-item__link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); font-weight: 500; }
.doc-item__link:hover .doc-item__title { color: var(--gold-text); text-decoration: underline; }
.doc-item__ext {
  flex-shrink: 0; min-width: 48px; text-align: center; padding: 2px 6px; border-radius: 6px;
  background: var(--navy); color: #fff; font-size: 0.75rem; font-weight: 700; font-family: var(--font-en);
}
.doc-item__meta { margin: 6px 0 0; font-size: 0.875rem; color: var(--text-muted); padding-inline-start: 60px; }
.doc-section--locked h2::after { content: " 🔒"; font-size: 0.8em; }
.locked-note { padding: 14px 18px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--text-muted); }

/* ---------- Contact and complaint forms ---------- */

.contact-layout { display: grid; gap: 32px; }
@media (min-width: 900px) { .contact-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.contact-aside { display: grid; gap: 20px; }
.contact-aside h2 { font-size: 1.1rem; }
.card--note { background: var(--tint); border-color: var(--tint-line); box-shadow: none; }
.contact-details { margin: 0; }
.contact-details dt { font-size: 0.85rem; color: var(--text-muted); }
.contact-details dd { margin: 0 0 10px; }
.form input[type="file"] { font: inherit; max-width: 100%; }
/* Persian «انتخاب فایل» button for file fields (static/js/file-input.js) */
.ft-file { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; position: relative; max-width: 100%; }
.ft-file__button {
  padding: 8px 18px; border: 1px solid var(--field-border); border-radius: 10px; background: #fff;
  color: var(--navy); font: inherit; font-weight: 700; cursor: pointer;
}
.ft-file__button:hover, .ft-file__button:focus-visible { border-color: var(--gold); }
.ft-file__name { color: var(--text-muted); overflow-wrap: anywhere; }
.ft-file__input { position: absolute; inset-inline-start: 0; inset-block-end: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.form input[type="date"], .form input[type="datetime-local"] {
  padding: 10px 12px; border: 1px solid var(--field-border); border-radius: 10px; font: inherit;
}
.form-row--check { display: flex; gap: 8px; align-items: baseline; }
.form-row--check label { display: inline; margin: 0; }
.form .req { color: #b42318; }
.hp-field { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tracking-code { font-size: 1.2rem; }
.tracking-code strong { font-family: var(--font-en); letter-spacing: 0.1em; background: rgba(255, 255, 255, 0.08); padding: 2px 10px; border-radius: 6px; }
.form input[type="email"], .form input[type="url"], .form input[type="tel"] { direction: ltr; }
/* ---------- Members and shop ---------- */

.muted { color: var(--text-muted); }
.lead { font-size: 1.1rem; color: var(--text-muted); }
.h3 { font-size: 1.1rem; }
.breadcrumb { font-size: 0.9rem; margin-bottom: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); }

.grid--cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--products { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 479px) { .grid--products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.placeholder {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: var(--navy);
  color: var(--gold); font-size: 2.6rem; font-weight: 700;
}
.placeholder--large { aspect-ratio: 1; font-size: 5rem; border-radius: var(--radius); }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.badges:empty { display: none; }
.badge {
  display: inline-block; font-size: 0.8rem; font-weight: 500; line-height: 1.6;
  padding: 2px 10px; border-radius: 999px; background: #eef0ef; color: var(--text-muted);
}
.badge--gold { background: var(--gold); color: var(--navy); }

.member-card, .product-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.member-card__media, .product-card__media { position: relative; display: block; background: var(--tint); }
.member-card__media { aspect-ratio: 8 / 5; }
.product-card__media { aspect-ratio: 1; }
.member-card__media img, .product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.member-card__logo {
  position: absolute; inset-inline-start: 14px; bottom: -24px;
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: #fff; border: 3px solid #fff; box-shadow: var(--shadow); display: grid; place-items: center;
}
.member-card__logo img { width: 100%; height: 100%; object-fit: contain; }
.member-card__body, .product-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.member-card__logo + .member-card__body, .member-card__media:has(.member-card__logo) + .member-card__body { padding-top: 32px; }
.member-card h3, .product-card h3 { margin: 0; font-size: 1.1rem; }
.member-card h3 a, .product-card h3 a { color: var(--navy); text-decoration: none; }
.member-card h3 a:hover, .product-card h3 a:hover { color: var(--gold-text); }
.member-card p { margin: 0; }
.member-card__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.875rem; color: var(--gold-text); font-weight: 500; margin: 0 0 4px; }
.member-card__meta span + span::before { content: "·"; margin-inline-end: 12px; color: var(--gray); }
.product-card h3 { font-size: 1rem; }
.product-card__maker { font-size: 0.875rem; color: var(--text-muted); margin: 0; }
.product-card__flag {
  position: absolute; top: 10px; inset-inline-start: 10px;
  background: rgba(28, 31, 74, 0.85); color: #fff; font-size: 0.8rem; padding: 2px 10px; border-radius: 999px;
}
.price { margin: auto 0 0; color: var(--navy); }
.price small { color: var(--text-muted); }

/* filters */
.filters {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 20px;
}
.filters__field { display: flex; flex-direction: column; gap: 4px; min-width: 160px; flex: 1 1 160px; }
.filters__field--grow { flex: 2 1 220px; }
.filters__field--check { flex: 0 0 auto; min-width: 0; justify-content: center; }
.filters__field--check label { display: flex; gap: 6px; align-items: center; font-weight: 400; color: var(--text); padding-block: 10px; }
.filters label { font-size: 0.875rem; font-weight: 500; color: var(--navy); }
.filters input[type="search"], .filters select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--field-border); border-radius: 10px; background: #fff; font: inherit; color: var(--text);
}
.filters__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters .btn { padding-block: 8px; }
.result-count { color: var(--text-muted); font-size: 0.9rem; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chips a {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--navy); text-decoration: none; font-size: 0.95rem;
}
.chips a:hover { border-color: var(--gold); }
.chips a[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.pagination a { padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--surface); }

/* member profile */
.profile-header__inner { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.profile-header__logo {
  width: 120px; height: 120px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: #fff; border: 1px solid var(--line); display: grid; place-items: center; padding: 8px;
}
.profile-header__logo img { max-height: 100%; object-fit: contain; }
.profile-header h1 { margin-bottom: 0.2em; }
.profile { display: grid; gap: 32px; align-items: start; }
@media (min-width: 860px) { .profile { grid-template-columns: minmax(0, 1fr) 300px; } }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding-block: 6px; border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: 0; }

/* product page */
.product { display: grid; gap: 32px; align-items: start; }
@media (min-width: 860px) { .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; } }
.product__gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.product__gallery figure { margin: 0; }
.product__main { grid-column: 1 / -1; }
.product__main img, .product__thumb img { border-radius: var(--radius); width: 100%; }
.product__info h1 { margin-bottom: 0.2em; }
.product__info .price { font-size: 1.25rem; margin: 12px 0; }
.buy-box { margin: 20px 0 28px; padding: 18px; border-radius: var(--radius); background: var(--tint); border: 1px solid var(--tint-line); border-inline-start: 4px solid var(--gold); }
.buy-box .muted { margin: 10px 0 0; font-size: 0.9rem; }
.btn--large { padding: 12px 28px; font-size: 1.05rem; }
@media (max-width: 479px) { .btn--large { width: 100%; } }
@media (max-width: 479px) { .member-card__media { aspect-ratio: 16 / 7; } }

/* ---------- Member panel ---------- */

.panel-link {
  font-size: 0.9rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  color: var(--navy); background: var(--gold); border-radius: 999px; padding: 4px 12px;
}
.panel-link:hover { background: var(--gold-light); color: var(--navy); }
.panel-nav { margin: 16px 0 0; align-items: center; }
/* «بیشتر» and «حساب من» folds of the member panel menu (memberpanel/base.html) */
.panel-nav__more { position: relative; }
.panel-nav__account { margin-inline-start: auto; }
.panel-nav__more summary {
  list-style: none; cursor: pointer; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--navy); font-weight: 500;
}
.panel-nav__more summary::-webkit-details-marker { display: none; }
.panel-nav__more summary::after { content: "▾"; margin-inline-start: 6px; font-size: 0.8em; }
.panel-nav__more[open] summary::after { content: "▴"; }
.panel-nav__more summary.is-current { background: var(--navy); border-color: var(--navy); color: #fff; }
.panel-nav__menu {
  position: absolute; z-index: 20; inset-block-start: calc(100% + 6px); inset-inline-start: 0; min-width: 17.5rem;
  display: flex; flex-direction: column; padding: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel-nav__account .panel-nav__menu { inset-inline-start: auto; inset-inline-end: 0; }
.filter-tabs .panel-nav__menu a, .panel-nav__menu .linklike {
  display: block; padding: 8px 12px; border: 0; border-radius: 8px; background: none; text-align: start; width: 100%;
  color: var(--navy); text-decoration: none; font-weight: 500;
}
.filter-tabs .panel-nav__menu a:hover, .panel-nav__menu .linklike:hover { background: var(--tint); }
.filter-tabs .panel-nav__menu a[aria-current] { background: var(--navy); color: #fff; }
.panel-nav__menu form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
@media (max-width: 600px) {
  .panel-nav__menu { position: static; margin-top: 6px; box-shadow: none; }
  .panel-nav__more[open] { flex-basis: 100%; }
  .panel-nav__account { margin-inline-start: 0; }
}
.panel-layout { display: grid; gap: 32px; }
@media (min-width: 1000px) { .panel-layout { grid-template-columns: minmax(0, 720px) minmax(0, 1fr); align-items: start; } }
.panel-help { font-size: 0.95rem; }
.panel-auth { max-width: 480px; }
.panel-fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 20px 4px; margin: 0 0 24px; min-width: 0; }
.panel-fieldset legend { font-weight: 700; color: var(--navy); padding-inline: 6px; }
.panel-form input[type="password"], .panel-auth input[type="password"], .panel-auth input[type="text"], .panel-auth input[type="tel"] { width: 100%; }
.panel-auth__alt { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.panel-auth .form input[type="password"] {
  padding: 10px 12px; border: 1px solid var(--field-border); border-radius: 10px; font: inherit; background: #fff;
}
.panel-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin: 16px 0 0; }
.panel-delete { margin-inline-start: auto; color: #b42318; }
.panel-delete-btn { background: #b42318; color: #fff; }
.panel-delete-btn:hover { background: #8a1c12; color: #fff; }

.panel-members { margin-top: 24px; }
.panel-member__head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.panel-member__head h2 { margin: 0 0 4px; }
.panel-member__logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; font-size: 1.6rem; }
.panel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 8px; text-align: center; }
.panel-stats div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; }
.panel-stats dt { font-size: 0.8rem; color: var(--text-muted); }
.panel-stats dd { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--navy); }
.badge--ok { background: #e8f5ee; color: #14532d; }

.panel-products { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.panel-product {
  display: flex; gap: 16px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.panel-product__media { width: 72px; height: 72px; flex-shrink: 0; border-radius: 10px; overflow: hidden; display: block; }
.panel-product__media img { width: 100%; height: 100%; object-fit: cover; }
.panel-product__media .placeholder { font-size: 1.6rem; }
.panel-product__body { flex: 1; min-width: 0; }
.panel-product__body h2 { margin: 0 0 4px; }
.panel-product__body h2 a { color: var(--navy); text-decoration: none; }
.panel-product__body p { margin: 0; }
@media (max-width: 479px) { .panel-product { flex-wrap: wrap; } .panel-product .btn { width: 100%; text-align: center; } }

.panel-current-images, .panel-images { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 16px; padding: 0; list-style: none; }
.panel-current-images figure, .panel-images figure { margin: 0; }
.panel-current-images img, .panel-images img { border-radius: 10px; display: block; }
.panel-current-images .placeholder { width: 120px; height: 120px; border-radius: 10px; font-size: 2rem; }
.panel-current-images figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.panel-images label { font-weight: 400; margin-top: 6px; }
@media (max-width: 600px) { .site-header .panel-link { padding: 4px 10px; font-size: 0.85rem; } }

/* ---------- Member panel: membership status and annual fees ---------- */
.badge--error { background: #fdecea; color: #8a1c12; }
.standing-status { margin-bottom: 24px; }
.standing-status h2 { margin: 0 0 8px; }
.standing-status--inactive { border-color: #f5c2bd; background: #fffafa; }
.standing-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 12px 0 0; }
.standing-facts dt { font-size: 0.8rem; color: var(--text-muted); }
.standing-facts dd { margin: 0; font-weight: 700; color: var(--navy); }
.standing-section { margin: 0 0 32px; }
.table-scroll { overflow-x: auto; }
.standing-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.standing-table th, .standing-table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
.standing-table th { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.standing-table .badge { white-space: nowrap; }
.standing-overdue { display: block; color: #b42318; font-weight: 700; margin-top: 4px; }
.standing-msg { margin: 6px 0 0; font-size: 0.9rem; }
.standing-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.standing-history li { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 16px; }
.standing-history p { margin: 0 0 4px; }
.panel-dues { margin: 8px 0 0; }
/* ---------- Member panel: membership file, complaints, appeals ---------- */
.panel-actions--minor { margin-top: 8px; font-size: 0.95rem; }
.panel-file-block { margin-top: 24px; }
.panel-cases { list-style: none; margin: 16px 0 32px; padding: 0; display: grid; gap: 12px; }
.panel-case .fee-list { margin: 8px 0 0; }
.panel-case__answer { margin-top: 12px; padding: 12px 16px; border-inline-start: 4px solid var(--gold); background: var(--tint); border-radius: 8px; }
.panel-case__answer p { margin: 4px 0 0; }
.status-badge--appeal-overturned, .status-badge--complaint-resolved { background: #e8f5ee; color: #14532d; }
.status-badge--appeal-upheld, .status-badge--appeal-dismissed, .status-badge--complaint-dismissed { background: #fdecea; color: #8a1c12; }
.status-badge--complaint-needs_info { background: var(--gold-soft); color: var(--gold-text); }
.panel-actions + h2 { margin-top: 32px; }
.panel-subhead { font-size: 1rem; margin: 20px 0 8px; }
.standing-section .cert-result { max-width: none; }

/* ---- General Assembly (member panel) ---- */
.assembly { display: grid; gap: 20px; align-content: start; }
.assembly-head .fee-list { margin: 8px 0 12px; }
.assembly-head .panel-actions { margin-bottom: 16px; }
.fee-list dd.wrap { white-space: normal; }
.assembly-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: agenda; }
.assembly-item { counter-increment: agenda; }
.assembly-item h3 { margin: 0; }
.assembly-item h3::before { content: counter(agenda) ". "; color: var(--gold); }
[dir="rtl"] .assembly-item h3::before { content: counter(agenda, persian) ". "; }
.assembly-state { margin: 12px 0; color: var(--text-muted); }
.assembly-state--open { color: #14532d; font-weight: 700; }
.ballot { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.ballot fieldset { border: 0; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.ballot legend { font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.ballot__choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.ballot__choice:has(input:checked) { border-color: var(--gold); background: var(--tint); }
.ballot__choice input { margin-block-start: 4px; }
.assembly-result { margin-top: 12px; padding: 12px 16px; border-inline-start: 4px solid var(--gold); background: var(--tint); border-radius: 8px; overflow-x: auto; }
.result-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.result-table th, .result-table td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.result-table .is-elected td { font-weight: 700; color: var(--gold-text); }
.status-badge--assembly-in_session { background: #e8f5ee; color: #14532d; }
.status-badge--assembly-ended { background: var(--tint); color: var(--navy); }
.panel-assembly p { margin: 0 0 4px; }


/* ---- Cart, checkout and orders (shop app) ---- */
.container--narrow { max-width: 760px; }
.cart-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; text-decoration: none; color: var(--navy);
  border: 1px solid var(--gold); border-radius: 999px; padding-block: 4px; padding-inline: 12px 6px; font-weight: 500; white-space: nowrap;
}
.cart-link:hover { background: var(--tint); }
.cart-link__count { background: var(--gold); color: var(--navy); border-radius: 999px; min-width: 1.6em; padding: 0 6px; text-align: center; font-weight: 700; }
.cart-add__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.cart-add__qty { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--text-muted); }
.cart-add__qty input { width: 5.5em; padding: 10px 12px; border: 1px solid var(--field-border); border-radius: 10px; font: inherit; background: #fff; }
.cart-add__alt { margin: 8px 0 0; font-size: 0.9rem; }
.cart-group { margin-bottom: 20px; }
.cart-group__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.cart-group__ship { margin: 10px 0 0; font-size: 0.9rem; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 10px 8px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-table th { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.cart-table .num { text-align: end; white-space: nowrap; }
.cart-table tfoot td { border-bottom: 0; padding-block: 6px; color: var(--text-muted); }
.cart-table__total td { color: var(--navy); font-weight: 700; border-top: 1px solid var(--line); }
.cart-qty { width: 4.5em; padding: 6px 8px; border: 1px solid var(--field-border); border-radius: 8px; font: inherit; }
.cart-remove { display: block; margin-top: 4px; margin-inline-start: auto; font-size: 0.85rem; }
.cart-summary { border-top: 2px solid var(--line); padding-top: 16px; }
.cart-summary__total { display: flex; justify-content: space-between; gap: 12px; font-size: 1.15rem; margin: 0 0 8px; }
.cart-summary__total strong { color: var(--navy); }
.checkout { display: grid; gap: 32px; }
@media (min-width: 1000px) { .checkout { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: start; } }
.checkout__summary .cart-group { padding: 16px; }
.checkout__summary .cart-table { font-size: 0.92rem; }
.checkout__terms { margin-bottom: 16px; font-size: 0.92rem; }
.pay-online { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; border-inline-start: 4px solid var(--gold); }
.pay-online h2 { margin: 0 0 4px; }
.pay-online p { margin: 0; }
.order-card { margin-bottom: 24px; }
.order-card__head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.order-card__head h2 { margin: 0; }
.order-pay { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.order-pay .bank-details { margin-bottom: 12px; }
.order-pay__form summary, .order-history summary { cursor: pointer; color: var(--navy); font-weight: 500; margin-block: 8px; }
.order-pay__form .form { margin-top: 12px; }
.order-history { margin-top: 12px; }
.order-buyer { max-width: 560px; margin-bottom: 24px; }
.fee-list dd.wrap, .fee-list--wrap dd { white-space: normal; }
.panel-case { margin-bottom: 20px; }
@media (max-width: 640px) {
  .cart-link { padding-inline: 10px 4px; }
}
@media (max-width: 440px) {
  .site-header__inner { gap: 8px; }
  .site-logo img { height: 40px; }
  .header-actions { gap: 4px; }
  .cart-link { padding: 4px; }
  .cart-link__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .lang-switch { padding-inline: 8px; }
}
@media (max-width: 400px) {
  .lang-switch__long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .lang-switch__short { display: inline; }
  .pay-online .btn { width: 100%; }
}
/* ---------- Wholesale catalogue and enquiries ---------- */
.wh-steps { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 20px 0 0; padding-inline-start: 1.2em; color: var(--navy); }
.wh-steps li { padding-inline-start: 4px; }
.wh-steps li::marker { color: var(--gold-dark); font-weight: 700; }
.form--wide { max-width: none; }
.wh-form h2 { margin-top: 0; }
.wh-errors { margin: 0; padding-inline-start: 1.2em; }
.wh-producer { margin: 0 0 16px; padding: 16px 20px; min-width: 0; }
.wh-producer__name { float: inline-start; width: 100%; padding: 0; margin-bottom: 4px; font-weight: 700; font-size: 1.1rem; }
.wh-producer__name a { color: var(--navy); }  /* underlined: the name sits next to plain text */
.wh-producer__summary { clear: both; margin: 0 0 8px; font-size: 0.95rem; }
.wh-items { clear: both; list-style: none; margin: 0; padding: 0; }
.wh-item {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 8px; border-top: 1px solid var(--line); border-radius: 8px; scroll-margin-top: 120px;
}
.wh-item.is-selected, .wh-item.is-chosen { background: var(--tint); }
.wh-item.has-error { background: #fdecea; }
.wh-item__thumb { width: 56px; height: 56px; }
.wh-item__thumb img, .wh-item__thumb .placeholder { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; font-size: 1.4rem; }
.wh-item__name { font-weight: 500; color: var(--navy); text-decoration: none; }
.wh-item__name:hover { text-decoration: underline; }
.wh-item__text .muted { margin: 2px 0 0; font-size: 0.9rem; }
.wh-item__text .badge { margin-top: 4px; }
.wh-item__qty { display: flex; gap: 6px; align-items: center; }
.form .wh-item__qty input.wh-qty { width: 88px; text-align: center; }
.form .wh-item__qty select { width: auto; min-width: 96px; }
@media (max-width: 559px) {
  .wh-item { grid-template-columns: 48px minmax(0, 1fr); }
  .wh-item__thumb, .wh-item__thumb img, .wh-item__thumb .placeholder { width: 48px; height: 48px; }
  .wh-item__qty { grid-column: 1 / -1; }
  .form .wh-item__qty input.wh-qty, .form .wh-item__qty select { flex: 1 1 0; width: auto; min-width: 0; }
}
.wh-details { margin-top: 32px; }
.form-grid { display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-row--wide { grid-column: 1 / -1; }
.wh-submit { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 12px; }
.wh-cta { margin: 12px 0 0; }
.wh-lines { margin: 8px 0 12px; padding-inline-start: 1.2em; }
.wh-lines li { margin-bottom: 2px; }
.wh-buyer dd { white-space: normal; overflow-wrap: anywhere; }
.status-badge--wh-new { background: var(--gold-soft); color: var(--gold-text); }
.status-badge--wh-quoted { background: #e8f5ee; color: #14532d; }
.status-badge--wh-declined { background: #fdecea; color: #8a1c12; }
.form div[id$="status"] > div { margin-bottom: 4px; }
.form div[id$="status"] label { font-weight: 400; display: flex; gap: 8px; align-items: center; }

/* Shipping method choice at checkout */
.shipping-choice { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }
.shipping-choice legend { font-weight: 500; color: var(--navy); padding-inline: 4px; }
.form .shipping-choice__option { display: flex; gap: 10px; align-items: baseline; font-weight: 400; color: inherit; margin: 6px 0; cursor: pointer; }
.shipping-choice__option input { flex: none; }

/* Printable invoice (shop/invoice.html) */
.invoice-page { background: var(--bg); }
.invoice-tools { display: flex; gap: 12px; justify-content: flex-end; max-width: 860px; margin: 24px auto 0; padding-inline: 16px; flex-wrap: wrap; }
.invoice { max-width: 860px; margin: 16px auto 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.invoice h1 { margin: 0; color: var(--navy); font-size: 1.6rem; }
.invoice h2 { font-size: 1rem; color: var(--navy); margin: 0 0 6px; }
.invoice__head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 2px solid var(--gold); padding-bottom: 16px; }
.invoice__brand { margin: 4px 0 0; color: var(--text-muted); }
.invoice__meta { display: grid; gap: 4px; margin: 0; }
.invoice__meta div { display: flex; gap: 8px; }
.invoice__meta dt { color: var(--text-muted); min-width: 6.5em; }
.invoice__meta dd { margin: 0; font-weight: 500; }
.invoice__parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 20px 0; }
.invoice__parties p { margin: 0 0 4px; }
.invoice__items { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.invoice__items th, .invoice__items td { border-bottom: 1px solid var(--line); padding: 8px; text-align: start; }
.invoice__items .num { text-align: end; white-space: nowrap; }
.invoice__items thead th { background: var(--tint); }
.invoice__total td { font-weight: 700; font-size: 1.05rem; border-bottom: 0; }
.invoice__payment { margin-top: 16px; }
.invoice__foot { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--text-muted); }
@media (max-width: 640px) {
  .invoice { padding: 18px; border-radius: 0; }
  .invoice__parties { grid-template-columns: 1fr; }
  .invoice__items { font-size: 0.875rem; }
  .invoice__items th, .invoice__items td { padding: 6px 4px; }
  .invoice__items thead th.num { white-space: normal; }
}
@media print {
  .no-print, .site-header, .site-footer { display: none !important; }
  .invoice-page { background: #fff; }
  .invoice { border: 0; margin: 0; padding: 0; max-width: none; }
}

/* Phone version (PWA): install suggestion and offline notice — core/templates/core/pwa/body.html */
.install-banner {
  position: fixed;
  inset-inline: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 90;
  max-width: 560px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(26, 28, 70, 0.18);
}
.install-banner[hidden], .offline-note[hidden], .install-banner [hidden] { display: none; }
.install-banner__text { flex: 1 1 220px; margin: 0; font-size: .95rem; line-height: 1.7; }
.install-banner__actions { display: flex; gap: 8px; }
.install-banner__actions .btn { padding: 8px 18px; }
.offline-note {
  background: var(--navy);
  color: #fff;
  text-align: center;
  font-size: .875rem;
  padding: 6px 12px;
}
@media print { .install-banner, .offline-note { display: none !important; } }
