/* ==========================================================================
   MAHABADI — System layer (Industrial Blueprint)
   One coherent surface/rule/shadow language applied across every page.
   Loaded last so it unifies all existing components.
   ========================================================================== */

/* ============================== SURFACES =============================== */
/* Hairlines are the structure. Shadows only where something truly floats. */
.panel,
.side-card,
.blog-card,
.cat-tile,
.readmore,
.about-stat,
.trust-item,
.prod-card,
.cat-card,
.hero-quickbar,
.consent,
.toolbar {
  border: var(--hairline);
  box-shadow: var(--shadow-contact);
}

.panel,
.side-card,
.blog-card,
.readmore { border-radius: var(--radius-lg); }

/* Lift only on interactive cards */
.blog-card:hover,
.cat-tile:hover { box-shadow: var(--shadow-raised); }

/* Tables, toolbars and static blocks: flat, ruled — no shadow. */
.price-table,
.toolbar { box-shadow: none; }
.price-table { border: var(--hairline); border-radius: var(--radius-lg); }

/* ============================ PRICE TABLE ============================== */
/* The memorable element: a spec sheet, not a styled table. */
.price-table__head {
  padding: var(--space-s) var(--space-m);
  border-bottom: var(--hairline);
  background: color-mix(in srgb, var(--sand) 55%, var(--surface));
}
.price-table__title { font-size: var(--step-1); font-weight: var(--fw-bold); }

.price-table thead th {
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
  color: var(--ink-2);
  font-weight: var(--fw-medium);
  font-size: var(--step--1);
  letter-spacing: .01em;
  border-bottom: var(--hairline-strong);
  padding-block: var(--space-2xs);
}

.price-table tbody td {
  padding-block: var(--space-xs);
  font-variant-numeric: tabular-nums;
  border-bottom: var(--hairline);
}
.price-table tbody tr:hover { background: color-mix(in srgb, var(--blue) 4%, transparent); }

.price-table .price {
  font-weight: var(--fw-bold);
  font-size: var(--step-1);
  color: var(--ink);
  letter-spacing: -.01em;
}
.price-table .price--ask { font-size: var(--step-0); color: var(--orange-ink); }
.price-table .cell-model { font-weight: var(--fw-medium); color: var(--ink); }
.price-table .cell-date { font-size: var(--step--2); color: var(--ink-3); }

.variance {
  border: var(--hairline);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}
.variance--up { border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.variance--down { border-color: color-mix(in srgb, var(--ok) 26%, transparent); }

.price-table__foot {
  border-top: var(--hairline);
  background: color-mix(in srgb, var(--sand) 50%, var(--surface));
  align-items: center;
}

/* Quote CTA appended to every price table */
.price-table__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  flex-wrap: wrap;
  padding: var(--space-s) var(--space-m);
  border-top: var(--hairline);
}
.price-table__cta-text { display: grid; gap: 2px; }
.price-table__cta-text strong { font-size: var(--step-0); font-weight: var(--fw-bold); color: var(--ink); }
.price-table__cta-text span { font-size: var(--step--1); color: var(--ink-3); }
.price-table__cta-actions { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }

/* Mobile: keep the row-card but make it read like a data sheet. */
@media (max-width: 680px) {
  .price-table tbody tr {
    border: var(--hairline);
    border-radius: var(--radius-md);
    margin: var(--space-2xs) var(--space-xs);
  }
  .price-table tbody td { padding-block: var(--space-2xs); }
  .price-table .price { font-size: var(--step-1); }
}

/* ============================== BUTTONS ================================ */
.btn { font-weight: var(--fw-medium); letter-spacing: -.005em; }
.btn--sm { min-height: 40px; }
.btn--outline { background: var(--surface); border-color: color-mix(in srgb, var(--ink) 18%, transparent); }
.btn--outline:hover { background: color-mix(in srgb, var(--blue) 6%, var(--surface)); border-color: var(--blue); color: var(--blue); box-shadow: none; }
.btn--soft { background: color-mix(in srgb, var(--sand) 75%, var(--surface)); border-color: transparent; }
.btn--soft:hover { background: var(--gold-soft); }

