﻿/* ---------------------------------------------------------------------------
   TechPlast design tokens.

   Two layers. The palette below names colours; the semantic tokens under it name
   *roles* — surface, text, border — and only those are used by components. That is
   what makes dark mode a change of eleven values rather than a change everywhere,
   and it is why a component never reaches for --navy directly.

   Dark mode is not the light palette inverted. Inverting produces pure black behind
   pure white, which vibrates and hides elevation; these surfaces are lifted blues
   that keep the brand's temperature, with borders that gain contrast rather than
   lose it, and a brand colour lightened so it still reads against a dark ground.
   --------------------------------------------------------------------------- */
:root {
  /* Palette: raw colours, referenced only by the semantic tokens below. */
  --navy-900: #08121c;
  --navy-800: #0d1b2a;
  --navy-700: #10283f;
  --navy-600: #173b5a;
  --navy-500: #1f4d75;
  --orange-600: #c84e0d;
  --orange-500: #ef6c22;
  --orange-400: #ff8a44;
  --grey-50: #f7f9fa;
  --grey-100: #f3f6f8;
  --grey-200: #e6ecf0;
  --grey-300: #dce4e9;
  --grey-500: #657482;
  --white: #fff;

  --green-500: #0f7a4a;
  --green-100: #d8f4e6;
  --amber-500: #9a6100;
  --amber-100: #fff0c9;
  --red-500: #b3202a;
  --red-100: #fdeaec;
  --blue-500: #1e5f9e;
  --blue-100: #dceaf7;

  /* Semantic tokens: what components actually use. */
  --surface: var(--white);
  --surface-raised: var(--white);
  --surface-sunken: var(--grey-100);
  --surface-inverse: var(--navy-700);

  --text: var(--navy-800);
  --text-muted: var(--grey-500);
  --text-on-brand: var(--white);
  --text-on-inverse: var(--white);

  --border: var(--grey-300);
  --border-strong: #c3cfd7;

  --brand: var(--navy-700);
  --brand-hover: var(--navy-600);
  --accent: var(--orange-500);
  --accent-hover: var(--orange-600);
  --accent-text: var(--orange-600);

  --success: var(--green-500);
  --success-surface: var(--green-100);
  --warning: var(--amber-500);
  --warning-surface: var(--amber-100);
  --danger: var(--red-500);
  --danger-surface: var(--red-100);
  --info: var(--blue-500);
  --info-surface: var(--blue-100);

  --shadow: 0 18px 46px rgba(16, 40, 63, .1);
  --shadow-sm: 0 5px 15px rgba(10, 30, 45, .05);

  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 100px;

  /* Kept as aliases so existing rules keep working while components migrate. */
  --ink: var(--text);
  --navy: var(--brand);
  --navy-2: var(--brand-hover);
  --orange: var(--accent);
  --orange-dark: var(--accent-text);
  --paper: var(--surface);
  --mist: var(--surface-sunken);
  --line: var(--border);
  --muted: var(--text-muted);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --surface: #0e1822;
  --surface-raised: #16232f;
  --surface-sunken: #0a121a;
  --surface-inverse: #16232f;

  --text: #e8eef3;
  --text-muted: #9aabb8;
  --text-on-brand: #fff;
  --text-on-inverse: #e8eef3;

  /* Borders gain contrast in the dark rather than losing it; a light-mode hairline
     disappears entirely against a dark surface. */
  --border: #253544;
  --border-strong: #35495b;

  --brand: #16232f;
  --brand-hover: #1f3040;
  --accent: var(--orange-500);
  --accent-hover: var(--orange-400);
  /* The light-mode accent text is too dark to read on a dark ground. */
  --accent-text: var(--orange-400);

  --success: #4ecb8d;
  --success-surface: #10321f;
  --warning: #f0b429;
  --warning-surface: #33270a;
  --danger: #ff7b7b;
  --danger-surface: #3a1519;
  --info: #7cb6ee;
  --info-surface: #10263a;

  --shadow: 0 18px 46px rgba(0, 0, 0, .5);
  --shadow-sm: 0 5px 15px rgba(0, 0, 0, .35);

  color-scheme: dark;
}

