/* Round 3 — full mobile frontend density + 2-col product showcases + certs wall
   Desktop (≥861px) intentionally untouched. Mobile overrides win over round2. */

/* Hide leftover example badges if any cached HTML slips through */
.example-badge { display: none !important; }

/* Certificates: factory-wall pattern — image beside short text */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 1.25rem;
}
.certs-grid .cert-row,
.certs-grid article.cert-row {
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid #e4dfd4;
  border-radius: 4px;
  overflow: hidden;
  padding: 0;
}
.certs-grid .cert-row img {
  width: 100%;
  height: 100%;
  min-height: 88px;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.certs-grid .cert-copy {
  padding: 8px 10px 8px 0;
}
.certs-grid .cert-copy h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-family: "Playfair Display", serif;
  font-weight: 500;
  line-height: 1.25;
}
.certs-grid .cert-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #5a5e58;
}

@media (min-width: 861px) {
  .certs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .certs-grid .cert-row {
    grid-template-columns: 38% 1fr;
    gap: 14px;
  }
  .certs-grid .cert-copy h3 { font-size: 15px; }
  .certs-grid .cert-copy p { font-size: 13px; }
  .certs-grid .cert-row img { min-height: 110px; }
}


/* ===== Cases: compact cards (image + title + one short line) — all viewports ===== */
.cases-grid, #cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 1.1rem;
}
.cases-grid article, #cases-grid article,
.cases-grid .case-card, #cases-grid .case-card {
  background: #fff;
  border: 1px solid #e4dfd4;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}
.cases-grid img, #cases-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}
.cases-grid h3, #cases-grid h3 {
  font-size: 14px;
  line-height: 1.3;
  margin: 8px 10px 4px;
  font-family: "Playfair Display", serif;
  font-weight: 500;
}
.cases-grid p, #cases-grid p {
  font-size: 12px;
  line-height: 1.4;
  color: #5a5e58;
  margin: 0 10px 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 860px) {
  .cases-grid, #cases-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .cases-grid h3, #cases-grid h3 { font-size: 12px !important; margin: 6px 8px 2px !important; }
  .cases-grid p, #cases-grid p { font-size: 11px !important; margin: 0 8px 8px !important; -webkit-line-clamp: 2; }
}