/* ============================== CHIPS ================================== */
.chip { background: var(--surface); border-color: var(--hairline-strong); }
.chip:hover { background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.chip.is-active { background: var(--blue); border-color: var(--blue); }

/* filter chips (used inside the toolbar) */
.chip-bar { display: flex; align-items: center; gap: var(--space-2xs); flex-wrap: wrap; }
.chip-bar__label { display: inline-flex; align-items: center; gap: var(--space-3xs); font-size: var(--step--1); color: var(--ink-3); }

/* ============================ SECTION HEAD ============================= */
.sec-head { margin-bottom: var(--space-l); }
.sec-head__eyebrow {
  font-weight: var(--fw-medium);
  letter-spacing: .01em;
}
.sec-title { font-size: var(--step-3); letter-spacing: -.01em; }
.sec-sub { color: var(--ink-2); line-height: 1.9; }

/* ============================== PRODUCT HERO =========================== */
.prod-hero { padding-block: var(--space-m) var(--space-l); background: color-mix(in srgb, var(--sand) 45%, var(--surface)); border-bottom: var(--hairline); }
.prod-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-l); align-items: start; }
.prod-hero__copy { display: grid; gap: var(--space-s); align-content: start; }
.prod-hero__title { font-size: var(--step-4); line-height: 1.35; letter-spacing: -.015em; }

.prod-hero__chips { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
.prod-hero__chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--surface); border: var(--hairline); font-size: var(--step--2); font-weight: var(--fw-medium); color: var(--ink-2); }
.prod-hero__chip svg { width: 14px; height: 14px; color: var(--orange-ink); }
.prod-hero__chip--accent { background: var(--blue); border-color: var(--blue); color: #fff; }
.prod-hero__chip--accent svg { color: var(--gold); }

.prod-hero__text { color: var(--ink-2); line-height: 1.95; max-width: var(--measure-text); margin: 0; }

/* Spec strip — the engineering detail that sells an industrial product */
.spec-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: var(--hairline); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.spec-strip__item { padding: var(--space-xs) var(--space-s); border-inline-end: var(--hairline); }
.spec-strip__item:last-child { border-inline-end: 0; }
.spec-strip__label { display: block; font-size: var(--step--2); color: var(--ink-3); margin-bottom: 2px; }
.spec-strip__value { display: block; font-size: var(--step-0); font-weight: var(--fw-bold); color: var(--ink); font-variant-numeric: tabular-nums; }

.prod-hero__actions { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }

/* Media panel */
.prod-hero__media { position: relative; border: var(--hairline); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-raised); }
.prod-hero__media img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; padding: var(--space-m); background: linear-gradient(180deg, color-mix(in srgb, var(--sand) 70%, var(--surface)), var(--surface)); }

@media (max-width: 1024px) {
  .prod-hero__grid { grid-template-columns: 1fr; gap: var(--space-m); }
  .prod-hero__media { order: -1; }
  .prod-hero__title { font-size: var(--step-3); }
}
@media (max-width: 520px) {
  .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-strip__item { border-bottom: var(--hairline); }
}

/* ============================== SIDEBAR RAIL =========================== */
.rail-cta { display: grid; gap: var(--space-2xs); }
.rail-cta__note { font-size: var(--step--2); color: var(--ink-3); text-align: center; line-height: 1.8; }

@media (min-width: 1025px) {
  .rail-sticky { position: sticky; top: calc(var(--header-h) + var(--space-s)); }
}

/* ============================== TOOLBAR ================================ */
.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2xs) var(--space-s);
  padding: var(--space-s) var(--space-m);
}
.toolbar .quick-chips { grid-column: 1 / -1; padding: var(--space-2xs) 0 0; border-top: var(--hairline); }
.toolbar__count { display: flex; align-items: center; gap: var(--space-2xs); }
.toolbar__count strong { font-size: var(--step-1); font-weight: var(--fw-bold); color: var(--ink); }
.toolbar__actions { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }

@media (max-width: 720px) {
  .toolbar { grid-template-columns: 1fr; }
  .toolbar__actions .btn { flex: 1; }
}

/* ============================== STATES ================================= */
/* Empty / error / loading — reused by archive, search and product pages. */
.state {
  display: grid;
  justify-items: center;
  gap: var(--space-s);
  padding: var(--space-2xl) var(--space-m);
  text-align: center;
  border: var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.state__ico { display: grid; place-items: center; width: 72px; height: 72px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--blue) 6%, var(--surface)); color: var(--blue); }
