/* ==========================================================================
   Chemesis Core — Reusable components
   Ported from the approved Vercel prototype (container, buttons, forms,
   technical labels, media frames, motion helpers, Woo price/badge basics).
   Class prefix: ch-  (mapped from prototype names in docs/WORDPRESS-DESIGN-SYSTEM.md)
   ========================================================================== */

/* ------------------------------------------------------------------
   Layout — containers & grid (prototype: .container-x / .container-narrow)
   ------------------------------------------------------------------ */
.chemesis-container {
  width: 100%;
  max-width: var(--ch-container);
  margin-inline: auto;
  padding-inline: var(--ch-gutter);
}

.chemesis-container-narrow {
  width: 100%;
  max-width: var(--ch-container-narrow);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.chemesis-grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--ch-grid-gap);
}

@media (min-width: 1024px) {
  .chemesis-grid-12 {
    gap: var(--ch-grid-gap-lg);
  }
}

@media (max-width: 767px) {
  .chemesis-grid-12 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------------
   Section rhythm (V2: py-16 / md:py-24; dense py-10 / md:py-14;
   banner pt-10 pb-16 / md:pt-12 pb-24)
   ------------------------------------------------------------------ */
.ch-section {
  padding-block: var(--ch-space-section-mobile);
}

.ch-section-tight {
  padding-block: 2.5rem;
}

.ch-section-banner {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

@media (min-width: 768px) {
  .ch-section {
    padding-block: var(--ch-space-section-desktop);
  }

  .ch-section-tight {
    padding-block: 3.5rem;
  }

  .ch-section-banner {
    padding-top: 3rem;
    padding-bottom: 6rem;
  }
}

/* ------------------------------------------------------------------
   Surfaces, borders, hairlines, rules
   ------------------------------------------------------------------ */
.ch-surface-dark {
  background: var(--ch-ink-900);
  color: #fff;
}

.ch-surface-deep {
  background: var(--ch-ink-950);
  color: #fff;
}

.ch-hairline {
  height: 1px;
  background: var(--ch-line);
}

.ch-hairline-dark {
  height: 1px;
  background: var(--ch-dark-line);
}

.ch-border {
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-md);
}

.ch-rule-blue {
  display: block;
  width: 2.5rem;
  height: 1px;
  background: var(--ch-blue);
}

.ch-radius-sm {
  border-radius: var(--ch-radius-sm);
}

.ch-radius-md {
  border-radius: var(--ch-radius-md);
}

.ch-radius-frame {
  border-radius: var(--ch-radius-frame);
}

.ch-shadow-soft {
  box-shadow: var(--ch-shadow-soft);
}

.ch-shadow-lift {
  box-shadow: var(--ch-shadow-lift);
}

/* ------------------------------------------------------------------
   Buttons (prototype: .btn + variants, height 3.15rem / sm 2.6rem)
   ------------------------------------------------------------------ */
.ch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  height: var(--ch-btn-height);
  padding-inline: var(--ch-btn-padding);
  border: 0;
  border-radius: var(--ch-radius-sm);
  font-family: var(--ch-font-body);
  font-size: var(--ch-btn-font);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--ch-dur-fast) var(--ch-ease-expo),
    color var(--ch-dur-fast) var(--ch-ease-expo),
    border-color var(--ch-dur-fast) var(--ch-ease-expo),
    transform var(--ch-dur-fast) var(--ch-ease-expo),
    box-shadow var(--ch-dur-fast) var(--ch-ease-expo);
}

.ch-btn:active {
  transform: translateY(1px);
}

.ch-btn .ch-btn-arrow {
  transition: transform 0.4s var(--ch-ease-expo);
}

.ch-btn:hover .ch-btn-arrow {
  transform: translateX(4px);
}

.ch-btn-primary {
  background: var(--ch-blue);
  color: #fff;
}

.ch-btn-primary:hover {
  background: var(--ch-blue-600);
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(0, 84, 252, 0.55);
}