/* No stored preference means the operating system decides. The guard keeps an explicit
   light choice winning over a dark system setting; without it, choosing light on a
   dark-mode machine would appear to do nothing. It also matches data-theme="" , which is
   what the server renders when nobody has chosen. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --surface: #0e1822;
  --surface-raised: #16232f;
  --surface-sunken: #0a121a;
  --surface-inverse: #16232f;

  --text: #e8eef3;
  --text-muted: #9aabb8;
  --text-on-brand: #fff;
  --text-on-inverse: #e8eef3;

  /* Borders gain contrast in the dark rather than losing it; a light-mode hairline
     disappears entirely against a dark surface. */
  --border: #253544;
  --border-strong: #35495b;

  --brand: #16232f;
  --brand-hover: #1f3040;
  --accent: var(--orange-500);
  --accent-hover: var(--orange-400);
  /* The light-mode accent text is too dark to read on a dark ground. */
  --accent-text: var(--orange-400);

  --success: #4ecb8d;
  --success-surface: #10321f;
  --warning: #f0b429;
  --warning-surface: #33270a;
  --danger: #ff7b7b;
  --danger-surface: #3a1519;
  --info: #7cb6ee;
  --info-surface: #10263a;

  --shadow: 0 18px 46px rgba(0, 0, 0, .5);
  --shadow-sm: 0 5px 15px rgba(0, 0, 0, .35);

  color-scheme: dark;
  }
}