.state__ico svg { width: 34px; height: 34px; }
.state__title { font-size: var(--step-2); }
.state__text { color: var(--ink-2); line-height: 1.9; max-width: 48ch; margin: 0; }
.state__actions { display: flex; gap: var(--space-2xs); flex-wrap: wrap; justify-content: center; }

.skeleton { border-radius: var(--radius-sm); background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 6%, transparent) 25%, color-mix(in srgb, var(--ink) 3%, transparent) 37%, color-mix(in srgb, var(--ink) 6%, transparent) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ============================== PROSE ================================== */
.prose { line-height: 2.05; color: var(--ink-2); }
.prose h2, .prose h3 { color: var(--ink); margin-top: var(--space-l); }
.prose h2 { font-size: var(--step-2); }
.prose h3 { font-size: var(--step-1); }
.prose p, .prose li { max-width: var(--measure-text); }
.prose a { color: var(--orange-ink); text-decoration: underline; text-underline-offset: 3px; }
.prose table th { background: color-mix(in srgb, var(--sand) 60%, var(--surface)); }
.prose img { border-radius: var(--radius-md); }

/* ============================== ARTICLES =============================== */
.article__title { font-size: var(--step-4); line-height: 1.35; letter-spacing: -.015em; }
.article__meta { display: flex; align-items: center; gap: var(--space-s); flex-wrap: wrap; color: var(--ink-3); font-size: var(--step--1); }
.article__meta svg { width: 16px; height: 16px; }
.article__meta .author { color: var(--ink-2); font-weight: var(--fw-medium); }

/* ============================== FOOTER ================================= */
.footer-col__title { font-size: var(--step-0); letter-spacing: .01em; }

/* ============================ ACCESSIBILITY ============================ */
/* Never suppress focus; make it unmistakable on both light and dark. */
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.section--blue :focus-visible,
.site-footer :focus-visible,
.hero-call :focus-visible,
.consult-band :focus-visible { outline-color: var(--gold); }

/* Body copy at full contrast for readability on paper surfaces */
.desc-box p,
.readmore__content,
.prose,
.article__body { color: var(--ink-2); }

/* ============================ PERFORMANCE ============================== */
/* Below-the-fold, static blocks only — never on sliders or sticky elements. */
.readmore { content-visibility: auto; contain-intrinsic-size: auto 320px; }
.site-footer { content-visibility: visible; }

/* ============================ PRINT ==================================== */
@media print {
  .prod-hero__actions, .rail-cta, .price-table__cta, .tabbar, .notice-bar { display: none !important; }
}

/* ===================== DARK SURFACES (palette-safe) ==================== */
/* A mid-tone primary can't carry light text; dark surfaces deepen it. */
.topbar,
.section--blue,
.site-footer,
.preloader { background: var(--blue-deep); }

.hero-call,
.consult-band {
  background:
    radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--gold) 20%, transparent), transparent 58%),
    linear-gradient(150deg, var(--blue), var(--blue-deep));
}
.hero-call { color: var(--on-dark); }
.hero-call__text,
.hero-call__hours,
.hero-call__phone-body small { color: var(--on-dark-2); }
.hero-call__title,
.hero-call__phone-body strong { color: #fff; }
.topbar { color: var(--on-dark-2); }
.topbar__item a { color: var(--on-dark); }
.section--blue { color: var(--on-dark-2); }

/* Accent buttons pick their ink from the accent's luminance. */
.btn--gold { color: var(--on-accent); }
.btn--orange { color: var(--on-accent); }

/* Small labels over media: more opaque plate, full-ink text. */
.cat-card__count,
.prod-card__tag {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--ink);
  font-weight: var(--fw-medium);
}

