/*
Theme Name: CIM Precision
Theme URI: https://example.com/
Author: CIM Precision
Author URI: https://example.com/
Description: Custom WordPress theme for CIM Precision machine tools homepage. Built with a React frontend for the home page.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ckt-precision
Tags: custom-homepage, dark, industrial, machine-tools, ecommerce, responsive
*/

/* WordPress core alignment classes */
.alignnone {
  margin: 5px 20px 20px 0;
}
.aligncenter,
div.aligncenter {
  display: block;
  margin: 5px auto 5px auto;
}
.alignright {
  float: right;
  margin: 5px 0 20px 20px;
}
.alignleft {
  float: left;
  margin: 5px 20px 20px 0;
}
a img.alignright {
  float: right;
  margin: 5px 0 20px 20px;
}
a img.alignnone {
  margin: 5px 20px 20px 0;
}
a img.alignleft {
  float: left;
  margin: 5px 20px 20px 0;
}
a img.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.wp-caption {
  background: #fff;
  border: 1px solid #f0f0f0;
  max-width: 96%;
  padding: 5px 3px 10px;
  text-align: center;
}
.wp-caption.alignnone {
  margin: 5px 20px 20px 0;
}
.wp-caption.alignleft {
  margin: 5px 20px 20px 0;
}
.wp-caption.alignright {
  margin: 5px 0 20px 20px;
}
.wp-caption img {
  border: 0 none;
  height: auto;
  margin: 0;
  max-width: 98.5%;
  padding: 0;
  width: auto;
}
.wp-caption p.wp-caption-text {
  font-size: 11px;
  line-height: 17px;
  margin: 0;
  padding: 0 4px 5px;
}

/* ============================================================
   CIM Precision - Product Templates Styles
   ============================================================ */

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1a1a1a; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* React homepage (Latest News): the global `img { height: auto }` above is
   unlayered, so it beats Tailwind v4's layered `h-full` utility. Without
   this override the news card featured images render at their natural aspect
   ratio and get clipped instead of cover-filling the 200px card. Force the
   news card images to fill the container so object-fit:cover works. */
#news article img { height: 100%; }

