/*
 * Styles for elements the CMS adds to the original design
 * (form feedback, galleries, empty states, error pages).
 * Only new class names live here; nothing in the original CSS is overridden.
 */

.cms-alert {
  padding: 16px 20px;
  margin-bottom: 24px;
  border-radius: 6px;
  font-size: 16px;
  line-height: 24px;
}
.cms-alert-success { background: #e8f5ee; color: #1d6b3f; border: 1px solid #b8e0c8; }
.cms-alert-error { background: #fdecec; color: #9b1c1c; border: 1px solid #f5c2c2; }
.cms-alert ul { margin: 8px 0 0 18px; list-style: disc; }

.cms-field-error {
  display: block;
  margin-top: 6px;
  color: #b42318;
  font-size: 14px;
  line-height: 20px;
}

/* ---------------------------------------------------------------------------
   Fixed image frames. Uploaded images always take the template's original
   size and shape, whatever their own dimensions: photos are cropped to fill
   the frame (object-fit: cover), icons and logos are scaled to fit inside it
   (object-fit: contain). The ratios equal the original placeholders, so the
   layout is unchanged until real images are uploaded.
--------------------------------------------------------------------------- */
.product-image img        { aspect-ratio: 1 / 1;     object-fit: cover; }   /* product & service listing cards (433×433) */
.detail-product-image img { aspect-ratio: 1 / 1;     object-fit: cover; }   /* product / service / specialization page (660×660) */
.related-image img        { aspect-ratio: 1 / 1;     object-fit: cover; }   /* related items (330×330) */
.about-intro-media img    { aspect-ratio: 586 / 660; object-fit: cover; }   /* About page photo (586×660) */
.choose_grid_item img     { aspect-ratio: 1 / 1;     object-fit: contain; } /* "Why choose us" icons */
.site-logo img            { max-height: 59px; object-fit: contain; object-position: left center; }
.footer-logo img          { max-height: 86px; object-fit: contain; object-position: left center; }
/* Already fixed in main.css: home product cards (3:2 cover), category cards (square),
   "What we offer" cards (600:340 cover), specialization icons (max 120px), banners (cover). */

/* Spam trap: hidden from people, visible to naive bots. */
.cms-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The quote form now really submits; give its submit button the original
   input[type="button"] look from main.css. */
.request-form input[type="submit"] {
  margin-top: 30px;
  padding: 14px 40px;
  font-weight: 600;
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 12px 26px rgba(3, 161, 254, 0.3);
  cursor: pointer;
  transition: transform var(--speed) var(--ease);
}
.request-form input[type="submit"]:hover {
  transform: translateY(-3px);
}

.cms-empty {
  padding: 40px 0;
  text-align: center;
  color: #6b7280;
}

/* Product / service gallery under the main detail image */
.cms-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.cms-gallery a { display: block; border-radius: 6px; overflow: hidden; }
.cms-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: opacity 0.2s; }
.cms-gallery a:hover img { opacity: 0.8; }

.cms-rich-text > * + * { margin-top: 16px; }
.cms-rich-text ul { list-style: disc; padding-left: 22px; }
.cms-rich-text ol { list-style: decimal; padding-left: 22px; }
.cms-rich-text a { text-decoration: underline; }

/* ---------------------------------------------------------------------------
   Technical content (from "Technical Information for Website")
   Uses the site's brand variables from reset.css.
--------------------------------------------------------------------------- */

/* Category page: article layout (main column + sticky sidebar) */
.cms-cat { padding-top: 70px; }

.cms-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 50px;
  font-size: 14px;
  color: var(--text-muted);
}
.cms-breadcrumb a { color: var(--text-muted); transition: color var(--speed) ease; }
.cms-breadcrumb a:hover { color: var(--blue-dark); }
.cms-breadcrumb [aria-current] { color: var(--navy); font-weight: 600; }
.cms-breadcrumb span[aria-hidden] { color: #c4ccd8; }

.cms-cat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 70px;
  align-items: start;
}

/* Main column */
.cms-cat-head { padding-bottom: 36px; margin-bottom: 40px; border-bottom: 1px solid #e7e2da; }
.cms-cat-head .third_title { max-width: 760px; }
.cms-lead {
  max-width: 760px;
  margin-top: 22px;
  font-size: 18px;
  line-height: 1.75;
  color: var(--text-muted);
}

.cms-article { max-width: 760px; }
.cms-article h2, .cms-article h3 {
  margin-bottom: 18px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy);
}
.cms-article h4 { margin: 28px 0 12px; font-size: 19px; font-weight: 600; color: var(--navy); }
.cms-article p { font-size: 16px; line-height: 1.85; color: var(--text); }
.cms-article p + p { margin-top: 18px; }
.cms-article ul { margin-top: 14px; padding-left: 20px; list-style: disc; font-size: 16px; line-height: 1.8; }
.cms-article a { color: var(--blue-dark); text-decoration: underline; }