.ch-btn-ink {
  background: var(--ch-ink-900);
  color: #fff;
}

.ch-btn-ink:hover {
  background: var(--ch-ink-700);
  color: #fff;
  box-shadow: var(--ch-shadow-soft);
}

.ch-btn-outline {
  border: 1px solid rgba(11, 18, 32, 0.18);
  color: var(--ch-ink-900);
  background: transparent;
}

.ch-btn-outline:hover {
  border-color: var(--ch-ink-900);
  color: var(--ch-ink-900);
  background: rgba(0, 12, 48, 0.04);
}

.ch-btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  background: transparent;
}

.ch-btn-outline-light:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ch-btn-light {
  background: #fff;
  color: var(--ch-ink-900);
}

.ch-btn-light:hover {
  color: var(--ch-ink-900);
  box-shadow: 0 14px 34px -16px rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.ch-btn-sm {
  height: var(--ch-btn-height-sm);
  padding-inline: 1.2rem;
  font-size: 0.875rem;
}

.ch-btn[disabled],
.ch-btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

/* State-complete padding re-assert: page button-shields zero `button`
   padding on :hover/:focus (width collapse on interaction). These
   doubled-class rules win every shield at every state — one shared fix
   for all `.ch-btn` controls site-wide (PDP, forms, CTAs, drawers). */
body .ch-btn.ch-btn,
body .ch-btn.ch-btn:hover,
body .ch-btn.ch-btn:focus,
body .ch-btn.ch-btn:focus-visible {
  padding-inline: var(--ch-btn-padding);
}

body .ch-btn-sm.ch-btn-sm,
body .ch-btn-sm.ch-btn-sm:hover,
body .ch-btn-sm.ch-btn-sm:focus,
body .ch-btn-sm.ch-btn-sm:focus-visible {
  padding-inline: 1.2rem;
}

.ch-btn:focus-visible,
.ch-btn:focus {
  outline: 2px solid var(--ch-blue);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------
   Forms (prototype: .field-label / .field-input / .field-error)
   ------------------------------------------------------------------ */
.ch-label {
  display: block;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ch-muted);
  margin-bottom: 0.5rem;
}

.ch-input,
.ch-select,
.ch-textarea {
  width: 100%;
  height: var(--ch-input-height);
  padding-inline: 0.9rem;
  background: #fff;
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-sm);
  font-family: var(--ch-font-body);
  font-size: var(--ch-input-font);
  color: var(--ch-text);
  transition:
    border-color var(--ch-dur-fast) var(--ch-ease-expo),
    box-shadow var(--ch-dur-fast) var(--ch-ease-expo);
}

.ch-input::placeholder,
.ch-textarea::placeholder {
  color: var(--ch-faint);
}

.ch-input:hover,
.ch-select:hover,
.ch-textarea:hover {
  border-color: rgba(11, 18, 32, 0.28);
}

.ch-input:focus,
.ch-select:focus,
.ch-textarea:focus {
  outline: none;
  border-color: var(--ch-blue);
  box-shadow: 0 0 0 3px rgba(0, 84, 252, 0.12);
}

.ch-input[aria-invalid="true"],
.ch-select[aria-invalid="true"],
.ch-textarea[aria-invalid="true"] {
  border-color: var(--ch-danger);
}

.ch-textarea {
  height: auto;
  min-height: 8rem;
  padding-block: 0.8rem;
  resize: vertical;
}

.ch-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234b556a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

.ch-input:disabled,
.ch-select:disabled,
.ch-textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ch-error {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: #b32626;
}

/* Focus ring parity for the shared field system: the Elementor kit's
   global input rule (.elementor-kit-5 input:not(...) → 0-3-1) suppressed
   the V2 focus border + ring on every field without a page-level
   re-assert. This sheet-level shield (0-4-1) restores it everywhere. */
