/* ========================================================================
   SERI JADI — CANONICAL UI SYSTEM
   Final visual layer for public, service, catalogue, editorial and auth pages.
   Loaded last so older page-specific experiments cannot fragment the site.
   2026-07-13
   ======================================================================== */

:root {
  --ui-ink: #17151d;
  --ui-copy: #4f4b59;
  --ui-muted: #726d7d;
  --ui-violet: #654fd2;
  --ui-violet-dark: #503bb8;
  --ui-violet-soft: #f1eefc;
  --ui-gold: #c7a45b;
  --ui-line: #e5e1ec;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f8f7fb;
  --ui-surface-warm: #fbfaf7;
  --ui-radius-sm: 10px;
  --ui-radius: 14px;
  --ui-radius-lg: 18px;
  --ui-shadow: 0 1px 2px rgba(31, 25, 74, .04), 0 10px 28px rgba(31, 25, 74, .055);
  --ui-shadow-hover: 0 2px 4px rgba(31, 25, 74, .05), 0 16px 36px rgba(31, 25, 74, .09);
}

html {
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: auto;
}

body {
  max-width: 100%;
  overflow-x: clip;
  background: var(--ui-surface);
  color: var(--ui-ink);
  text-rendering: optimizeLegibility;
}

img { object-position: center; }

.container {
  width: 100%;
  max-width: 1180px;
  min-width: 0;
  margin-inline: auto;
  padding-inline: 24px;
}

/* Stable paint and predictable motion. */
.section-light,
.section-dark,
.section-gray,
.home-v2-section {
  contain: none;
  content-visibility: visible;
}

.hero-deco-blob,
.hero-deco-ring,
.hero-deco-dot,
.wa-fab-ping {
  animation: none !important;
  will-change: auto !important;
}

.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--ui-line);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: none;
}