.cms-cat-products { margin-top: 60px; }
.cms-cat-products-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.cms-cat-products-head h2 { font-size: 24px; font-weight: 600; color: var(--navy); }
.cms-cat-products-head span { font-size: 14px; color: var(--text-muted); white-space: nowrap; }

.cms-product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.cms-product-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e7e2da;
  border-radius: var(--radius);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) ease, border-color var(--speed) ease;
}
.cms-product-item:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}
.cms-product-thumb { display: block; background: var(--sand-light); }
.cms-product-thumb img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.cms-product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px 26px;
  border-top: 3px solid var(--blue-dark);
}
.cms-product-name { font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--navy); }
.cms-product-text {
  display: -webkit-box;
  margin-top: 10px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.cms-product-link {
  margin-top: auto;
  padding-top: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-dark);
}
.cms-product-link span { display: inline-block; transition: transform var(--speed) var(--ease); }
.cms-product-item:hover .cms-product-link span { transform: translateX(5px); }

/* Sidebar */
.cms-cat-aside {
  position: sticky;
  top: calc(var(--header-height-scrolled) + 30px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cms-side-card {
  padding: 28px;
  background: var(--sand-light);
  border-radius: var(--radius);
}
.cms-side-card h3 {
  margin-bottom: 14px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--navy);
}
.cms-side-card p { font-size: 15px; line-height: 1.7; color: var(--text-muted); }
.cms-side-card .check-list { margin-top: 0; }
.cms-side-card .check-list li { font-size: 15px; }
.cms-side-card .check-list li + li { margin-top: 10px; }

.cms-side-cta { color: #ffffff; background: linear-gradient(150deg, var(--navy), var(--blue-dark)); }
.cms-side-cta h3 { color: #ffffff; }
.cms-side-cta p { color: rgba(255, 255, 255, 0.85); }
.cms-side-cta .btn-primary { margin-top: 24px; width: 100%; justify-content: center; }
.cms-side-link {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  opacity: 0.9;
}
.cms-side-link:hover { color: #ffffff; opacity: 1; }

.cms-side-nav li + li { border-top: 1px solid #e2dbcf; }
.cms-side-nav a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  font-size: 15px;
  color: var(--text);
  transition: color var(--speed) ease;
}
.cms-side-nav a:hover { color: var(--blue-dark); }
.cms-side-nav a span { color: var(--gold); }

@media (max-width: 1200px) {
  .cms-cat-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; }
}
@media (max-width: 991px) {
  .cms-cat-layout { grid-template-columns: 1fr; }
  .cms-cat-aside { position: static; }
}
@media (max-width: 767px) {
  .cms-cat { padding-top: 40px; }
  .cms-breadcrumb { margin-bottom: 30px; font-size: 13px; }
  .cms-lead { font-size: 16px; }
  .cms-product-list { grid-template-columns: 1fr; }
  .cms-side-card { padding: 24px; }
}

/* Product page: technical details */
.cms-specs-section { background: #ffffff; }
.cms-specs-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 30px;
}
.cms-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.cms-spec {
  padding: 26px 28px;
  background: var(--sand-light);
  border-radius: var(--radius);
  border-top: 3px solid var(--blue-dark);
}
/* Full-width rows; challenge + solution sit side by side as a pair. */
.cms-spec--key_considerations, .cms-spec--applications, .cms-spec--design_notes { grid-column: 1 / -1; }
.cms-spec--challenge { border-top-color: var(--gold); }
.cms-spec h3 { font-size: 0.9rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; text-transform: none; }
.cms-spec p { font-size: 0.8rem; line-height: 1.7; color: var(--text); }
.cms-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cms-tags li {
  padding: 6px 14px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--navy);
  background: #ffffff;
  border: 1px solid #e2dbcf;
  border-radius: 999px;
}

@media (max-width: 767px) {
  .cms-specs { grid-template-columns: 1fr; }
  .cms-spec { padding: 22px; }
}

.error-page .container { text-align: center; }
.error-page .error-code {
  font-size: 96px;
  line-height: 1;
  font-weight: 700;
  color: #006ab3;
  margin-bottom: 16px;
}
.error-page p { margin-bottom: 28px; }