/* Category card: full-ink title for 4.5:1 at small sizes. */
.cat-card__title { color: var(--ink); }
.cat-card__body { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.side-card__head { color: var(--ink); }
.hero-quickbar__label { color: var(--ink); }

/* ============ ACCENT INK (readable on any palette's accent) ============ */
/* Fills use the contrast-corrected accent; ink comes from the paired token. */
.btn--gold { background: var(--gold-fill); color: var(--on-accent); }
.btn--gold:hover { background: var(--gold-fill-2); }
.btn--orange { background: var(--orange-fill); color: var(--on-orange); }

.video-play__btn,
.mega__cta,
.quick-contact,
.slider-arrow:hover,
.trust-item--gold:hover .trust-item__ico,
.trust-item--orange:hover .trust-item__ico,
.hero-call__phone-ico,
.faq-item.is-open .faq-q svg,
.faq-q:hover svg,
.copy-btn,
.hero-slider__btn:hover { background: var(--gold-fill); color: var(--on-accent); }

.trust-item--orange:hover .trust-item__ico { background: var(--orange-fill); color: var(--on-orange); }

/* Accent-filled icon chips inherit the readable ink too */
.trust-item--gold:hover .trust-item__ico svg,
.trust-item--orange:hover .trust-item__ico svg,
.hero-call__phone-ico svg,
.video-play__btn svg { color: currentColor; }

/* Elements filled with the primary take light ink */
.post-card__cat,
.price-table__link,
.badge--dark { color: var(--on-dark); }
.post-card__cat { font-weight: var(--fw-medium); }

::selection { background: var(--gold-fill); color: var(--on-accent); }

/* ============================ LOGIN GATE =============================== */
.login-gate { display: grid; gap: var(--space-xs); }
.login-gate .modal__icon { margin-inline: auto; }
.login-gate__hello { text-align: center; color: var(--ink-2); line-height: 1.95; margin-bottom: var(--space-2xs); }
.login-gate__hello strong { color: var(--ink); }
.login-gate__alt { text-align: center; font-size: var(--step--1); color: var(--ink-3); margin: var(--space-2xs) 0 0; }
.login-gate__alt a { color: var(--brand); font-weight: var(--fw-bold); direction: ltr; display: inline-block; }

/* ==========================================================================
   ICON SYSTEM — one stroke language + tasteful motion (no external CDN)
   Every icon is the v2 set: 24px grid, 1.7 stroke, currentColor.
   ========================================================================== */
.icon { stroke: currentColor; }

/* draw-on-reveal for feature icons (steps, trust, about, spec) */
@keyframes ic-draw { from { stroke-dashoffset: 220; } to { stroke-dashoffset: 0; } }
html.js .reveal.is-visible .step__ico svg,
html.js .reveal.is-visible .trust-item__ico svg,
html.js .reveal.is-visible .about__icon svg,
html.js .reveal.is-visible .catalog__eyebrow svg,
html.js .reveal.is-visible .sec-head__eyebrow svg {
  stroke-dasharray: 220;
  animation: ic-draw .9s var(--ease-out) both;
}
.step:nth-child(2) .step__ico svg { animation-delay: .08s; }
.step:nth-child(3) .step__ico svg { animation-delay: .16s; }
.step:nth-child(4) .step__ico svg { animation-delay: .24s; }
.step:nth-child(5) .step__ico svg { animation-delay: .32s; }
.step:nth-child(6) .step__ico svg { animation-delay: .40s; }

/* consistent hover motion wherever an icon sits inside a link or button */
a:hover > .icon, .btn:hover .icon, .chip:hover .icon { animation: ic-pop var(--dur-slow) var(--ease); }
.slider-arrow:hover svg, .catalog__nav:hover svg, .hero-slider__btn:hover svg { animation: ic-nudge var(--dur-slow) var(--ease); }
.phone-link:hover svg, a[href^="tel:"]:hover .icon, .support-card__phone:hover svg, .header-phone:hover svg { animation: ic-ring var(--dur-slow) var(--ease); }
.footer-socials a:hover svg, .social-btn:hover svg { animation: ic-pop var(--dur-slow) var(--ease); }

/* entrance for social pills */
.footer-socials a { transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.footer-socials a:hover { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal.is-visible .step__ico svg,
  html.js .reveal.is-visible .trust-item__ico svg,
  html.js .reveal.is-visible .about__icon svg { animation: none; stroke-dasharray: none; }
  a:hover > .icon, .btn:hover .icon, .chip:hover .icon, .slider-arrow:hover svg { animation: none; }
}