.elementor-kit-5 input.ch-input:not(:disabled):focus,
.elementor-kit-5 select.ch-input:not(:disabled):focus,
.elementor-kit-5 textarea.ch-input:not(:disabled):focus {
  outline: none;
  border-color: var(--ch-blue);
  box-shadow: 0 0 0 3px rgba(0, 84, 252, 0.12);
}

.elementor-kit-5 input.ch-input:not(:disabled):focus-visible,
.elementor-kit-5 select.ch-input:not(:disabled):focus-visible,
.elementor-kit-5 textarea.ch-input:not(:disabled):focus-visible {
  outline: none;
}

/* ------------------------------------------------------------------
   Technical typography & labels
   ------------------------------------------------------------------ */
.ch-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ch-blue-600);
}

.ch-eyebrow-dark {
  color: var(--ch-on-dark-accent);
}

.ch-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ch-mono {
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-mono);
  letter-spacing: 0.02em;
}

.ch-caption {
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-caption);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ch-faint);
}

.ch-metric {
  font-family: var(--ch-font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ch-ink-900);
}

.ch-editorial {
  font-family: var(--ch-font-editorial);
  font-style: italic;
  font-weight: 400;
}

.ch-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 1.8rem;
  padding-inline: 0.65rem;
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-xs);
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ch-muted);
  white-space: nowrap;
}

.ch-tag-blue {
  border-color: rgba(0, 84, 252, 0.25);
  background: var(--ch-blue-100);
  color: var(--ch-blue-700);
}

.ch-tag-dark {
  border-color: var(--ch-dark-line-strong);
  color: rgba(255, 255, 255, 0.72);
}

/* ------------------------------------------------------------------
   Media frames (prototype: .media-frame / .media-frame-dark)
   ------------------------------------------------------------------ */
.ch-media-frame {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #eef1f6 55%, #e4e9f1 100%);
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-md);
}

.ch-media-frame-dark {
  position: relative;
  overflow: hidden;
  background: radial-gradient(130% 100% at 50% 0%, #04123a 0%, #000c30 55%, #01061a 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--ch-radius-md);
}

.ch-media-render {
  object-fit: contain;
  transition: transform var(--ch-dur-reveal) var(--ch-ease-expo);
  will-change: transform;
}

/* Corner/tick capability (prototype .tick-mark) */
.ch-tick {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(0, 12, 48, 0.3);
  opacity: 0;
  transition: opacity var(--ch-dur) var(--ch-ease-expo);
}

.ch-tick-tl { left: 12px; top: 12px; border-left: 1px solid; border-top: 1px solid; }
.ch-tick-tr { right: 12px; top: 12px; border-right: 1px solid; border-top: 1px solid; }
.ch-tick-bl { left: 12px; bottom: 12px; border-left: 1px solid; border-bottom: 1px solid; }
.ch-tick-br { right: 12px; bottom: 12px; border-right: 1px solid; border-bottom: 1px solid; }

.ch-ticks-on .ch-tick,
:where(.ch-tick-visible) .ch-tick {
  opacity: 1;
}

/* ------------------------------------------------------------------
   Motion foundation (inert until classes are used; JS initializes .is-in)
   ------------------------------------------------------------------ */
.ch-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity var(--ch-dur-reveal) var(--ch-ease-expo),
    transform var(--ch-dur-reveal) var(--ch-ease-expo);
  transition-delay: var(--ch-delay, 0ms);
}

.ch-reveal.is-in {
  opacity: 1;
  transform: none;
}

.ch-reveal-mask {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s var(--ch-ease-expo);
  transition-delay: var(--ch-delay, 0ms);
}

.ch-reveal-mask.is-in {
  clip-path: inset(0 0 0 0);
}

.ch-reveal-scale {
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 1s var(--ch-ease-expo),
    transform 1.2s var(--ch-ease-expo);
  transition-delay: var(--ch-delay, 0ms);
}

.ch-reveal-scale.is-in {
  opacity: 1;
  transform: none;
}