.cim-container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ---- Navigation ---- */
.cim-product-nav {
  position: sticky; top: 0; z-index: 100;
  background: #ffffff; border-bottom: 1px solid #e5e5e5;
}
.cim-product-nav .cim-container {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.cim-nav-logo {
  font-weight: 800; font-size: 20px; letter-spacing: 0.05em; color: #1a1a1a;
}
.cim-nav-menu {
  display: flex; gap: 36px; list-style: none; margin: 0; padding: 0;
}
.cim-nav-menu a {
  font-size: 14px; font-weight: 500; color: #4a4a4a; transition: color 0.2s;
}
.cim-nav-menu a:hover, .cim-nav-menu a.active { color: #e85d10; }

.cim-btn {
  display: inline-block; padding: 10px 24px;
  font-size: 14px; font-weight: 600; text-align: center;
  border-radius: 6px; cursor: pointer; transition: all 0.2s;
  border: none;
}
.cim-btn-sm { padding: 8px 18px; font-size: 13px; }
.cim-btn-primary { background: #e85d10; color: #ffffff; }
.cim-btn-primary:hover { background: #c44a0c; }
.cim-btn-block { display: block; width: 100%; }

/* ---- Breadcrumb ---- */
.cim-breadcrumb {
  padding: 14px 0; background: #f8f8f8; font-size: 13px; color: #666;
  border-bottom: 1px solid #eee;
}
.cim-breadcrumb a { color: #666; }
.cim-breadcrumb a:hover { color: #e85d10; }
.cim-breadcrumb span { color: #1a1a1a; }

/* ============================================================
   Single Product Template
   ============================================================ */
.cim-product-main { padding: 40px 0; }
.cim-product-layout {
  display: grid; grid-template-columns: 1fr 380px; gap: 48px;
  align-items: start;
}

/* Left Column */
.cim-product-left { min-width: 0; }

/* Gallery */
.cim-product-gallery {
  margin-bottom: 40px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.cim-gallery-main {
  position: relative; flex: 1; aspect-ratio: 1 / 1;
  background: #f5f5f5; border-radius: 8px; overflow: hidden;
}
.cim-gallery-main img {
  width: 100%; height: 100%; object-fit: contain; padding: 20px;
  transition: opacity 0.3s;
}
.cim-gallery-dots {
  display: flex; flex-direction: column; gap: 10px; flex-shrink: 0;
}
.cim-gallery-dot {
  width: 100px; height: 100px; padding: 4px; border: 2px solid transparent;
  border-radius: 6px; cursor: pointer; background: #f0f0f0;
  overflow: hidden; transition: all 0.2s;
}
.cim-gallery-dot:hover { border-color: #999; }
.cim-gallery-dot.active { border-color: #e85d10; }
.cim-gallery-dot img { width: 100%; height: 100%; object-fit: cover; }

/* Description */
.cim-product-description { margin-top: 24px; }

/* Product Tabs (Product Details / Product Parameter) */
.cim-product-tabs { margin-top: 24px; }
.cim-tab-nav {
  display: flex; gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 24px;
}
.cim-tab-btn {
  padding: 12px 24px;
  font-size: 15px; font-weight: 600;
  color: #6e7f8d;
  background: none; border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.cim-tab-btn:hover { color: #e85d10; }
.cim-tab-btn.active {
  color: #1a1a1a;
  border-bottom-color: #e85d10;
}
.cim-tab-panel { display: none; }
.cim-tab-panel.active { display: block; }

/* Product Parameter list */
.cim-param-list-wrapper { padding: 0; }
.cim-param-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 16px;
}
.cim-param-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; width: 120px;
  padding: 12px; border: 1px solid #e5e7eb; border-radius: 6px;
  text-align: center;
}
.cim-param-img {
  width: 80px; height: 80px;
  object-fit: contain;
}
.cim-param-name {
  font-size: 13px; font-weight: 600; color: #1a1a1a;
  word-break: break-word;
}
.cim-no-data { color: #9ca3af; font-style: italic; }

.cim-section-title {
  font-size: 24px; font-weight: 700; margin: 0 0 20px;
  color: #1a1a1a; padding-bottom: 12px; border-bottom: 2px solid #e85d10;
  display: inline-block;
}
.cim-description-content {
  font-size: 15px; line-height: 1.8; color: #333;
}
.cim-description-content p { margin: 0 0 16px; }
.cim-description-content img { border-radius: 6px; margin: 16px 0; }

/* Right Column (Sticky) */
.cim-product-right { position: sticky; top: 96px; }
.cim-product-info {
  background: #ffffff; border: 1px solid #e5e5e5; border-radius: 12px;
  padding: 32px;
}
.cim-product-title {
  font-size: 28px; font-weight: 700; margin: 0 0 16px;
  color: #1a1a1a; line-height: 1.3;
}
.cim-product-code {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #eee;
}
.cim-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: #888;
}
.cim-code-value {
  font-size: 16px; font-weight: 600; color: #e85d10;
  font-family: 'Courier New', monospace;
}

/* Features */
.cim-product-features { margin: 16px 0; }
.cim-feature-list {
  list-style: none; margin: 12px 0 0; padding: 0;
}
.cim-feature-list li {
  position: relative; padding-left: 24px; margin-bottom: 8px;
  font-size: 14px; line-height: 1.5; color: #333;
}
.cim-feature-list li::before {
  content: "★"; position: absolute; left: 0; top: 0;
  color: #e85d10; font-size: 14px;
}

/* Divider */
.cim-divider { height: 1px; background: #e5e5e5; margin: 20px 0; }

/* Specifications */
.cim-product-specs { margin: 16px 0; }
.cim-specs-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-top: 12px;
}
.cim-spec-item {
  background: #f8f8f8; border-radius: 8px; padding: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
}
.cim-spec-item.cim-spec-image img {
  width: 100%; height: 80px; object-fit: contain;
}
.cim-spec-label { font-size: 12px; color: #666; font-weight: 500; }
.cim-spec-value { font-size: 13px; color: #1a1a1a; font-weight: 600; }

/* Quote Button */
.cim-product-quote { margin-top: 24px; }
.cim-quote-note {
  font-size: 12px; color: #888; text-align: center; margin: 10px 0 0;
}

/* Placeholders */
.cim-gallery-placeholder,
.cim-product-card-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; background: #f0f0f0;
  color: #999; font-size: 14px;
}

/* ============================================================
   Related Products
   ============================================================ */
.cim-related-products {
  padding: 60px 0; background: #f8f8f8; margin-top: 60px;
}
.cim-related-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.cim-related-card {
  background: #ffffff; border-radius: 8px; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cim-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.cim-related-img { aspect-ratio: 1 / 1; background: #f5f5f5; }
.cim-related-img img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.cim-related-info { padding: 16px; }
.cim-related-info h3 {
  font-size: 15px; font-weight: 600; margin: 0 0 6px;
  color: #1a1a1a;
}
.cim-related-code {
  font-size: 12px; color: #e85d10; font-family: 'Courier New', monospace;
}

/* ============================================================
   Archive Product Template
   ============================================================ */
.cim-archive-header {
  padding: 60px 0 40px; background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  color: #ffffff;
}
.cim-archive-title {
  font-size: 42px; font-weight: 800; margin: 0 0 16px;
}
.cim-archive-subtitle {
  font-size: 16px; line-height: 1.6; color: #ccc; max-width: 680px; margin: 0;
}

.cim-archive-content { padding: 60px 0; }

/* Archive Layout: Sticky Sidebar + Main Grid */
.cim-archive-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}
.cim-archive-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
}
.cim-archive-sidebar-inner {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cim-sidebar-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a1a1a;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e85d10;
}
.cim-sidebar-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cim-sidebar-cat-list li { margin: 0; }

/* Category row: link (left) + toggle button (right) */
.cim-cat-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.cim-cat-row > a {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #4a5563;
  text-decoration: none;
  transition: all 0.18s ease;
  line-height: 1.3;
  min-width: 0;
}
.cim-cat-row > a:hover {
  background: #fdf0e8;
  color: #e85d10;
}
.cim-cat-row > a.is-active {
  background: #e85d10;
  color: #ffffff;
}
.cim-cat-row > a.is-active:hover {
  background: #c44a0c;
  color: #ffffff;
}
.cim-cat-name { flex: 1; }

/* Toggle button (right side) */
.cim-cat-toggle {
  flex-shrink: 0;
  width: 24px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #9aa4ae;
  padding: 0;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.cim-cat-toggle:hover {
  color: #e85d10;
  background: #fdf0e8;
}
.cim-cat-chevron {
  transition: transform 0.2s ease;
}
.cim-cat-item.is-expanded > .cim-cat-row > .cim-cat-toggle .cim-cat-chevron {
  transform: rotate(90deg);
}

/* Nested subcategory list */
.cim-sidebar-sublist {
  margin-left: 16px;
  padding-left: 10px;
  border-left: 1px solid #e5e7eb;
  /* Collapsed by default */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s ease, padding 0.2s ease;
}
.cim-sidebar-sublist.is-expanded {
  max-height: 1000px;
  opacity: 1;
  margin-top: 2px;
  margin-bottom: 4px;
}
.cim-sidebar-sublist .cim-cat-row > a {
  font-size: 14px;
  padding: 8px 10px;
  color: #4a5563;
}

/* Hot Tags section */
.cim-sidebar-tags {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}
.cim-sidebar-tags .cim-sidebar-title {
  margin-bottom: 14px;
}

/* Sidebar Search */
.cim-sidebar-search {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}
.cim-sidebar-search-form {
  display: flex;
  align-items: stretch;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.cim-sidebar-search-form:focus-within {
  border-color: #e85d10;
  box-shadow: 0 0 0 3px rgba(232,93,16,0.12);
}
.cim-sidebar-search-field {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border: none;
  background: #ffffff;
  color: #1a1a1a;
}
.cim-sidebar-search-field::placeholder { color: #9ca3af; }
.cim-sidebar-search-field:focus { outline: none; }
.cim-sidebar-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  flex-shrink: 0;
  border: none;
  border-left: 1px solid #d1d5db;
  background: #f9fafb;
  color: #4b5563;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.cim-sidebar-search-btn:hover {
  background: #e85d10;
  color: #ffffff;
}
.cim-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cim-tag-badge {
  display: inline-block;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #4a5563;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.18s ease;
  line-height: 1.3;
}
.cim-tag-badge:hover {
  background: #fdf0e8;
  border-color: #e85d10;
  color: #e85d10;
}
.cim-tag-badge.is-active {
  background: #e85d10;
  border-color: #e85d10;
  color: #ffffff;
}
.cim-tag-badge.is-active:hover {
  background: #c44a0c;
  border-color: #c44a0c;
  color: #ffffff;
}

.cim-archive-main { min-width: 0; }

.cim-product-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.cim-product-card {
  background: #ffffff; border: 1px solid #e5e5e5; border-radius: 12px;
  overflow: hidden; transition: all 0.25s;
}
.cim-product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  border-color: #e85d10;
}
.cim-product-card-img-link {
  display: block; text-decoration: none; color: inherit;
}
.cim-product-card-img {
  aspect-ratio: 1 / 1; background: #f5f5f5;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cim-product-card-img img {
  width: 100%; height: 100%; object-fit: contain; padding: 24px;
}
.cim-product-card-info { padding: 20px; }
.cim-product-card-terms {
  margin-bottom: 10px;
  font-size: 12px; line-height: 1.5;
  color: #9ca3af;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cim-product-card-term {
  color: #9ca3af; text-decoration: none;
  transition: color 0.15s;
}
.cim-product-card-term:hover {
  color: #e85d10;
}
.cim-product-card-sep {
  color: #d1d5db;
}
.cim-product-card-info h3 a {
  text-decoration: none; color: inherit;
}
.cim-product-card-link {
  text-decoration: none;
}
.cim-product-card-title {
  font-size: 18px; font-weight: 600; margin: 0 0 10px;
  color: #1a1a1a; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.cim-product-card-link {
  font-size: 13px; font-weight: 600; color: #e85d10;
  transition: color 0.2s;
}
.cim-product-card:hover .cim-product-card-link { color: #c44a0c; }

/* Pagination */
.cim-pagination {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 48px; font-size: 14px;
}
.cim-pagination a, .cim-pagination .current {
  padding: 10px 16px; border-radius: 6px;
  border: 1px solid #e5e5e5; background: #fff; color: #333;
  font-weight: 500;
}
.cim-pagination a:hover { border-color: #e85d10; color: #e85d10; }
.cim-pagination .current {
  background: #e85d10; color: #fff; border-color: #e85d10;
}

/* CTA Section */
.cim-archive-cta {
  padding: 80px 0; background: #f8f8f8; text-align: center;
}
.cim-archive-cta h2 {
  font-size: 28px; font-weight: 700; margin: 0 0 12px;
}
.cim-archive-cta p { font-size: 16px; color: #666; margin: 0 0 24px; }
.cim-no-products { text-align: center; font-size: 18px; color: #888; padding: 60px 0; }

/* ============================================================
   Product Specification Section
   ============================================================ */

/* Gutenberg block content (bottom of left column) */
.cim-product-content {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e5e7eb;
}
.cim-product-content > *:first-child {
  margin-top: 0;
}
.cim-product-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
.cim-product-content h2,
.cim-product-content h3,
.cim-product-content h4 {
  margin: 24px 0 12px;
  color: #1a1a1a;
}
.cim-product-content h2 { font-size: 22px; }
.cim-product-content h3 { font-size: 18px; }
.cim-product-content p {
  margin: 0 0 16px;
  line-height: 1.7;
  color: #333;
}
.cim-product-content ul,
.cim-product-content ol {
  margin: 0 0 16px;
  padding-left: 24px;
}
.cim-product-content li {
  margin-bottom: 6px;
  line-height: 1.7;
  color: #333;
}
.cim-product-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

/* Right-side Optional Specifications summary
   - Left-right (row) layout: thumbnail on the left, name on the right.
   - On hover, an enlarged floating preview of the image appears. */
.cim-product-specs-summary {
  margin-top: 12px;
}
.cim-spec-summary-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  /* Responsive grid: 1-3 columns based on available width.
     max(140px, (100% - 2*gap)/3) caps the column count at 3 — when the
     container is wide each column is forced to ~1/3 so a 4th can't fit;
     when narrow, columns fall back to the 140px minimum (1 or 2 columns). */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(140px, calc((100% - 16px) / 3)), 1fr));
  gap: 8px;
}
/* Higher specificity (.cim-spec-summary-list .cim-spec-item = 0,2,0) overrides
   the shared .cim-spec-item rule (flex-direction: column etc.) so the
   thumbnail sits left of the name inside each grid cell. */
.cim-spec-summary-list .cim-spec-item {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 0;
  background: #ffffff;
  border: 1px solid #eef0f2;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.cim-spec-summary-list .cim-spec-item:hover {
  background: #f8f8f8;
  border-color: #e85d10;
}
.cim-spec-img {
  width: 40px; height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  transition: border-color 0.2s ease;
}
.cim-spec-summary-list .cim-spec-item:hover .cim-spec-img {
  border-color: #e85d10;
}
.cim-spec-name {
  color: #1a1a1a;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

/* Floating enlarged preview — hidden by default; JS positions it with
   position:fixed on row hover and clamps the coordinates so it always
   stays inside the visible viewport (handles top/bottom rows and the
   sticky column scrolling). Width is 780px, capped to the viewport. */
.cim-spec-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 500px;
  max-width: calc(100vw - 16px);
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 8px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ============================================================
   Responsive Styles
   ============================================================ */
@media (max-width: 1024px) {
  .cim-product-layout { grid-template-columns: 1fr; }
  .cim-product-right { position: static; }
  .cim-related-grid { grid-template-columns: repeat(2, 1fr); }
  .cim-product-grid { grid-template-columns: repeat(2, 1fr); }
  /* Stack sidebar above product grid on tablet */
  .cim-archive-layout { grid-template-columns: 1fr; gap: 24px; }
  .cim-archive-sidebar { position: static; }
}
@media (max-width: 768px) {
  .cim-nav-menu { display: none; }
  .cim-product-title { font-size: 22px; }
  .cim-product-info { padding: 20px; }
  .cim-product-gallery { flex-direction: column; }
  .cim-gallery-dots { flex-direction: row; flex-wrap: wrap; }
  .cim-gallery-dot { width: 48px; height: 48px; }
  .cim-specs-grid { grid-template-columns: 1fr; }
  .cim-related-grid { grid-template-columns: 1fr; }
  .cim-product-grid { grid-template-columns: 1fr; }
  .cim-archive-title { font-size: 32px; }
}

/* ============================================================
   Product Footer
   ============================================================ */
.cim-product-footer {
  background: #1a1a1a; color: #ccc; padding: 48px 0 24px;
  margin-top: 0;
}
.cim-product-footer h4 {
  color: #fff; font-size: 14px; font-weight: 700;
  margin: 0 0 16px; text-transform: uppercase; letter-spacing: 0.05em;
}
.cim-product-footer p { color: #999; margin: 0; font-size: 14px; }
.cim-product-footer ul { list-style: none; padding: 0; margin: 0; }
.cim-product-footer li { margin-bottom: 8px; }
.cim-product-footer a { color: #999; font-size: 14px; transition: color 0.2s; }
.cim-product-footer a:hover { color: #fff; }
.cim-footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px;
  padding-bottom: 32px; border-bottom: 1px solid #333;
}
.cim-footer-bottom { padding-top: 24px; text-align: center; }
.cim-footer-bottom p { font-size: 13px; }

/* Remove default theme header/footer styling on product pages */
.product-page #masthead,
.product-page #colophon {
  display: none !important;
}
.product-page #page { max-width: none; }

/* ============================================================
   News Archive Template (page-news.php)
   - Two-column layout: posts list (left) + sidebar (right)
   - Each post is a horizontal card: image left, body right
   ============================================================ */
.cim-news-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}
.cim-news-main { min-width: 0; }
.cim-news-sidebar { position: sticky; top: 24px; align-self: start; }

.cim-news-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Horizontal post card: image left, content right */
.cim-news-item {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 24px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.cim-news-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.10);
  border-color: #e85d10;
}
.cim-news-item-img-link {
  display: block;
  flex: 0 0 320px;
  width: 320px;
  text-decoration: none;
  color: inherit;
}
.cim-news-item-img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  background: #f5f5f5;
  overflow: hidden;
}
.cim-news-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.cim-news-item:hover .cim-news-item-img img { transform: scale(1.05); }
.cim-news-item-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 14px;
}
.cim-news-item-body {
  flex: 1;
  min-width: 0;
  padding: 24px 24px 24px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cim-news-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.cim-news-item-cat {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: #e85d10;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(232,93,16,0.1);
  padding: 3px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.18s;
}
.cim-news-item-cat:hover { background: rgba(232,93,16,0.2); }
.cim-news-item-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: #9aa4ae;
}
.cim-news-item-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 10px;
  color: #1a1a1a;
}
.cim-news-item-title a {
  text-decoration: none;
  color: inherit;
  transition: color 0.18s;
}
.cim-news-item-title a:hover { color: #e85d10; }
.cim-news-item-excerpt {
  font-size: 14px;
  line-height: 1.7;
  color: #555;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cim-news-item-read {
  font-size: 13px;
  font-weight: 600;
  color: #e85d10;
  text-decoration: none;
  align-self: flex-start;
  transition: color 0.18s;
}
.cim-news-item-read:hover { color: #c44a0c; }

/* Category count badge in sidebar */
.cim-cat-count {
  color: #9aa4ae;
  font-weight: 400;
  font-size: 12px;
}

/* Responsive: stack on tablet/mobile */
@media (max-width: 1024px) {
  .cim-news-layout { grid-template-columns: 1fr; gap: 24px; }
  .cim-news-sidebar { position: static; }
}
@media (max-width: 768px) {
  .cim-news-item { flex-direction: column; }
  .cim-news-item-img-link { flex: none; width: 100%; }
  .cim-news-item-img { min-height: 180px; }
  .cim-news-item-body { padding: 20px; }
  .cim-news-item-title { font-size: 18px; }
}

/* ============================================================
   Single Post Template (single.php)
   ============================================================ */
.cim-single-post { padding: 48px 0 80px; }
.cim-single-post-container { max-width: 820px; }

.cim-single-post-header { margin-bottom: 28px; }
.cim-single-post-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.cim-single-post-title {
  font-size: 36px; font-weight: 800; line-height: 1.25;
  margin: 0; color: #1a1a1a;
}

.cim-single-post-featured {
  width: 100%; margin-bottom: 32px;
  border-radius: 12px; overflow: hidden;
  background: #f5f5f5;
}
.cim-single-post-featured img {
  width: 100%; max-height: 460px; object-fit: cover; display: block;
}

/* Article content typography */
.cim-single-post-content { font-size: 16px; line-height: 1.8; color: #2a2a2a; }
.cim-single-post-content > *:first-child { margin-top: 0; }
.cim-single-post-content p { margin: 0 0 20px; }
.cim-single-post-content h2,
.cim-single-post-content h3,
.cim-single-post-content h4 {
  margin: 32px 0 14px; color: #1a1a1a; line-height: 1.3;
}
.cim-single-post-content h2 { font-size: 26px; }
.cim-single-post-content h3 { font-size: 21px; }
.cim-single-post-content h4 { font-size: 18px; }
.cim-single-post-content a { color: #e85d10; text-decoration: underline; }
.cim-single-post-content a:hover { color: #c44a0c; }
.cim-single-post-content img {
  max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0;
}
.cim-single-post-content ul,
.cim-single-post-content ol { margin: 0 0 20px; padding-left: 26px; }
.cim-single-post-content li { margin-bottom: 8px; }
.cim-single-post-content blockquote {
  margin: 24px 0; padding: 16px 24px;
  border-left: 4px solid #e85d10; background: #f8f8f8;
  font-style: italic; color: #555;
}
.cim-single-post-content pre {
  background: #1a1a1a; color: #f0f2f4; padding: 18px 22px;
  border-radius: 8px; overflow-x: auto; margin: 24px 0;
  font-size: 14px; line-height: 1.6;
}
.cim-single-post-content code {
  font-family: 'Courier New', monospace; font-size: 0.9em;
}
.cim-single-post-content :not(pre) > code {
  background: #f3f4f6; padding: 2px 6px; border-radius: 4px; color: #c44a0c;
}
.cim-single-post-content table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
}
.cim-single-post-content th,
.cim-single-post-content td {
  border: 1px solid #e5e7eb; padding: 10px 14px; text-align: left;
}
.cim-single-post-content th { background: #f8f8f8; font-weight: 700; }
.cim-single-post-content .page-links { margin-top: 24px; }
.cim-single-post-content .wp-caption {
  max-width: 100%; margin: 20px 0;
}
.cim-single-post-content .wp-caption-text {
  font-size: 13px; color: #888; text-align: center; margin-top: 6px;
}

/* Tags + back link + post navigation */
.cim-single-post-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 36px;
}
.cim-single-post-back { margin-top: 20px; }
.cim-single-post-back a {
  font-size: 14px; font-weight: 600; color: #e85d10; text-decoration: none;
  transition: color 0.18s;
}
.cim-single-post-back a:hover { color: #c44a0c; }

.cim-single-post-nav {
  display: flex; justify-content: space-between; gap: 24px;
  margin-top: 36px; flex-wrap: wrap;
}
.cim-single-post-nav a {
  font-size: 14px; color: #4a5563; text-decoration: none;
  transition: color 0.18s;
}
.cim-single-post-nav a:hover { color: #e85d10; }
.cim-post-nav-next { text-align: right; }

@media (max-width: 768px) {
  .cim-single-post-title { font-size: 26px; }
  .cim-single-post-featured img { max-height: 280px; }
  .cim-single-post-content { font-size: 15px; }
  .cim-single-post-content h2 { font-size: 22px; }
  .cim-single-post-content h3 { font-size: 18px; }
}

/* ============================================================
   Site Footer (matches home page footer)
   ============================================================ */
.cim-site-footer {
  background-color: #080a0c;
  border-top: 1px solid #1a2028;
  color: #f0f2f4;
}
.cim-site-footer-inner { padding: 56px 24px 32px; }

.cim-footer-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

/* Brand column */
.cim-footer-brand .cim-footer-logo-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.cim-footer-logo-mark {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background-color: #e85d10;
}
.cim-footer-logo-text {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700; font-size: 1.1rem; letter-spacing: 0.08em; color: #f0f2f4;
}
.cim-footer-tagline {
  font-size: 12px; line-height: 1.6; color: #6e7f8d; max-width: 220px; margin: 0;
}

/* Link columns */
.cim-footer-heading {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 600; font-size: 0.9rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: #f0f2f4; margin: 0 0 14px;
}
.cim-footer-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.cim-footer-list a {
  font-size: 12px; color: #6e7f8d; text-decoration: none;
  transition: color 0.15s;
}
.cim-footer-list a:hover { color: #e85d10; }

/* Bottom bar */
.cim-footer-bottom-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 24px; border-top: 1px solid #1a2028; flex-wrap: wrap;
}
.cim-footer-copy {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 0.65rem; color: #4a5a68; letter-spacing: 0.08em;
}
.cim-footer-legal { display: flex; gap: 24px; flex-wrap: wrap; }
.cim-footer-legal a {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 0.65rem; color: #4a5a68; letter-spacing: 0.06em;
  text-decoration: none; transition: color 0.15s;
}
.cim-footer-legal a:hover { color: #e85d10; }

@media (max-width: 768px) {
  .cim-footer-grid-4 { grid-template-columns: 1fr; gap: 28px; }
  .cim-footer-bottom-bar { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Static Pages (Solutions / About / Contact)
   ============================================================ */
.cim-static-page { background: #ffffff; }

/* Hero band (dark) */
.cim-static-hero {
  background: linear-gradient(135deg, #0e1216 0%, #1a2028 100%);
  color: #f0f2f4;
  padding: 80px 0 72px;
}
.cim-static-hero-eyebrow {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 0.7rem; color: #e85d10; letter-spacing: 0.14em; text-transform: uppercase;
}
.cim-static-hero-eyebrow span {
  width: 24px; height: 2px; background: #e85d10; display: inline-block;
}
.cim-static-hero-title {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700; font-size: clamp(2rem, 5vw, 3.25rem);
  text-transform: uppercase; line-height: 1.05; margin: 0 0 1.25rem;
  letter-spacing: 0.01em;
}
.cim-static-hero-sub {
  font-size: 1rem; line-height: 1.7; color: #8a9aaa; max-width: 620px; margin: 0;
}

/* Sections */
.cim-static-section { padding: 72px 0; }
.cim-static-section-tight { padding: 48px 0; }
.cim-static-section-alt { background: #f7f8fa; }
.cim-static-section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.cim-static-section-head-left { text-align: left; margin-left: 0; }
.cim-static-section-head h2 {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700; font-size: 2rem; text-transform: uppercase;
  color: #1a1a1a; margin: 0 0 12px; letter-spacing: 0.02em;
}
.cim-static-section-head p { font-size: 0.95rem; color: #6e7f8d; margin: 0; line-height: 1.6; }

/* Solutions / capabilities card grid */
.cim-solution-grid,
.cim-cap-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.cim-solution-card,
.cim-cap-item {
  background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 32px 28px; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.cim-solution-card:hover,
.cim-cap-item:hover {
  border-color: #e85d10; box-shadow: 0 8px 24px rgba(0,0,0,0.06); transform: translateY(-3px);
}
.cim-solution-icon,
.cim-cap-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-bottom: 16px;
  background: rgba(232,93,16,0.1); color: #e85d10; font-size: 1.4rem; border-radius: 6px;
}
.cim-solution-card h3,
.cim-cap-item h3 {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700; font-size: 1.2rem; text-transform: uppercase;
  color: #1a1a1a; margin: 0 0 10px; letter-spacing: 0.03em;
}
.cim-solution-card p,
.cim-cap-item p { font-size: 0.9rem; line-height: 1.65; color: #6e7f8d; margin: 0; }

/* Process steps */
.cim-process-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.cim-process-step {
  position: relative; padding: 28px 24px; background: #ffffff;
  border: 1px solid #e5e7eb; border-radius: 8px;
}
.cim-process-num {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 1.5rem; font-weight: 500; color: #e85d10; letter-spacing: 0.05em;
  display: block; margin-bottom: 12px;
}
.cim-process-step h3 {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700; font-size: 1.15rem; text-transform: uppercase;
  color: #1a1a1a; margin: 0 0 8px;
}
.cim-process-step p { font-size: 0.88rem; line-height: 1.6; color: #6e7f8d; margin: 0; }

/* Industries */
.cim-industry-grid {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.cim-industry-tag {
  padding: 12px 24px; background: #f7f8fa; border: 1px solid #e5e7eb; border-radius: 6px;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 600; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: #4a5a68; transition: all 0.18s;
}
.cim-industry-tag:hover { border-color: #e85d10; color: #e85d10; }

/* Stats */
.cim-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: #e5e7eb; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden;
}
.cim-stat-item {
  background: #ffffff; padding: 32px 20px; text-align: center;
}
.cim-stat-value {
  display: block; font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700; font-size: 2.25rem; color: #e85d10; line-height: 1; margin-bottom: 6px;
}
.cim-stat-label {
  font-size: 0.72rem; color: #6e7f8d; letter-spacing: 0.08em; text-transform: uppercase;
}

/* About story (2-col) */
.cim-about-story {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.cim-about-story-text p { font-size: 0.95rem; line-height: 1.8; color: #4a5a68; margin: 0 0 16px; }

/* Certifications */
.cim-cert-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.cim-cert-item {
  text-align: center; padding: 36px 24px; background: #ffffff;
  border: 1px solid #e5e7eb; border-radius: 8px;
}
.cim-cert-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: 14px;
  background: #1a1a1a; color: #e85d10;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700; font-size: 1.1rem; letter-spacing: 0.04em; border-radius: 6px;
}
.cim-cert-item h3 {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700; font-size: 1.2rem; text-transform: uppercase;
  color: #1a1a1a; margin: 0 0 8px;
}
.cim-cert-item p { font-size: 0.88rem; line-height: 1.6; color: #6e7f8d; margin: 0; }

/* CTA band */
.cim-static-cta { background: #e85d10; color: #ffffff; }
.cim-static-cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding: 56px 24px; flex-wrap: wrap;
}
.cim-static-cta h2 {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800; font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  text-transform: uppercase; margin: 0 0 8px; line-height: 1.1;
}
.cim-static-cta p { margin: 0; color: rgba(255,255,255,0.85); font-size: 0.95rem; max-width: 560px; line-height: 1.6; }
.cim-static-cta .cim-btn-primary { background: #ffffff; color: #e85d10; flex-shrink: 0; }
.cim-static-cta .cim-btn-primary:hover { background: #f0f2f4; }

/* Contact layout */
.cim-contact-layout {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start;
}
.cim-contact-info h2 {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700; font-size: 2rem; text-transform: uppercase;
  color: #1a1a1a; margin: 0 0 14px;
}
.cim-contact-lead { font-size: 0.95rem; line-height: 1.7; color: #6e7f8d; margin: 0 0 28px; }
.cim-contact-list { list-style: none; margin: 0; padding: 0; }
.cim-contact-list li {
  display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid #e5e7eb;
}
.cim-contact-ic {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(232,93,16,0.1); color: #e85d10; font-size: 1.1rem; border-radius: 6px;
}
.cim-contact-label {
  display: block; font-size: 0.7rem; color: #9ca3af; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 4px;
}
.cim-contact-list a, .cim-contact-val {
  font-size: 1rem; color: #1a1a1a; font-weight: 600; text-decoration: none;
}
.cim-contact-list a:hover { color: #e85d10; }

/* Contact form */
.cim-contact-form-wrap {
  background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 36px;
}
.cim-contact-form .cim-form-row { margin-bottom: 18px; }
.cim-contact-form .cim-form-row-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px;
}
.cim-contact-form .cim-form-row-2 > div { margin: 0; }
.cim-contact-form label {
  display: block; font-size: 0.8rem; font-weight: 600; color: #4a5a68;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
.cim-req { color: #e85d10; }
.cim-contact-form input,
.cim-contact-form textarea {
  width: 100%; padding: 11px 14px; font-size: 0.95rem; font-family: inherit;
  border: 1px solid #d1d5db; border-radius: 6px; background: #ffffff; color: #1a1a1a;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.cim-contact-form input:focus,
.cim-contact-form textarea:focus {
  outline: none; border-color: #e85d10; box-shadow: 0 0 0 3px rgba(232,93,16,0.12);
}
.cim-contact-form textarea { resize: vertical; }

.cim-form-success {
  text-align: center; padding: 24px 12px;
}
.cim-form-success-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: 16px;
  background: rgba(232,93,16,0.1); color: #e85d10; font-size: 1.6rem; border-radius: 50%;
}
.cim-form-success h3 {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700; font-size: 1.4rem; color: #1a1a1a; margin: 0 0 10px;
}
.cim-form-success p { font-size: 0.9rem; color: #6e7f8d; line-height: 1.6; margin: 0; }
.cim-form-success a { color: #e85d10; }
.cim-form-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  padding: 12px 16px; border-radius: 6px; font-size: 0.88rem; margin-bottom: 18px;
}

/* Inline field validation errors (English, replacing browser-native messages) */
.cim-field-error {
  display: none;
  color: #b91c1c;
  font-size: 0.82rem;
  margin-top: 4px;
}
.cim-contact-form .cim-input-invalid {
  border-color: #dc2626 !important;
  background: #fef2f2;
}
.cim-contact-form .cim-input-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Responsive */
@media (max-width: 1024px) {
  .cim-solution-grid, .cim-cap-grid, .cim-cert-grid { grid-template-columns: repeat(2, 1fr); }
  .cim-process-grid { grid-template-columns: repeat(2, 1fr); }
  .cim-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .cim-static-hero { padding: 56px 0 48px; }
  .cim-static-section { padding: 48px 0; }
  .cim-solution-grid, .cim-cap-grid, .cim-cert-grid,
  .cim-process-grid, .cim-stats-grid,
  .cim-about-story, .cim-contact-layout { grid-template-columns: 1fr; gap: 24px; }
  .cim-contact-form .cim-form-row-2 { grid-template-columns: 1fr; }
  .cim-static-cta-inner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   404 Page
   ============================================================ */
.cim-404-hero { padding: 96px 0 80px; }
.cim-404-hero .cim-static-hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin-bottom: 14px;
}
.cim-404-actions {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px;
}
.cim-404-btn-primary {
  background: #e85d10; color: #ffffff; border: 1px solid #e85d10;
}
.cim-404-btn-primary:hover { background: #c44a0c; border-color: #c44a0c; color: #ffffff; }
.cim-404-btn-ghost {
  background: transparent; color: #f0f2f4; border: 1px solid rgba(240,242,244,0.4);
}
.cim-404-btn-ghost:hover { background: rgba(240,242,244,0.1); border-color: #f0f2f4; color: #ffffff; }

.cim-404-search {
  max-width: 560px; margin: 0 0 48px;
}
.cim-404-search .search-form {
  display: flex; gap: 0; border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden;
}
.cim-404-search .search-form label {
  flex: 1; display: flex; margin: 0;
}
.cim-404-search .search-field {
  flex: 1; width: 100%; padding: 12px 16px; font-size: 0.95rem; font-family: inherit;
  border: none; background: #ffffff; color: #1a1a1a;
}
.cim-404-search .search-field:focus { outline: none; }
.cim-404-search .search-submit {
  padding: 12px 22px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; border: none; cursor: pointer;
  background: #e85d10; color: #ffffff; font-family: inherit;
}
.cim-404-search .search-submit:hover { background: #c44a0c; }

.cim-cap-item-link {
  text-decoration: none; color: inherit; display: block;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.cim-cap-item-link:hover {
  border-color: #e85d10; box-shadow: 0 6px 18px rgba(232,93,16,0.10); transform: translateY(-2px);
}
.cim-cap-item-link:hover h3 { color: #e85d10; }
.cim-cap-item-link h3 { transition: color 0.18s; }

@media (max-width: 768px) {
  .cim-404-hero { padding: 64px 0 56px; }
  .cim-404-actions { flex-direction: column; align-items: stretch; }
  .cim-404-btn-primary, .cim-404-btn-ghost { text-align: center; }
}

/* ============================================================
   Search Form (searchform.php — used by 404.php + search.php)
   ============================================================ */
.cim-search-form {
  display: flex;
  align-items: stretch;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.cim-search-form:focus-within {
  border-color: #e85d10;
  box-shadow: 0 0 0 3px rgba(232,93,16,0.12);
}
.cim-search-field {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  border: none;
  background: #ffffff;
  color: #1a1a1a;
}
.cim-search-field::placeholder { color: #9ca3af; }
.cim-search-field:focus { outline: none; }
.cim-search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  flex-shrink: 0;
  border: none;
  border-left: 1px solid #d1d5db;
  background: #f9fafb;
  color: #4b5563;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.cim-search-submit:hover {
  background: #e85d10;
  color: #ffffff;
}
/* Override old 404 search styles now that searchform.php is active */
.cim-404-search .search-form,
.cim-404-search .cim-search-form { max-width: 100%; }

/* ============================================================
   Search Results Page (search.php)
   ============================================================ */
.cim-search-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 8px 0 48px;
}
.cim-search-page-form {
  margin-bottom: 32px;
}
.cim-search-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cim-search-item {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.cim-search-item:hover {
  border-color: #e85d10;
  box-shadow: 0 4px 14px rgba(232,93,16,0.08);
}
.cim-search-item-type {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 28px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 4px;
  background: #f3f4f6;
  color: #4b5563;
}
.cim-search-type-product { background: #fff3e9; color: #c44a0c; }
.cim-search-type-post    { background: #eef6ff; color: #1d5fb8; }
.cim-search-type-page    { background: #f0f4f0; color: #2d6a2d; }
.cim-search-item-body {
  flex: 1;
  min-width: 0;
}
.cim-search-item-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 6px;
}
.cim-search-item-title a {
  color: #1a1a1a;
  text-decoration: none;
}
.cim-search-item-title a:hover { color: #e85d10; }
.cim-search-item-excerpt {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #4b5563;
  margin: 0 0 8px;
}
.cim-search-item-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e85d10;
  text-decoration: none;
}
.cim-search-item-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .cim-search-item { flex-direction: column; gap: 10px; padding: 16px 18px; }
  .cim-search-item-type { align-self: flex-start; }
}