html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--surface); font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.65; }
a { color: var(--navy-2); text-underline-offset: 3px; }
a:hover { color: var(--orange-dark); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.025em; font-weight: 750; }
h1 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
.container { width: min(1180px, calc(100% - 2rem)); }
.narrow { max-width: 760px; }
.skip-link { position: fixed; inset-inline-start: 1rem; top: -5rem; z-index: 9999; padding: .75rem 1rem; background: #fff; color: #000; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid #ffb27c !important; outline-offset: 3px; }

.site-header { position: relative; z-index: 100; background: var(--navy); border-bottom: 1px solid rgba(255,255,255,.1); }
.site-header .navbar { min-height: 78px; padding: .65rem 0; }
/* The logo is a dark mark on transparency, so it needs a light plate to stay legible on the
   navy header. Keeping the plate tight to the mark reads as a lockup rather than a sticker. */
.brand img { display: block; width: 132px; height: 46px; object-fit: contain; padding: 5px 12px; border-radius: 6px; background: #fff; }
.site-header .nav-link { color: rgba(255,255,255,.83); font-weight: 650; padding: .6rem .85rem !important; }
.site-header .nav-link:hover, .site-header .nav-link:focus { color: #fff; }
.site-header .nav-cta { color: #fff; background: var(--orange); border-radius: 8px; }
.language-form { margin-inline-start: .4rem; }
.theme-form { margin-inline-start: .2rem; }
.theme-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius-sm); background: transparent; color: #fff; font-size: 1.05rem; line-height: 1; }
.theme-button:hover, .theme-button:focus { background: rgba(255,255,255,.12); }
.language-button { border: 0; background: transparent; color: #fff; padding: .55rem .7rem; font-weight: 700; }

.hero-section { position: relative; overflow: hidden; min-height: 520px; display: grid; align-items: center; color: #fff; background: radial-gradient(circle at 80% 30%, rgba(239,108,34,.22), transparent 32%), linear-gradient(120deg, #0a1a29 0%, #153a59 100%); }
.hero-section::before { content: ""; position: absolute; inset: 0; opacity: .15; background-image: linear-gradient(30deg, transparent 49.5%, rgba(255,255,255,.25) 50%, transparent 50.5%); background-size: 70px 70px; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, .6fr); gap: clamp(2.5rem, 6vw, 5.5rem); align-items: center; padding-block: clamp(3.5rem, 7vw, 5rem); }
.hero-copy h1 { max-width: 900px; margin: .8rem 0 1.4rem; }
.hero-copy p { max-width: 700px; font-size: clamp(1.05rem, 2vw, 1.3rem); color: #dce9f2; }
.eyebrow { display: inline-block; color: #ffb37e; font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.dark { color: var(--orange-dark); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.btn { border-radius: 8px; padding: .65rem 1.15rem; font-weight: 700; }
.btn-brand { color: #fff; background: var(--orange); border-color: var(--orange); }
.btn-brand:hover, .btn-brand:focus { color: #fff; background: var(--orange-dark); border-color: var(--orange-dark); }
.hero-panel { display: grid; border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius); background: rgba(5,20,33,.4); backdrop-filter: blur(8px); }
.hero-panel div { display: grid; padding: 1.35rem 1.6rem; border-bottom: 1px solid rgba(255,255,255,.15); }
.hero-panel div:last-child { border: 0; }
.hero-panel strong { font-size: 2.1rem; color: #fff; }
.hero-panel span { color: #c4d5e1; }

.section { padding: clamp(4rem, 8vw, 7rem) 0; }
.page-hero + .section { padding-top: clamp(2.25rem, 4vw, 3.25rem); }
.section-muted { background: var(--mist); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2.5rem; }
.section-heading h2 { margin: .35rem 0 0; }
.section-heading > a { font-weight: 750; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.category-card { position: relative; min-height: 300px; overflow: hidden; border-radius: var(--radius); color: #fff; background: var(--navy); box-shadow: var(--shadow); text-decoration: none; }
.category-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(6,20,31,.92)); }
.category-card img { width: 100%; height: 300px; object-fit: cover; transition: transform .35s ease; }
.category-card:hover img { transform: scale(1.04); }
.category-card div { position: absolute; z-index: 1; inset-inline: 1.4rem; bottom: 1.2rem; }
.category-card h3 { margin: 0 0 .25rem; font-size: 1.35rem; }
.category-card span { color: #cedce6; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.product-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-raised); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.product-card:hover { transform: translateY(-5px); border-color: transparent; box-shadow: var(--shadow); }
/* The catalog photography is shot on a seamless beige sweep that is part of the JPEG. Letting
   it bleed to the card edge reads as a styled backdrop; object-fit: contain instead framed that
   backdrop as a second box inside the card. */
.product-image { position: relative; display: block; overflow: hidden; aspect-ratio: 1 / 1; background: var(--mist); }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.product-card:hover .product-image img { transform: scale(1.05); }
.product-body { display: flex; flex: 1; flex-direction: column; padding: 1.15rem 1.2rem 1.25rem; }
.product-category { color: var(--orange-dark); font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.product-body h3 { margin: .5rem 0 .9rem; font-size: 1.05rem; letter-spacing: -.01em; }
.product-body h3 a { color: var(--text); text-decoration: none; }
.product-body h3 a:hover { color: var(--orange-dark); }
.product-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; color: var(--muted); font-size: .76rem; }
.product-meta span { padding: .25rem .55rem; border: 1px solid var(--line); border-radius: 100px; }
/* The works' mould reference. Buyers quote it on orders, so it reads as an identifier rather
   than as another specification. */
.product-meta .product-code { border-color: transparent; background: var(--surface-sunken); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: -.02em; }
/* ---- Inquiry list (RFQ) ---- */
.nav-inquiry { position: relative; }
.inquiry-badge { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; margin-inline-start: .35rem; padding: 0 .35rem; border-radius: 100px; color: #fff; background: var(--orange); font-size: .72rem; font-weight: 800; }
.inquiry-add { margin-top: .9rem; }
.btn-inquiry { width: 100%; padding: .5rem .8rem; border: 1px solid var(--border); border-radius: 8px; color: var(--accent-text); background: var(--surface-raised); font-size: .85rem; font-weight: 750; }
.btn-inquiry:hover, .btn-inquiry:focus { color: #fff; border-color: var(--orange); background: var(--orange); }
.btn-outline-navy { border: 1px solid var(--navy-2); color: var(--navy-2); background: transparent; }
.btn-outline-navy:hover, .btn-outline-navy:focus { color: #fff; background: var(--navy-2); }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 2rem; }
.detail-inquiry { display: flex; gap: .6rem; margin: 0; }
.detail-inquiry .form-control { width: 7.5rem; }

.quote-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
.quote-lines { display: grid; gap: 1rem; }
.quote-line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 1.1rem; align-items: center; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-raised); }
.quote-line-image { display: block; overflow: hidden; width: 96px; height: 96px; border-radius: 10px; background: var(--mist); }
.quote-line-image img { width: 100%; height: 100%; object-fit: cover; }
.quote-line-body h3 { margin: .35rem 0 .55rem; font-size: 1.02rem; }
.quote-line-body h3 a { color: var(--text); text-decoration: none; }
.quote-line-actions { display: grid; justify-items: end; gap: .5rem; }
.quote-qty-form { display: flex; gap: .4rem; }
.quote-qty-form .form-control { width: 7rem; min-height: 40px; }
.link-button { padding: 0; border: 0; background: none; color: var(--muted); font-size: .85rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--danger); }
.quote-clear { justify-self: start; margin-top: .25rem; }
.quote-receipt { display: grid; gap: .3rem; margin-bottom: 2rem; padding: 1.5rem; border: 1px solid var(--line); border-inline-start: 4px solid var(--orange); border-radius: var(--radius); background: var(--surface-raised); }
.quote-receipt span { color: var(--muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.quote-receipt strong { font-size: 1.8rem; letter-spacing: -.01em; }
[dir="rtl"] .quote-receipt span { letter-spacing: normal; text-transform: none; }
.validation-summary ul { margin: 0; padding-inline-start: 1.1rem; }
.validation-summary:not(:empty) { margin-bottom: 1.2rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm); color: var(--danger); background: var(--danger-surface); }

.quote-items-heading { margin: 2.5rem 0 1rem; font-size: 1.4rem; }
.quote-delete { margin-top: 1.5rem; }

.cta-section { padding: 4.5rem 0; color: #fff; background: var(--orange-dark); }
.cta-grid { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.cta-grid h2 { max-width: 760px; margin: .4rem 0 0; }

.page-hero { padding: 4.5rem 0; color: #fff; background: linear-gradient(115deg, var(--navy), var(--navy-2)); }
.page-hero.compact { padding: 4.5rem 0; }
.page-hero h1 { margin: .6rem 0 1rem; font-size: clamp(2.2rem, 4vw, 3.4rem); }
.page-hero p { max-width: 720px; margin: 0; color: #d8e4ec; font-size: 1.15rem; }
.content-grid, .form-layout, .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); gap: clamp(2.5rem, 6vw, 6rem); }
.fact-panel, .form-card, .contact-details, .admin-detail { padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-raised); box-shadow: var(--shadow); }
.fact-panel dl { margin: 0; }
.fact-panel dt { color: var(--muted); font-size: .82rem; text-transform: uppercase; }
.fact-panel dd { margin: 0 0 1rem; font-size: 1.2rem; font-weight: 750; }
.form-card form, .admin-form { display: grid; gap: 1.1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-label, .admin-form label { margin: 0 0 .35rem; font-weight: 700; }
.form-control, .form-select { min-height: 46px; color: var(--text); background: var(--surface-raised); border-color: var(--border-strong); border-radius: 7px; }
.form-control:focus, .form-select:focus { color: var(--text); background: var(--surface-raised); border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(239,108,34,.2); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: auto; }
.field-validation-error { display: block; color: var(--danger); font-size: .85rem; }
.hp-field { position: absolute !important; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.filter-panel { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr) auto; gap: .85rem; align-items: end; padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--mist); }
.filter-panel label { display: block; margin-bottom: .25rem; font-size: .82rem; font-weight: 800; }
.result-summary { margin: 1.5rem 0; color: var(--muted); font-weight: 700; }
.empty-state { padding: 4rem 1.5rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); text-align: center; background: var(--surface-sunken); }
.pagination-wrap { display: flex; justify-content: center; margin-top: 2.5rem; }
.product-detail { min-height: 70vh; }
.detail-image { overflow: hidden; aspect-ratio: 1 / 1; border-radius: var(--radius); background: var(--mist); }
.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-grid h1 { margin: 1rem 0; font-size: clamp(2rem, 3.4vw, 3rem); }
.back-link { font-weight: 750; text-decoration: none; }
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 2rem 0; border-block: 1px solid var(--line); }
.spec-list div { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.spec-list dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; }
.spec-list dd { margin: .1rem 0 0; font-weight: 750; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.news-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-raised); }
.news-card > img { width: 100%; aspect-ratio: 1.55; object-fit: cover; }
.news-card > div { padding: 1.35rem; }
.news-card time, .article-page time { color: var(--orange-dark); font-size: .82rem; font-weight: 800; }
.news-card h2 { margin: .6rem 0; font-size: 1.35rem; }
.news-card h2 a { color: var(--text); text-decoration: none; }
.news-card p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; color: var(--muted); }
.article-page h1 { margin: .8rem 0 2rem; }
.article-image { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); }
.article-copy { margin-top: 2rem; font-size: 1.1rem; white-space: pre-line; }
.login-card { max-width: 480px; margin: 2rem auto; }
.login-card h1 { margin: .5rem 0 1.5rem; font-size: 2.2rem; }

.site-footer { padding: 4.5rem 0 1.5rem; color: #c5d3dc; background: #091722; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; }
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; }
.footer-brand { color: #fff; font-size: 1.6rem; }
.footer-grid h2 { color: #fff; font-size: 1rem; }
.footer-grid a { color: #c5d3dc; }
.footer-bottom { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }

.admin-site { min-height: 100vh; background: var(--surface-sunken); }
.admin-header { position: fixed; z-index: 50; inset-block: 0; inset-inline-start: 0; width: 245px; display: flex; flex-direction: column; padding: 1.5rem 1rem; color: #fff; background: var(--navy); }
.admin-brand { margin-bottom: 2rem; color: #fff; font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.admin-brand span { color: #ffab72; font-size: .75rem; text-transform: uppercase; }
.admin-header nav { display: flex; flex: 1; flex-direction: column; gap: .3rem; }
.admin-header nav > a, .admin-header nav button { display: block; width: 100%; padding: .72rem .8rem; border: 0; border-radius: 7px; color: #d8e5ed; background: transparent; text-align: start; text-decoration: none; }
.admin-header nav > a:hover, .admin-header nav button:hover { color: #fff; background: rgba(255,255,255,.09); }
.admin-header nav form { margin-top: auto; }
.admin-menu { display: none; }
.admin-main { margin-inline-start: 245px; padding: clamp(1.5rem, 4vw, 3.5rem); }
.admin-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.admin-page-heading h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-grid a { display: grid; padding: 1.6rem; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface-raised); text-decoration: none; }
.stat-grid strong { font-size: 2.3rem; }
.stat-grid span { color: var(--muted); }
.admin-filter { display: flex; max-width: 650px; gap: .6rem; margin-bottom: 1.2rem; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); }
.admin-table { min-width: 700px; margin: 0; vertical-align: middle; }
.admin-table th { padding: .9rem 1rem; color: var(--text-muted); background: var(--surface-sunken); font-size: .75rem; text-transform: uppercase; }
.admin-table td { padding: .85rem 1rem; }
.admin-table td > small { display: block; color: var(--muted); }
.admin-table img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; background: var(--mist); }
.status-pill { display: inline-flex; padding: .25rem .55rem; border-radius: var(--radius-pill); color: var(--text-muted); background: var(--surface-sunken); font-size: .75rem; font-weight: 800; }
.status-pill.live { color: var(--success); background: var(--success-surface); }
.status-pill.draft { color: var(--warning); background: var(--warning-surface); }
.table-actions { display: flex; justify-content: end; gap: .45rem; }
.admin-form, .admin-detail { max-width: 960px; padding: 2rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); }
.admin-form fieldset { display: grid; gap: 1rem; padding: 0 0 2rem; border: 0; border-bottom: 1px solid var(--line); }
.admin-form legend { margin-bottom: 1rem; font-size: 1.25rem; font-weight: 800; }
.form-actions { display: flex; align-items: center; gap: .7rem; }
.form-actions .form-select { width: auto; }
.form-preview { width: 150px; height: 150px; object-fit: cover; border-radius: 8px; background: var(--mist); }
.admin-detail dl { display: grid; grid-template-columns: 150px 1fr; gap: .7rem 1.5rem; }
.admin-detail dt { color: var(--muted); }
.message-list { display: grid; gap: 1rem; }
.message-card { padding: 1.4rem; border-inline-start: 4px solid var(--accent); border-radius: 8px; background: var(--surface-raised); box-shadow: var(--shadow-sm); }
.message-card.reviewed { border-color: #a9b7c0; opacity: .78; }
.message-card header { display: flex; justify-content: space-between; gap: 1rem; }
.message-card header div { display: grid; }
.message-card header span, .message-card time { color: var(--muted); font-size: .85rem; }
.pre-line { white-space: pre-line; }

/* Arabic typography. The small-caps treatment on eyebrows, category labels, and table headers
   is built for Latin: Arabic has no uppercase, and tracking pulls apart letters that are meant
   to join, which is why those captions read as broken. Arabic also has a smaller apparent
   x-height at the same point size, so the labels need a little more of it. */
[dir="rtl"] .eyebrow,
[dir="rtl"] .product-category,
[dir="rtl"] .admin-table th,
[dir="rtl"] .fact-panel dt,
[dir="rtl"] .spec-list dt,
[dir="rtl"] .stat-grid span,
[dir="rtl"] .admin-brand span { letter-spacing: normal; text-transform: none; }
[dir="rtl"] .eyebrow { font-size: .95rem; }
[dir="rtl"] .product-category { font-size: .85rem; }
[dir="rtl"] .admin-table th { font-size: .85rem; }
[dir="rtl"] .fact-panel dt, [dir="rtl"] .spec-list dt { font-size: .92rem; }
/* Arabic sits on a lower baseline than Latin at the same leading. */
[dir="rtl"] body { line-height: 1.85; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { line-height: 1.35; letter-spacing: normal; }

[dir="rtl"] .hero-section::before { transform: scaleX(-1); }
[dir="rtl"] .section-heading span[aria-hidden="true"], [dir="rtl"] .back-link { display: inline-block; transform: scaleX(-1); }

@media (max-width: 991.98px) {
  .site-header .navbar-collapse { padding: 1rem 0; }
  .nav-cta { display: inline-block; margin-top: .5rem; }
  .language-form { margin: .5rem 0 0; }
  .hero-grid, .content-grid, .form-layout, .detail-grid, .quote-layout { grid-template-columns: 1fr; }
  .hero-section { min-height: auto; }
  .hero-panel { grid-template-columns: repeat(3, 1fr); }
  .hero-panel div { border-bottom: 0; border-inline-end: 1px solid rgba(255,255,255,.15); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-header { position: relative; width: auto; inset: auto; flex-direction: row; align-items: center; padding: 1rem; }
  .admin-brand { margin: 0; }
  .admin-menu { display: block; margin-inline-start: auto; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; color: #fff; background: transparent; }
  .admin-header nav { position: absolute; top: 100%; inset-inline: 0; display: none; padding: 1rem; background: var(--navy); }
  .admin-header nav.open { display: flex; }
  .admin-main { margin: 0; }
}

@media (max-width: 767.98px) {
  h1 { font-size: 2.6rem; }
  .section { padding: 3.5rem 0; }
  .hero-grid { padding-block: 4rem; gap: 3rem; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-panel div { border-inline-end: 0; border-bottom: 1px solid rgba(255,255,255,.15); }
  .category-grid, .product-grid, .news-grid, .footer-grid, .form-grid, .stat-grid { grid-template-columns: 1fr; }
  .quote-line { grid-template-columns: 72px minmax(0, 1fr); }
  .quote-line-image, .quote-line-image img { width: 72px; height: 72px; }
  .quote-line-actions { grid-column: 1 / -1; justify-items: stretch; }
  .quote-qty-form .form-control { width: 100%; }
  .detail-inquiry { width: 100%; }
  .detail-inquiry .form-control { width: 6rem; }
  .filter-panel { grid-template-columns: 1fr; }
  .category-card, .category-card img { min-height: 260px; height: 260px; }
  .cta-grid, .section-heading, .message-card header { align-items: flex-start; flex-direction: column; }
  .detail-image { min-height: 360px; }
  .admin-main { padding: 1.25rem; }
  .admin-page-heading { align-items: flex-start; flex-direction: column; }
  .admin-detail dl { grid-template-columns: 1fr; }
}

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