/* ===== MOBILE ENTIRE LAYOUT REDO ===== */
@media (max-width: 860px) {
  html { font-size: 15px; }
  body {
    font-size: 14px !important;
    line-height: 1.5;
  }
  body, button, input, select, textarea, label, span, p, a {
    font-size: inherit;
  }
  small, .library-note, .catalogue-footer span, .contact-direct span,
  .card p, .library-card p, .card span, .library-card span {
    font-size: 12px !important;
  }

  /* Header / chrome */
  header {
    padding: 10px 14px !important;
    height: auto !important;
    min-height: 52px;
  }
  header .logo { font-size: 1.05rem !important; }
  .quick-nav {
    gap: 10px !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    overflow-x: auto;
    white-space: nowrap;
  }
  .quick-nav a { font-size: 12px !important; }

  /* Hero — compact */
  .hero, section.hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 14px 12px !important;
  }
  .hero h1, .hero-copy h1 {
    font-size: clamp(1.55rem, 7vw, 1.9rem) !important;
    line-height: 1.15 !important;
    margin: 0 0 8px !important;
  }
  .hero-lead, #hero-lead, .hero p {
    font-size: 13px !important;
    line-height: 1.45 !important;
    margin: 0 0 12px !important;
  }
  .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 !important;
  }
  .hero-actions .button, .hero-actions .underlink {
    min-height: 44px;
    font-size: 13px !important;
    width: 100%;
    justify-content: center;
  }
  .hero-art {
    margin: 0 !important;
    border-radius: 4px;
    overflow: hidden;
  }
  .hero-art img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
  }
  .hero-label {
    font-size: 11px !important;
    padding: 6px 8px !important;
  }

  /* Metrics — dense 2x2 */
  .metrics {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 12px 14px !important;
  }
  .metrics > div {
    padding: 10px 10px !important;
    min-height: 0 !important;
    font-size: 12px !important;
  }
  .metrics strong {
    font-size: 1.05rem !important;
    margin-bottom: 2px !important;
    line-height: 1.2;
  }
  .metrics span { font-size: 11px !important; line-height: 1.35; }

  /* Sections general */
  .section, .about, .products, .capability, .extras-block, .contact {
    padding: 22px 14px !important;
  }
  .section-intro { margin-bottom: 12px !important; }
  .section-intro .kicker, .kicker {
    font-size: 11px !important;
    margin-bottom: 6px !important;
    letter-spacing: .04em;
  }
  .section-intro h2, .about h2, .products h2, .capability h2 {
    font-size: clamp(1.25rem, 5.5vw, 1.55rem) !important;
    line-height: 1.2 !important;
    margin: 0 0 8px !important;
  }
  .about-body p, .lead, #about-lead, #about-body {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  /* Trust strip compact */
  .trust-strip {
    padding: 10px 14px !important;
    gap: 8px !important;
    font-size: 12px !important;
    overflow-x: auto;
    flex-wrap: nowrap !important;
  }
  .trust-strip span, .trust-strip p { font-size: 12px !important; white-space: nowrap; }

  /* Category pills */
  #category-nav {
    display: flex !important;
    gap: 6px !important;
    overflow-x: auto;
    padding: 0 0 10px !important;
    margin-bottom: 8px !important;
  }
  #category-nav button {
    flex: 0 0 auto;
    min-height: 36px !important;
    padding: .4rem .7rem !important;
    font-size: 12px !important;
  }
  #category-nav small { font-size: 10px !important; }

  /* ===== PRODUCT SHOWCASES: large 2-col, image-forward ===== */
  #catalogue,
  .catalogue,
  .library-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    border: 0 !important;
  }
  #catalogue .card,
  .catalogue .card,
  .library-card {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #c8c7c0 !important;
    border-radius: 4px;
    overflow: hidden;
    background: #f7f5f0;
    position: relative;
  }
  #catalogue .card img,
  .catalogue .card img,
  .library-card img,
  .library-card .sample-image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    mix-blend-mode: normal !important;
    display: block;
    background: #ebe7df;
  }
  #catalogue .card .card-info,
  .catalogue .card .card-info,
  .library-card > p,
  .library-card > h3,
  .library-card > span {
    padding-left: 8px;
    padding-right: 8px;
  }
  #catalogue .card .card-info {
    padding: 8px 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  #catalogue .card p,
  .library-card p {
    margin: 8px 0 0 !important;
    font-size: 10px !important;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  #catalogue .card h3,
  .library-card h3 {
    margin: 2px 0 0 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    font-weight: 500;
  }
  #catalogue .card span,
  .library-card span {
    margin: 2px 0 8px !important;
    font-size: 11px !important;
  }
  #catalogue .card .card-arrow,
  .library-card i {
    position: absolute;
    right: 8px;
    bottom: 8px;
    font-size: 12px;
    opacity: .55;
  }
  .catalogue-footer {
    margin-top: 12px !important;
    font-size: 12px !important;
    gap: 8px;
  }

  /* Custom steps compact */
  #custom-steps {
    display: flex;
    flex-direction: column;
    gap: 8px !important;
  }
  #custom-steps article {
    padding: 12px !important;
  }
  #custom-steps h3 { font-size: 14px !important; }
  #custom-steps p { font-size: 12px !important; }
  #custom-steps b { font-size: 12px !important; }

  /* Factory wall stays 2-col dense */
  #factory-wall, .factory-wall {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin-top: 12px !important;
  }
  #factory-wall img, .factory-wall img {
    aspect-ratio: 4/3;
    border-radius: 3px;
  }

  /* Certs: 1-col of horizontal rows on narrow phones; still side-by-side image|text */
  #certs-grid, .certs-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  #certs-grid .cert-row {
    grid-template-columns: 36% 1fr !important;
    gap: 8px !important;
  }
  #certs-grid .cert-copy h3 { font-size: 13px !important; }
  #certs-grid .cert-copy p { font-size: 12px !important; }

  /* Cases 2-col compact */
  #cases-grid, .cases-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  #cases-grid article {
    border-radius: 4px;
  }
  #cases-grid img {
    aspect-ratio: 4/3;
  }
  #cases-grid h3 {
    font-size: 12px !important;
    margin: 6px 8px 2px !important;
  }
  #cases-grid p {
    font-size: 11px !important;
    margin: 0 8px 8px !important;
  }

  /* Contact / form */
  .inquiry-form, #inquiry-form {
    gap: 10px !important;
  }
  #inquiry-form input, #inquiry-form textarea, #inquiry-form select, #inquiry-form button {
    min-height: 44px;
    font-size: 16px; /* iOS zoom prevention */
    width: 100%;
    box-sizing: border-box;
  }
  #inquiry-form textarea { min-height: 100px; }
  .contact h2 { font-size: 1.35rem !important; }

  /* Footer compact */
  footer {
    padding: 18px 14px !important;
    font-size: 12px !important;
  }
  footer a, footer p, footer span { font-size: 12px !important; }

  /* Kill old mobile-ux full-bleed negative margins + restore symmetric gutters */
  #catalogue, .catalogue,
  #library-grid, .library-grid,
  #category-tabs, .category-tabs,
  #category-nav, .category-nav,
  .library-controlbar,
  .category-page .library-controlbar,
  .category-page.compact .library-controlbar {
    margin-inline: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .library-controlbar,
  .category-page .library-controlbar,
  .category-page.compact .library-controlbar {
    padding-inline: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .section.products, #products.products {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .category-page-inner {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* ===== CATALOG PAGE: shrink oversized header, 2-col showcases ===== */
  .category-page, #category-page {
    padding: 0 !important;
  }
  .category-page-bar {
    height: 52px !important;
    padding: 0 12px !important;
  }
  .category-page-bar .logo { font-size: 15px !important; }
  .category-page-inner {
    padding: 14px 14px 40px !important;
    box-sizing: border-box !important;
  }
  .category-page-inner .library-controlbar,
  .category-page-inner #category-tabs,
  .category-page-inner .library-grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .category-intro {
    display: block !important;
    margin-bottom: 12px !important;
    padding: 0 !important;
  }
  .category-intro .kicker,
  .category-intro > .eyebrow,
  .category-intro p.kicker {
    font-size: 11px !important;
    margin: 0 0 4px !important;
  }
  .category-intro h1 {
    font-size: clamp(1.35rem, 6vw, 1.7rem) !important;
    line-height: 1.15 !important;
    margin: 0 0 6px !important;
  }
  .category-intro > p {
    width: auto !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
  }
  #category-tabs, .category-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 !important;
    margin-bottom: 10px !important;
  }
  #category-tabs button, .category-tabs button {
    min-height: 40px !important;
    padding: 10px 10px !important;
    font-size: 13px !important;
  }
  #category-tabs button span, .category-tabs button span {
    font-size: 10px !important;
    margin-top: 2px !important;
  }
  .library-tools, .filters-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px 0 8px !important;
    align-items: stretch !important;
  }
  .library-tools select, .library-toolbar select,
  #filter-style, #filter-nature, #sort-products {
    width: 100%;
    min-height: 40px;
    font-size: 13px !important;
  }
  .library-count, .library-tools label {
    font-size: 12px !important;
  }
  .pagination {
    margin-top: 16px !important;
    gap: 6px;
  }
  .pagination button {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  /* Modal mobile already dual — keep readable */
  #product-modal .pm-mob h2 {
    font-size: 1.15rem !important;
  }
  #product-modal .pm-mob p,
  #product-modal .pm-mob li,
  #product-modal .pm-mob span {
    font-size: 13px !important;
  }
}