.ch-reveal-left {
  opacity: 0;
  transform: translateX(-22px);
  transition:
    opacity var(--ch-dur-reveal) var(--ch-ease-expo),
    transform var(--ch-dur-reveal) var(--ch-ease-expo);
  transition-delay: var(--ch-delay, 0ms);
}

.ch-reveal-left.is-in {
  opacity: 1;
  transform: none;
}

.ch-wordmask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.ch-wordmask > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ch-ease-expo);
  transition-delay: var(--ch-delay, 0ms);
}

.ch-wordmask.is-in > span {
  transform: translateY(0);
}

.ch-step-line {
  position: relative;
  display: block;
  height: 1px;
  background: transparent;
}

.ch-step-line i {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 84, 252, 0.6), rgba(0, 84, 252, 0.12));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.3s var(--ch-ease-expo) 0.15s;
}

.ch-step-line.is-in i,
.is-in .ch-step-line i {
  transform: scaleX(1);
}

.ch-card-lift {
  transition:
    border-color var(--ch-dur) var(--ch-ease-expo),
    box-shadow var(--ch-dur) var(--ch-ease-expo),
    transform var(--ch-dur) var(--ch-ease-expo);
}

.ch-card-lift:hover,
.ch-card-lift:focus-within {
  border-color: rgba(0, 12, 48, 0.22);
  box-shadow: 0 34px 70px -48px rgba(0, 12, 48, 0.55);
  transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
  .ch-btn,
  .ch-btn .ch-btn-arrow,
  .ch-media-render,
  .ch-card-lift,
  .ch-tick {
    transition: none !important;
    transform: none !important;
  }
}

/* ------------------------------------------------------------------
   WooCommerce design foundation (scoped — no layout rebuild)
   ------------------------------------------------------------------ */
.woocommerce .price,
.woocommerce div.product p.price,
.woocommerce ul.products li.product .price {
  font-family: var(--ch-font-display);
  font-weight: 600;
  color: var(--ch-ink-900);
}

.woocommerce .price del,
.woocommerce .price del .amount {
  font-family: var(--ch-font-mono);
  font-size: 0.8em;
  font-weight: 400;
  color: var(--ch-faint);
  text-decoration: line-through;
}

.woocommerce .price ins,
.woocommerce .price ins .amount {
  font-weight: 600;
  color: var(--ch-blue-600);
  text-decoration: none;
}

.woocommerce span.onsale {
  min-height: 0;
  min-width: 0;
  padding: 0.35rem 0.6rem;
  border-radius: var(--ch-radius-xs);
  background: var(--ch-blue);
  color: #fff;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  top: 12px;
  left: 12px;
  right: auto;
}

.woocommerce .quantity input.qty {
  height: var(--ch-input-height);
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-sm);
  font-family: var(--ch-font-mono);
  background: #fff;
}

.woocommerce .quantity input.qty:focus {
  outline: none;
  border-color: var(--ch-blue);
  box-shadow: 0 0 0 3px rgba(0, 84, 252, 0.12);
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .checkout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: var(--ch-btn-height);
  padding-inline: var(--ch-btn-padding);
  border: 0;
  border-radius: var(--ch-radius-sm);
  background: var(--ch-blue);
  color: #fff;
  font-family: var(--ch-font-body);
  font-size: var(--ch-btn-font);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--ch-dur-fast) var(--ch-ease-expo),
    transform var(--ch-dur-fast) var(--ch-ease-expo),
    box-shadow var(--ch-dur-fast) var(--ch-ease-expo);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce .checkout-button:hover {
  background: var(--ch-blue-600);
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(0, 84, 252, 0.55);
}

.woocommerce a.button:focus-visible,
.woocommerce button.button:focus-visible {
  outline: 2px solid var(--ch-blue);
  outline-offset: 3px;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt {
  background: var(--ch-ink-900);
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
  background: var(--ch-ink-700);
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notice {
  border-top-color: var(--ch-blue);
  background: var(--ch-paper);
  color: var(--ch-text);
  font-family: var(--ch-font-body);
}

.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--ch-blue);
}