.site-nav.scrolled {
  background: #fff;
  border-bottom-color: var(--ui-line);
  box-shadow: 0 3px 14px rgba(31, 25, 74, .055);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#nav-placeholder:empty {
  display: block;
  height: 92px;
  border-bottom: 1px solid var(--ui-line);
  background: linear-gradient(to bottom, #17151d 0 28px, #fff 28px 100%);
}

main [id] { scroll-margin-top: 108px; }

/* ------------------------------------------------------------------------
   Page framework
   ------------------------------------------------------------------------ */

.page-hero,
.page-hero-dark,
.stamps-hero-dark {
  position: relative;
  overflow: hidden;
  padding: 38px 0 40px;
  border-bottom: 1px solid var(--ui-line);
  background:
    radial-gradient(circle at 88% 8%, rgba(101, 79, 210, .12), transparent 30%),
    linear-gradient(145deg, #fff 0%, var(--ui-surface-warm) 58%, #f4f1fb 100%);
}

.page-hero::before,
.page-hero-dark::before,
.stamps-hero-dark::before { display: none; }

.page-hero-inner { position: relative; z-index: 1; min-width: 0; }

.page-hero .breadcrumb,
.page-hero-dark .breadcrumb,
.stamps-hero-dark .breadcrumb {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  color: var(--ui-muted);
  font-size: 12px;
}

.page-hero .breadcrumb a,
.page-hero-dark .breadcrumb a,
.stamps-hero-dark .breadcrumb a { color: var(--ui-copy); }

.page-hero-eyebrow,
.section-eyebrow.as-chip,
.blog-hero .eyebrow,
.post-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 11px;
  padding: 5px 10px;
  border: 1px solid rgba(101, 79, 210, .16);
  border-radius: 999px;
  background: var(--ui-violet-soft);
  color: var(--ui-violet-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
}

.page-hero h1,
.page-hero-title {
  width: 100%;
  max-width: 940px;
  margin: 0;
  color: var(--ui-ink);
  font-size: clamp(36px, 3.65vw, 50px);
  font-weight: 800;
  letter-spacing: -.038em;
  line-height: 1.06;
  overflow-wrap: normal;
}

.page-hero h1 .gold,
.page-hero-title .gold { color: var(--ui-violet); }

.page-hero p,
.page-hero-sub {
  width: 100%;
  max-width: 740px;
  margin: 13px 0 0;
  color: var(--ui-copy);
  font-size: 15px;
  line-height: 1.6;
}

.page-hero .btn,
.page-hero-dark .btn { min-height: 46px; }

.section { padding: 60px 0; }
.section-sm { padding: 42px 0; }
.section-light { background: #fff; }
.section-gray,
.home-v2-services,
.home-v2-process,
.home-v2-faq {
  border-block: 1px solid rgba(101, 79, 210, .07);
  background: var(--ui-surface-soft);
}
.section-dark { background: var(--ui-surface-soft); }

.compact-answer { padding: 30px 0; }
.compact-answer .section-header {
  max-width: 900px;
  margin-bottom: 0;
  text-align: left;
}

.section-header {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}

.section-title {
  margin: 0;
  color: var(--ui-ink);
  font-size: clamp(29px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -.032em;
  line-height: 1.1;
}

.section-sub,
.section-header .section-sub {
  max-width: 680px;
  margin: 11px auto 0;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ------------------------------------------------------------------------
   Shared cards and imagery
   ------------------------------------------------------------------------ */

.category-card,
.product-card,
.stamp-type-card,
.service-card,
.value-card,
.step-card,
.faq-item,
.form-card,
.real-stamp-model,
.blog-card,
.home-v2-service-card,
.home-v2-proof-points > div,
.home-v2-process-grid li {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
}

.stamp-types-grid,
.services-grid,
.steps-grid,
.values-grid {
  align-items: stretch;
  gap: 16px;
}

.stamp-types-grid,
.services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.signage-visuals,
.sticker-visuals,
.packaging-visuals,
.banner-visuals,
.specialist-print-visuals {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Regional pages have four or six short cards; 2-up avoids orphan rows. */
body[data-page="printing"] .stamp-types-grid:not(.visual-service-grid),
body[data-page="stamps"] .stamp-types-grid:not(.visual-service-grid) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visual-service-grid .stamp-type-card,
.visual-service-grid .service-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  padding: 0 20px 20px;
  border: 1px solid var(--ui-line);
  background: #fff;
}

.visual-service-grid .stamp-type-card::before,
.visual-service-grid .service-card::before { content: none !important; display: none !important; }

.visual-service-grid .service-card-photo {
  display: block;
  order: -1;
  width: calc(100% + 40px);
  max-width: none;
  height: auto;
  margin: 0 -20px 17px;
  aspect-ratio: 16 / 9;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  background: #f4f2f8;
  object-fit: cover;
  object-position: center;
}

/* Generated scenes explain available formats; they are not presented as a
   gallery of completed Seri Jadi installations. */
.visual-example-note {
  max-width: 760px;
  margin: -10px auto 20px;
  padding: 10px 12px;
  border: 1px solid #ddd7f2;
  border-radius: 10px;
  background: var(--ui-violet-soft);
  color: var(--ui-copy);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.visual-example-note strong { color: var(--ui-violet-dark); }

.signage-visuals .stamp-type-card::after {
  content: "Illustrative example";
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 999px;
  background: rgba(23, 21, 29, .82);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
  pointer-events: none;
}

html[lang="ms-MY"] .signage-visuals .stamp-type-card::after {
  content: "Contoh ilustrasi";
}

.visual-service-grid .service-card-photo.contain {
  padding: 8px;
  background: #fff;
  object-fit: contain;
}

.visual-service-grid .stamp-type-icon,
.visual-service-grid .service-icon { display: none; }

.visual-service-grid .stamp-type-card h3,
.visual-service-grid .service-card h3 {
  margin: 0 0 6px;
  color: var(--ui-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.visual-service-grid .stamp-type-card > p,
.visual-service-grid .service-card > p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.visual-service-grid .service-features,
.visual-service-grid .stamp-features { margin: 13px 0 0; }

.visual-service-grid .btn,
.visual-service-grid .stamp-price,
.visual-service-grid .service-card-price { margin-top: auto; }

@media (hover: hover) and (pointer: fine) {
  .category-card,
  .product-card,
  .visual-service-grid .stamp-type-card,
  .visual-service-grid .service-card,
  .home-v2-service-card {
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  }
  .category-card:hover,
  .product-card:hover,
  .visual-service-grid .stamp-type-card:hover,
  .visual-service-grid .service-card:hover,
  .home-v2-service-card:hover {
    transform: translateY(-2px);
    border-color: rgba(101, 79, 210, .34);
    box-shadow: var(--ui-shadow-hover);
  }
}

/* ------------------------------------------------------------------------
   Product and catalogue alignment
   ------------------------------------------------------------------------ */

.product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 14px;
}

.product-card {
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.product-card-link { min-height: 0; flex: 1; }

.product-card-img,
.product-card.no-product-image .product-card-img {
  width: 100%;
  height: 142px;
  min-height: 142px;
  aspect-ratio: auto;
  border-bottom: 1px solid var(--ui-line);
  background: #f5f3f9;
}

.product-card-img > img,
.product-card-img > .product-card-placeholder {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center !important;
}

.product-card.no-product-image .product-card-img svg { width: 40px; height: 40px; }

.product-card-body {
  min-height: 108px;
  padding: 12px 13px 10px;
}

.product-brand { min-height: 13px; }

.product-name {
  display: -webkit-box;
  min-height: 38px;
  overflow: hidden;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-price { margin-top: auto; margin-bottom: 0; }

.product-card-actions { padding: 0 12px 12px; }
.btn-add,
.btn-wa-quick,
.mobile-filter-btn,
.catalog-search,
.catalog-sort,
.subcat-tab,
.form-control { min-height: 44px; }
.btn-wa-quick { min-width: 44px; }

.catalog-sidebar {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
}

body[data-page="stationery"] .trust-badges {
  display: flex;
  flex-wrap: wrap;
  overflow: visible;
  gap: 7px !important;
}

body[data-page="stationery"] .trust-badges .badge {
  max-width: 100%;
  white-space: normal;
}

.subcat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  overflow: visible;
}

.subcat-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  white-space: normal;
}

/* ------------------------------------------------------------------------
   Homepage composition
   ------------------------------------------------------------------------ */

body[data-page="home"] .home-v2 { overflow: hidden; background: #fff; }
body[data-page="home"] .home-v2-hero { padding: 48px 0; }
body[data-page="home"] .home-v2-hero-grid {
  grid-template-columns: minmax(0, .9fr) minmax(500px, 1.1fr);
  gap: 48px;
}
body[data-page="home"] .home-v2-hero-copy h1 {
  max-width: 620px;
  font-size: clamp(48px, 5.1vw, 68px);
  line-height: .98;
}
body[data-page="home"] .home-v2-hero-lead { max-width: 590px; font-size: 17px; }
body[data-page="home"] .home-v2-hero-media {
  width: 100%;
  height: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto;
  gap: 12px;
}
body[data-page="home"] .home-v2-hero-photo {
  min-width: 0;
  min-height: 0;
  aspect-ratio: 16 / 9;
}
body[data-page="home"] .home-v2-hero-photo-main { grid-column: 1 / -1; grid-row: auto; }
body[data-page="home"] .home-v2-hero-photo img { object-fit: cover; object-position: center !important; }

/* Malay headings naturally run longer. Give the copy a wider track and a
   slightly calmer display size so the hero remains the same height as EN. */
html[lang="ms-MY"] body[data-page="home"] .home-v2-hero-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(470px, .92fr);
}
html[lang="ms-MY"] body[data-page="home"] .home-v2-hero-copy h1 {
  max-width: 690px;
  font-size: clamp(46px, 4.45vw, 60px);
}

body[data-page="home"] .home-v2-section { padding: 64px 0; }
body[data-page="home"] .home-v2-section-head { margin-bottom: 28px; }
body[data-page="home"] .home-v2-section-head h2,
body[data-page="home"] .home-v2-proof-copy h2,
body[data-page="home"] .home-v2-area-copy h2,
body[data-page="home"] .home-v2-faq-intro h2,
body[data-page="home"] .home-v2-final-cta h2 {
  font-size: clamp(34px, 3.3vw, 46px);
}

body[data-page="home"] .home-v2-service-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
body[data-page="home"] .home-v2-service-card,
body[data-page="home"] .home-v2-service-card-wide {
  grid-column: auto;
  display: grid;
  grid-template-rows: auto 1fr;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  background: #fff;
}
body[data-page="home"] .home-v2-service-card img {
  position: relative;
  inset: auto;
  z-index: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
body[data-page="home"] .home-v2-service-shade { display: none; }
body[data-page="home"] .home-v2-service-copy {
  position: relative;
  inset: auto;
  z-index: 1;
  padding: 16px;
  color: var(--ui-ink);
}
body[data-page="home"] .home-v2-service-copy small,
body[data-page="home"] .home-v2-service-copy b { color: var(--ui-violet); }
body[data-page="home"] .home-v2-service-copy strong { font-size: 19px; line-height: 1.15; }
body[data-page="home"] .home-v2-service-copy em {
  display: block;
  overflow: visible;
  color: var(--ui-muted);
  font-size: 12px;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
}

body[data-page="home"] .home-v2-proof-grid-text-only { display: block; }
body[data-page="home"] .home-v2-proof-grid-text-only .home-v2-proof-copy {
  display: grid;
  grid-template-columns: minmax(280px, .75fr) minmax(460px, 1.25fr);
  gap: 0 64px;
}
body[data-page="home"] .home-v2-proof-copy > .home-v2-eyebrow,
body[data-page="home"] .home-v2-proof-copy > h2,
body[data-page="home"] .home-v2-proof-copy > p,
body[data-page="home"] .home-v2-proof-copy > .home-v2-text-link { grid-column: 1; }
body[data-page="home"] .home-v2-proof-points {
  grid-column: 2;
  grid-row: 1 / span 4;
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin: 0;
  border: 0;
}
body[data-page="home"] .home-v2-proof-points > div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  background: var(--ui-surface-soft);
}
body[data-page="home"] .home-v2-proof-points span { margin: 0; font-size: 17px; }

body[data-page="home"] .home-v2-process-grid li { min-height: 0; height: 100%; }
body[data-page="home"] .home-v2-faq-intro { position: static; }
body[data-page="home"] .wa-fab { display: none; }

/* ------------------------------------------------------------------------
   Editorial, legal, contact and product pages
   ------------------------------------------------------------------------ */

body[data-page="blog"] .blog-hero,
body[data-page="blog"] .post-hero {
  padding: 48px 0 44px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at 85% 0, rgba(101,79,210,.34), transparent 34%),
    linear-gradient(135deg, #15131d, #211b3d);
}

body[data-page="blog"] .blog-hero h1,
body[data-page="blog"] .post-hero h1 {
  max-width: 900px;
  margin: 12px 0 14px;
  color: #fff;
  font-size: clamp(34px, 3.6vw, 48px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.08;
}

body[data-page="blog"] .blog-hero p,
body[data-page="blog"] .post-hero .meta {
  max-width: 700px;
  color: rgba(255,255,255,.72);
  font-size: 15px;
}

body[data-page="blog"] .blog-list-wrap { padding: 46px 0 72px; background: var(--ui-surface-soft); }
body[data-page="blog"] .blog-card {
  padding: 24px 26px;
  border: 1px solid var(--ui-line);
  background: #fff;
}
body[data-page="blog"] .blog-card h2 { color: var(--ui-ink); }
body[data-page="blog"] .post-body { padding: 44px 0 72px; }
body[data-page="blog"] .post-body .container { max-width: 780px; }
body[data-page="blog"] .question-block,
body[data-page="blog"] .callout {
  border-radius: var(--ui-radius-sm);
  border-color: var(--ui-gold);
}
body[data-page="blog"] .post-body table { display: block; max-width: 100%; overflow-x: auto; }

body[data-page="about"] .about-layout,
body[data-page="about"] .about-grid { min-width: 0; }
body[data-page="about"] .about-layout > *,
body[data-page="about"] .about-grid > * { min-width: 0; }
body[data-page="about"] .about-image-wrap { aspect-ratio: 3 / 2; height: auto; }
body[data-page="about"] .about-image-wrap img { width: 100%; height: 100%; object-fit: cover; }

body[data-page="contact"] .contact-grid { align-items: stretch; }
body[data-page="contact"] .contact-map-wrap,
body[data-page="contact"] .map-embed-container { height: 100%; min-height: 440px; }
.map-placeholder {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  background:
    linear-gradient(rgba(101,79,210,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101,79,210,.05) 1px, transparent 1px),
    linear-gradient(145deg, #fbfaff, #f1eefb);
  background-size: 28px 28px, 28px 28px, auto;
}
.contact-map-frame { display: block; width: 100%; height: 400px; border: 0; }

body[data-page="product"] .product-detail-section { padding-bottom: 52px; }
body[data-page="product"] .product-detail-layout { gap: 44px; }
body[data-page="product"] .product-detail-img > img,
body[data-page="product"] .product-img-placeholder-lg {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain !important;
  object-position: center !important;
  background: var(--ui-surface-soft) !important;
}
body[data-page="product"] .product-img-placeholder-lg {
  flex-direction: column;
  gap: 12px;
  color: var(--ui-violet) !important;
  border: 1px solid #ded8f2;
  background:
    radial-gradient(circle at 50% 38%, rgba(101,79,210,.11), transparent 34%),
    linear-gradient(145deg, #fbfaff, #f1eef9) !important;
}
body[data-page="product"] .product-img-placeholder-lg > span,
body[data-page="product"] .product-img-placeholder-lg > svg {
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  padding: 18px;
  border: 1px solid #e3ddf4;
  border-radius: 24px;
  background: #fff;
  color: var(--ui-violet) !important;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -.04em;
  box-shadow: 0 10px 28px rgba(53,38,111,.08);
}
body[data-page="product"] .product-img-placeholder-lg::after {
  content: "Product photo being updated";
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
}
body[data-page="product"] .product-detail-actions .btn { min-height: 48px; }

body[data-page="404"],
body[data-page="terms"] { background: var(--ui-surface-soft); }

body[data-page="404"] .nf-wrap {
  min-height: calc(100svh - 92px);
  padding: 54px 24px;
  background:
    radial-gradient(circle at 50% 0, rgba(101,79,210,.13), transparent 42%),
    var(--ui-surface-soft);
}
body[data-page="404"] .nf-code {
  margin-bottom: 8px;
  font-size: clamp(82px, 14vw, 136px);
  background: linear-gradient(135deg, var(--ui-violet), var(--ui-gold));
  -webkit-background-clip: text;
  background-clip: text;
}
body[data-page="404"] .nf-title { color: var(--ui-ink); }
body[data-page="404"] .nf-sub { color: var(--ui-copy); }
body[data-page="404"] .nf-links { border-top-color: var(--ui-line); }
body[data-page="404"] .nf-links a { color: var(--ui-violet-dark); }
body[data-page="404"] .btn-outline-light {
  border: 1px solid var(--ui-line);
  background: #fff;
  color: var(--ui-ink);
}

/* Footer is dense but remains legible. Previous mobile rules targeted .footer
   even though the real component is .site-footer. */
.site-footer { padding: 44px 0 28px; }
.site-footer .footer-inner { gap: 28px; margin-bottom: 28px; }
.site-footer .footer-col a { min-height: 32px; margin: 0; padding: 7px 0; }
.site-footer .footer-logo img { object-fit: contain; object-position: left center; }

/* ------------------------------------------------------------------------
   Auth consistency
   ------------------------------------------------------------------------ */

.auth-wrap {
  min-height: 100svh !important;
  padding: 36px 20px !important;
  background:
    radial-gradient(circle at 50% 0, rgba(101,79,210,.12), transparent 34%),
    var(--ui-surface-soft) !important;
}
.auth-card {
  border-color: var(--ui-line) !important;
  border-radius: var(--ui-radius-lg) !important;
  box-shadow: var(--ui-shadow) !important;
}
.auth-logo { margin-bottom: 22px !important; }
.auth-logo img { width: auto; max-width: 150px; height: 42px !important; object-fit: contain; }
.auth-logo .brand { display: none !important; }
.auth-title { color: var(--ui-ink) !important; font-size: 24px !important; }
.auth-sub { color: var(--ui-muted) !important; }
.auth-form input,
.auth-form select,
.auth-form textarea,
.field input,
.field select,
.field textarea,
.btn-primary-full,
.btn-register { min-height: 46px; }
.pw-toggle { min-width: 50px; min-height: 44px; }
.check-row { min-height: 44px; align-items: center !important; }
.check-row input[type="checkbox"] { width: 20px; height: 20px; }

/* ------------------------------------------------------------------------
   Responsive system
   ------------------------------------------------------------------------ */

@media (max-width: 980px) {
  .container { padding-inline: 18px; }
  .stamp-types-grid,
  .services-grid,
  .signage-visuals,
  .sticker-visuals,
  .packaging-visuals,
  .banner-visuals,
  .specialist-print-visuals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-page="home"] .home-v2-hero-grid { grid-template-columns: 1fr; gap: 26px; }
  html[lang="ms-MY"] body[data-page="home"] .home-v2-hero-grid { grid-template-columns: 1fr; }
  body[data-page="home"] .home-v2-hero-media { max-width: 820px; }
  body[data-page="home"] .home-v2-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-page="home"] .home-v2-proof-grid-text-only .home-v2-proof-copy { display: block; }
  body[data-page="home"] .home-v2-proof-points { margin-top: 24px; }
}

@media (max-width: 768px) {
  :root { --pad: 12px; --nav-h: 52px; }
  body { font-size: 14px; }
  .container { max-width: 100%; padding-inline: 12px; }
  #nav-placeholder:empty { height: 80px; }
  main [id] { scroll-margin-top: 88px; }

  .top-bar-inner { padding-inline: 12px; }
  .nav-inner { padding-inline: 12px; }
  .nav-logo img { height: 28px; }
  .site-nav .nav-lang-btn { min-height: 42px; }
  .hamburger { width: 44px; height: 44px; }

  .page-hero,
  .page-hero-dark,
  .stamps-hero-dark { padding: 18px 0 20px; }
  .page-hero .breadcrumb,
  .page-hero-dark .breadcrumb,
  .stamps-hero-dark .breadcrumb { margin-bottom: 10px; font-size: 11px; }
  .page-hero-eyebrow { margin-bottom: 8px; padding: 4px 8px; font-size: 10px; }
  .page-hero h1,
  .page-hero-title { font-size: clamp(28px, 8vw, 32px); line-height: 1.04; }
  .page-hero p,
  .page-hero-sub { margin-top: 8px; font-size: 12.5px; line-height: 1.46; }
  .page-hero .page-hero-sub + div { margin-top: 12px !important; gap: 7px !important; }
  .page-hero .page-hero-sub + div .btn { min-height: 44px; padding: 9px 10px; font-size: 12px; }
  .newsletter-input,
  .newsletter-form input[type="email"],
  .newsletter-form button,
  body[data-page="contact"] .btn-sm { min-height: 44px; }
  .sidebar-group-toggle,
  .catalog-sidebar .sidebar-reset {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .section { padding: 30px 0; }
  .section-sm { padding: 26px 0; }
  .compact-answer { padding: 22px 0; }
  .section-header { margin-bottom: 18px; }
  .section-eyebrow.as-chip { margin-bottom: 8px; padding: 4px 8px; font-size: 10px; }
  .section-title { font-size: clamp(23px, 6.6vw, 27px); line-height: 1.08; }
  .section-sub,
  .section-header .section-sub { margin-top: 7px; font-size: 12px; line-height: 1.48; }

  .stamp-types-grid,
  .services-grid,
  body[data-page="printing"] .stamp-types-grid:not(.visual-service-grid),
  body[data-page="stamps"] .stamp-types-grid:not(.visual-service-grid) {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  /* One shared mobile service-card pattern across stamps and printing. */
  .visual-service-grid .stamp-type-card,
  .visual-service-grid .service-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-auto-rows: min-content;
    align-content: start;
    min-height: 132px;
    padding: 9px;
    gap: 0 11px;
    border-radius: 11px;
    box-shadow: 0 1px 8px rgba(31,25,74,.055);
  }
  .visual-service-grid .service-card-photo {
    grid-column: 1;
    grid-row: 1 / span 12;
    align-self: start;
    width: 112px;
    max-width: 112px;
    height: auto;
    min-height: 0;
    margin: 0;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--ui-line);
    border-radius: 8px;
  }
  .visual-service-grid .stamp-type-card > :not(.service-card-photo),
  .visual-service-grid .service-card > :not(.service-card-photo) { grid-column: 2; }
  .visual-service-grid .stamp-type-card h3,
  .visual-service-grid .service-card h3 { margin-bottom: 4px; font-size: 13px; line-height: 1.2; }
  .visual-service-grid .stamp-type-card > p,
  .visual-service-grid .service-card > p {
    display: block;
    overflow: visible;
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: initial;
    -webkit-line-clamp: unset;
  }
  .visual-service-grid .service-features,
  .visual-service-grid .stamp-features { display: none; }
  .visual-service-grid .btn,
  .visual-service-grid .stamp-price { min-height: 44px; font-size: 10.5px; }

  /* Simple visual taxonomies are compact 2-up cards. Detailed stamp and print
     cards keep the image-left pattern above so their controls remain usable. */
  .signage-visuals,
  .sticker-visuals,
  .packaging-visuals,
  .banner-visuals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }

  .specialist-print-visuals { grid-template-columns: 1fr; gap: 9px; }

  .signage-visuals .stamp-type-card,
  .sticker-visuals .stamp-type-card,
  .packaging-visuals .stamp-type-card,
  .banner-visuals .stamp-type-card {
    display: flex;
    min-height: 100%;
    padding: 0 10px 11px;
    gap: 0;
  }

  .signage-visuals .service-card-photo,
  .sticker-visuals .service-card-photo,
  .packaging-visuals .service-card-photo,
  .banner-visuals .service-card-photo {
    width: calc(100% + 20px);
    max-width: none;
    margin: 0 -10px 10px;
    aspect-ratio: 16 / 9;
  }

  .signage-visuals .stamp-type-card h3,
  .sticker-visuals .stamp-type-card h3,
  .packaging-visuals .stamp-type-card h3,
  .banner-visuals .stamp-type-card h3 {
    margin-bottom: 5px;
    font-size: 13px;
    line-height: 1.25;
  }

  .signage-visuals .stamp-type-card > p,
  .sticker-visuals .stamp-type-card > p,
  .packaging-visuals .stamp-type-card > p,
  .banner-visuals .stamp-type-card > p {
    font-size: 11.5px;
    line-height: 1.42;
  }

  .visual-example-note {
    margin: -7px auto 14px;
    padding: 9px 10px;
    font-size: 11.5px;
    text-align: left;
  }

  .signage-visuals .stamp-type-card::after {
    top: 6px;
    right: 6px;
    max-width: calc(100% - 12px);
    padding: 3px 5px;
    font-size: 9px;
  }

  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .product-card-img,
  .product-card.no-product-image .product-card-img { height: 88px; min-height: 88px; }
  .product-card.no-product-image .product-card-img svg { width: 34px; height: 34px; }
  .product-card-body { min-height: 102px; padding: 10px 9px 8px; }
  .product-brand { min-height: 12px; font-size: 9px; }
  .product-name { min-height: 36px; font-size: 11.5px; line-height: 1.38; }
  .product-price { font-size: 13px; }
  .product-price small { font-size: 10px; }
  .product-card-actions { gap: 6px; padding: 0 8px 8px; }
  .btn-add,
  .btn-wa-quick { min-height: 44px; padding: 8px 6px; font-size: 10.5px; }

  body[data-page="stationery"] .catalog-section { padding-top: 22px; }
  body[data-page="stationery"] .catalog-toolbar { gap: 8px; }
  body[data-page="stationery"] .trust-badges .badge { padding: 5px 8px !important; font-size: 9.5px !important; }

  body[data-page="home"] .home-v2-hero { padding: 18px 0 20px; }
  body[data-page="home"] .home-v2-hero-grid { gap: 16px; }
  body[data-page="home"] .home-v2-eyebrow { margin-bottom: 7px; font-size: 10px; }
  body[data-page="home"] .home-v2-hero-copy h1 { font-size: clamp(30px, 8.8vw, 35px); line-height: 1; }
  html[lang="ms-MY"] body[data-page="home"] .home-v2-hero-copy h1 { font-size: clamp(29px, 8.35vw, 34px); }
  body[data-page="home"] .home-v2-hero-lead { margin-top: 9px; font-size: 13px; line-height: 1.45; }
  body[data-page="home"] .home-v2-category-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 11px;
  }
  body[data-page="home"] .home-v2-category-pills li { display: flex; min-width: 0; }
  body[data-page="home"] .home-v2-category-pills a {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    padding: 5px;
    font-size: 11px;
    text-align: center;
    white-space: normal;
  }
  body[data-page="home"] .home-v2-actions { flex-direction: row; gap: 7px; margin-top: 12px; }
  body[data-page="home"] .home-v2-actions .btn { width: auto; min-width: 0; min-height: 44px; flex: 1; padding: 9px 7px; font-size: 11.5px; }
  body[data-page="home"] .home-v2-hero-note { display: none; }
  body[data-page="home"] .home-v2-hero-media {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 6px;
  }
  body[data-page="home"] .home-v2-hero-photo,
  body[data-page="home"] .home-v2-hero-photo-main { grid-column: auto; aspect-ratio: 16 / 9; border-radius: 8px; }
  body[data-page="home"] .home-v2-hero-photo > span { left: 6px; bottom: 5px; font-size: 10px; }

  body[data-page="home"] .home-v2-trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-page="home"] .home-v2-trust-item,
  body[data-page="home"] .home-v2-trust-item:first-child,
  body[data-page="home"] .home-v2-trust-item:nth-child(2) { min-height: 76px; padding: 10px; }
  body[data-page="home"] .home-v2-trust-item::before { display: none; }
  body[data-page="home"] .home-v2-trust-item strong { font-size: 11.5px; }
  body[data-page="home"] .home-v2-trust-item span { margin-top: 3px; font-size: 11.5px; line-height: 1.4; }

  body[data-page="home"] .home-v2-section { padding: 28px 0; }
  body[data-page="home"] .home-v2-section-head { grid-template-columns: 1fr; gap: 7px; margin-bottom: 16px; text-align: left; }
  body[data-page="home"] .home-v2-section-head h2,
  body[data-page="home"] .home-v2-proof-copy h2,
  body[data-page="home"] .home-v2-area-copy h2,
  body[data-page="home"] .home-v2-faq-intro h2,
  body[data-page="home"] .home-v2-final-cta h2 { font-size: clamp(24px, 7vw, 29px); line-height: 1.08; }
  body[data-page="home"] .home-v2-section-head > p {
    display: block;
    overflow: visible;
    font-size: 12px;
    line-height: 1.46;
    -webkit-box-orient: initial;
    -webkit-line-clamp: unset;
  }
  body[data-page="home"] .home-v2-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body[data-page="home"] .home-v2-service-copy { padding: 9px; }
  body[data-page="home"] .home-v2-service-copy small { font-size: 10px; }
  body[data-page="home"] .home-v2-service-copy strong { font-size: 14px; }
  body[data-page="home"] .home-v2-service-copy em { margin-top: 4px; font-size: 12px; line-height: 1.4; }
  body[data-page="home"] .home-v2-service-copy b { margin-top: 6px; font-size: 11.5px; }
  body[data-page="home"] .home-v2-proof-points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
  body[data-page="home"] .home-v2-proof-points > div { display: block; padding: 10px; }
  body[data-page="home"] .home-v2-proof-points > div:last-child { grid-column: 1 / -1; }
  body[data-page="home"] .home-v2-proof-points p { font-size: 12px; line-height: 1.42; }
  body[data-page="home"] .home-v2-process-grid { gap: 7px; }
  body[data-page="home"] .home-v2-process-grid li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 2px 9px;
    padding: 11px;
  }
  body[data-page="home"] .home-v2-process-grid li > span { grid-row: 1 / span 2; margin: 0; }
  body[data-page="home"] .home-v2-process-grid h3 { margin: 0; font-size: 13px; }
  body[data-page="home"] .home-v2-process-grid p { margin: 2px 0 0; font-size: 12px; line-height: 1.42; }
  body[data-page="home"] .home-v2-brief-card { gap: 8px; margin-top: 9px; padding: 12px; }
  body[data-page="home"] .home-v2-area-grid,
  body[data-page="home"] .home-v2-faq-grid { gap: 18px; }
  body[data-page="home"] .home-v2-area-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  body[data-page="home"] .home-v2-area-links a { min-height: 0; padding: 11px; }
  body[data-page="home"] .home-v2-area-links strong { margin-top: 8px; font-size: 15px; }
  body[data-page="home"] .home-v2-area-links span { font-size: 12px; }
  body[data-page="home"] .home-v2-featured .product-card:nth-of-type(n+5) { display: none; }
  body[data-page="home"] .home-v2-final-cta { padding: 38px 0; }

  body[data-page="blog"] .blog-hero,
  body[data-page="blog"] .post-hero { padding: 26px 0 28px; }
  body[data-page="blog"] .blog-hero h1,
  body[data-page="blog"] .post-hero h1 { margin: 9px 0 10px; font-size: clamp(27px, 7.5vw, 31px); line-height: 1.08; }
  body[data-page="blog"] .blog-hero p,
  body[data-page="blog"] .post-hero .meta { font-size: 13px; line-height: 1.5; }
  body[data-page="blog"] .blog-list-wrap { padding: 28px 0 44px; }
  body[data-page="blog"] .blog-card { padding: 18px; margin-bottom: 12px; }
  body[data-page="blog"] .blog-card h2 { font-size: 18px; }
  body[data-page="blog"] .post-body { padding: 30px 0 50px; }
  body[data-page="blog"] .post-body p,
  body[data-page="blog"] .post-body li { font-size: 15px; line-height: 1.68; }
  body[data-page="blog"] .question-block { padding: 17px; margin: 14px 0; }

  body[data-page="about"] .about-layout,
  body[data-page="about"] .about-grid { grid-template-columns: minmax(0, 1fr) !important; }
  body[data-page="about"] .stats-grid,
  body[data-page="about"] .about-stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
  body[data-page="about"] .about-stat {
    min-width: 0;
    padding: 16px 10px;
  }
  body[data-page="about"] .about-stat-num {
    font-size: 30px;
    overflow-wrap: anywhere;
  }
  body[data-page="about"] .about-stat-lbl { font-size: 11.5px; line-height: 1.35; }

  body[data-page="contact"] .contact-map-wrap,
  body[data-page="contact"] .map-embed-container { min-height: 300px; }
  .map-placeholder { min-height: 300px; padding: 22px 16px; }
  .contact-map-frame { height: 300px; }

  body[data-page="product"] .product-detail-layout { grid-template-columns: 1fr; gap: 20px; }
  body[data-page="product"] .product-detail-img > img,
  body[data-page="product"] .product-img-placeholder-lg { height: 270px; min-height: 0; aspect-ratio: auto; }
  body[data-page="product"] .product-detail-name { font-size: 24px; }
  body[data-page="product"] .product-detail-price { font-size: 27px; }

  .auth-wrap { justify-content: flex-start !important; padding: 18px 12px !important; }
  .auth-card { max-width: 520px !important; padding: 24px 18px !important; }
  .auth-logo { margin-bottom: 17px !important; }
  .auth-title { font-size: 22px !important; }

  .site-footer { padding: 28px 0 20px; }
  .site-footer .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px;
    margin-bottom: 18px;
  }
  .site-footer .footer-brand { grid-column: 1 / -1; }
  .site-footer .footer-brand p { max-width: 100%; font-size: 12px; line-height: 1.5; }
  .site-footer .footer-col { display: grid; grid-template-columns: 1fr; gap: 0; min-width: 0; }
  .site-footer .footer-col h2 { margin-bottom: 4px; font-size: 11px; }
  .site-footer .footer-col a {
    min-height: 36px;
    margin: 0;
    padding: 8px 0;
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .site-footer .footer-bottom { gap: 5px; padding-top: 14px; align-items: flex-start; }
  .site-footer .footer-bottom p { font-size: 11px !important; line-height: 1.45; }

  body[data-page="404"] .nf-wrap { min-height: calc(100svh - 80px); padding: 34px 12px; }
  body[data-page="404"] .nf-code { font-size: clamp(76px, 25vw, 104px); }
  body[data-page="404"] .nf-title { font-size: 23px; }
  body[data-page="404"] .nf-sub { margin-bottom: 22px; font-size: 13px; line-height: 1.55; }
  body[data-page="404"] .nf-actions .btn { min-height: 44px; padding: 10px 13px; font-size: 11px; }
  body[data-page="404"] .nf-links { margin-top: 24px; padding-top: 16px; gap: 4px 14px; }
  body[data-page="404"] .nf-links a { min-height: 36px; display: inline-flex; align-items: center; }
}

@media (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .category-card,
  .product-card,
  .stamp-type-card,
  .service-card,
  .home-v2-service-card,
  .home-v2-service-card img,
  .home-v2-hero-photo img { transform: none !important; filter: none !important; }
}

/* Cart rows must stay readable when Malay labels are longer than English. */
@media (max-width: 768px) {
  body[data-page="cart"] .cart-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  body[data-page="cart"] .cart-items,
  body[data-page="cart"] .cart-summary { min-width: 0; }
  body[data-page="cart"] .cart-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "product product"
      "price price"
      "sub sub"
      "qty remove";
  }
  body[data-page="cart"] .cart-row-product,
  body[data-page="cart"] .cart-row-info,
  body[data-page="cart"] .cart-row-price,
  body[data-page="cart"] .cart-row-sub { min-width: 0; }
  body[data-page="cart"] .cart-row-price,
  body[data-page="cart"] .cart-row-sub { width: 100%; }
  body[data-page="cart"] .cart-row-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    justify-self: stretch;
    padding: 2px 0;
    text-align: left;
  }
  body[data-page="cart"] .cart-row-sub .cart-price-label {
    min-width: 0;
    margin: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body[data-page="cart"] .cart-row-remove { justify-self: end; }
}

/* Final phone ownership: this stylesheet loads after the historical layout and
   performance layers, so navigation and catalogue density are resolved here. */
@media (max-width: 640px) {
  #nav-placeholder:empty {
    height: 52px;
    background: #fff;
  }

  body[data-page="home"] .home-v2-hero-copy h1 {
    max-width: 320px;
    font-size: clamp(28px, 8.2vw, 32px);
  }
  body[data-page="home"] .home-v2-section-head h2,
  body[data-page="home"] .home-v2-proof-copy h2,
  body[data-page="home"] .home-v2-area-copy h2,
  body[data-page="home"] .home-v2-faq-intro h2,
  body[data-page="home"] .home-v2-final-cta h2 {
    font-size: clamp(24px, 6.8vw, 26.5px);
    line-height: 1.06;
  }

  body[data-page="stationery"] .catalog-toolbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 112px;
    gap: 6px;
    align-items: center;
    overflow: visible;
  }
  body[data-page="stationery"] .mobile-filter-btn {
    grid-column: 1;
    width: 44px;
    min-width: 44px;
    min-height: 42px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }
  body[data-page="stationery"] .mobile-filter-btn svg { width: 18px; height: 18px; }
  body[data-page="stationery"] .catalog-search-wrap {
    grid-column: 2;
    min-width: 0;
    width: auto;
  }
  body[data-page="stationery"] .catalog-sort-wrap {
    grid-column: 3;
    display: block;
    min-width: 0;
    width: auto;
  }
  body[data-page="stationery"] .sort-label { display: none; }
  body[data-page="stationery"] .catalog-sort {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 7px;
    font-size: 11px;
  }
}
