/* JAE 3.2 — shared visual system for internal pages and WooCommerce. */
body.jae3-global-enabled {
  --jae-content: min(1320px,calc(100% - 56px));
  color: var(--jae-ink);
  background: var(--jae-paper);
  font-family: var(--jae-font-body);
}

body.jae3-global-enabled :where(h1,h2,h3,h4,.elementor-heading-title,.entry-title,.page-title) {
  font-family: var(--jae-font-display) !important;
  font-weight: 760;
  font-variation-settings: "wght" 760;
  text-wrap: balance;
}

body.jae3-global-enabled :where(a,button,input,select,textarea) { font-family: inherit; }
body.jae3-global-enabled :where(.entry-title a,.page-title a,.elementor-heading-title a,.woocommerce-loop-product__title a) { transition: color .25s; }
body.jae3-global-enabled :where(.entry-title a,.page-title a,.elementor-heading-title a,.woocommerce-loop-product__title a):hover { color: var(--jae-accent) !important; }

/* Internal page intro is additive: Elementor and every dynamic loop remain native. */
.jae3-internal-hero {
  position: relative;
  min-height: 430px;
  display: grid;
  align-items: end;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: var(--jae-navy);
}
.jae3-internal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg,rgba(1,31,45,.96) 0%,rgba(2,48,71,.82) 48%,rgba(2,48,71,.2) 100%),linear-gradient(0deg,rgba(1,31,45,.55),transparent 55%);
}
.jae3-internal-hero__media { position: absolute; inset: 0; z-index: -2; }
.jae3-internal-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 47%; filter: saturate(.88) contrast(1.04); animation: jae3-internal-drift 16s ease-in-out infinite alternate; }
.jae3-internal-hero__content { position: relative; padding-block: 95px 72px; }
.jae3-internal-hero h1 { max-width: 980px; margin: 20px 0 18px; color: #fff; font-size: clamp(54px,7vw,96px); font-weight: 820 !important; font-variation-settings: "wght" 820; line-height: .92; letter-spacing: -.07em; }
.jae3-internal-hero p { max-width: 630px; margin: 0; color: rgba(255,255,255,.75); font-size: clamp(17px,1.5vw,21px); line-height: 1.55; }
.jae3-internal-hero__mark { position: absolute; right: 0; bottom: -42px; z-index: -1; color: transparent; font-size: clamp(120px,18vw,260px); font-weight: 850; letter-spacing: -.1em; -webkit-text-stroke: 1px rgba(255,255,255,.14); }
@keyframes jae3-internal-drift { to { transform: scale(1.035) translateX(-.8%); } }

body.jae3-internal-page .jae3-source-title { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; }
body.jae3-internal-page .site-content,
body.jae3-internal-page #content { background: var(--jae-paper); }

/* Editorial pages and custom post archives. */
body.jae3-global-enabled:not(.jae-v3-enabled) :where(.site-main > .page-header,.site-main > .entry-header,.woocommerce-products-header) {
  width: var(--jae-content);
  margin: 64px auto 30px;
}
body.jae3-global-enabled:not(.jae-v3-enabled) :where(.entry-content,.page-content,.archive-content) {
  --e-global-color-primary: var(--jae-navy);
  color: var(--jae-ink);
}
body.jae3-global-enabled:not(.jae-v3-enabled) :where(.entry-content,.page-content) :where(p,li) { line-height: 1.72; }
body.jae3-global-enabled:not(.jae-v3-enabled) :where(.elementor-widget-container,.e-con,.elementor-section) { --jae-motion-ease: var(--jae-ease); }

body.jae3-global-enabled :where(.post,.type-recurso,.type-proyectos,.type-etn,.type-equipo,.ecomus-post-grid__item,.elementor-post) {
  border-radius: 22px;
}
body.jae3-global-enabled :where(.post-thumbnail,.entry-thumbnail,.ecomus-post-grid__thumbnail) { overflow: hidden; border-radius: 20px; }
body.jae3-global-enabled :where(.post-thumbnail,.entry-thumbnail,.ecomus-post-grid__thumbnail) img { transition: transform .8s var(--jae-ease),filter .5s; }
body.jae3-global-enabled :where(.post,.type-recurso,.type-proyectos,.type-etn,.type-equipo,.ecomus-post-grid__item):hover :where(.post-thumbnail,.entry-thumbnail,.ecomus-post-grid__thumbnail) img { transform: scale(1.035); }

/* Forms share the same accessible interaction language. */
body.jae3-global-enabled :where(input[type="text"],input[type="email"],input[type="search"],input[type="tel"],input[type="password"],input[type="number"],select,textarea) {
  min-height: 52px;
  color: var(--jae-ink);
  background: #fff;
  border: 1px solid var(--jae-line);
  border-radius: 14px;
  transition: border .25s,box-shadow .25s,background .25s;
}
body.jae3-global-enabled :where(input,select,textarea):focus { border-color: rgba(47,134,199,.6) !important; outline: 0; box-shadow: 0 0 0 5px rgba(47,134,199,.1); }
body.jae3-global-enabled :where(button,.button,input[type="submit"],.wp-element-button):not(.header-search__button) {
  border-radius: 999px;
  font-weight: 720;
  transition: color .25s,background .25s,border .25s,box-shadow .3s,transform .3s var(--jae-ease);
}
body.jae3-global-enabled :where(button,.button,input[type="submit"],.wp-element-button):not(.header-search__button):hover { transform: translateY(-2px); }

/* WooCommerce stays fully native; only its presentation is upgraded. */
body.jae3-global-enabled.woocommerce :where(.site-main,.content-area),
body.jae3-global-enabled.woocommerce-page :where(.site-main,.content-area) { color: var(--jae-ink); }
body.jae3-global-enabled :where(.woocommerce .products,.wc-block-grid__products) { gap: 18px 0; }
body.jae3-global-enabled :where(.woocommerce ul.products li.product,.wc-block-grid__product) {
  padding: 10px 10px 22px !important;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(2,48,71,.08);
  border-radius: 22px;
  box-shadow: 0 12px 36px rgba(2,48,71,.07);
  transition: transform .42s var(--jae-ease),box-shadow .42s;
}
body.jae3-global-enabled :where(.woocommerce ul.products li.product,.wc-block-grid__product):hover { box-shadow: 0 28px 64px rgba(2,48,71,.13); transform: translateY(-7px); }
body.jae3-global-enabled .woocommerce ul.products li.product :where(.woocommerce-loop-product__link,.product-thumbnail) { overflow: hidden; border-radius: 16px; }
body.jae3-global-enabled .woocommerce ul.products li.product img { background: #f3f1eb; transition: transform .65s var(--jae-ease); }
body.jae3-global-enabled .woocommerce ul.products li.product:hover img { transform: scale(1.035); }
body.jae3-global-enabled .woocommerce ul.products li.product .woocommerce-loop-product__title { padding-inline: 8px; color: var(--jae-navy); font-size: 16px; font-weight: 750; line-height: 1.35; }
body.jae3-global-enabled .woocommerce ul.products li.product .price { padding-inline: 8px; color: var(--jae-navy); font-weight: 750; }
body.jae3-global-enabled .woocommerce :where(.button,.single_add_to_cart_button,.checkout-button) { color: #fff !important; background: var(--jae-accent) !important; border-color: var(--jae-accent) !important; box-shadow: 0 12px 28px rgba(246,125,13,.2); }
body.jae3-global-enabled .woocommerce :where(.button,.single_add_to_cart_button,.checkout-button):hover { color: #fff !important; background: var(--jae-navy) !important; border-color: var(--jae-navy) !important; }

body.jae3-global-enabled :where(.woocommerce-cart-form,.cart_totals,.woocommerce-checkout-review-order,.woocommerce-form-login,.woocommerce-MyAccount-navigation,.woocommerce-MyAccount-content,.product .summary) {
  padding: clamp(22px,3vw,38px);
  background: #fff;
  border: 1px solid var(--jae-line);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(2,48,71,.08);
}
body.jae3-global-enabled .woocommerce-MyAccount-navigation ul { margin: 0; padding: 0; list-style: none; }
body.jae3-global-enabled .woocommerce-MyAccount-navigation a { display: block; padding: 12px 14px; color: var(--jae-navy); border-radius: 11px; font-weight: 680; }
body.jae3-global-enabled .woocommerce-MyAccount-navigation li.is-active a,
body.jae3-global-enabled .woocommerce-MyAccount-navigation a:hover { color: #fff; background: var(--jae-navy); }
body.jae3-global-enabled :where(.woocommerce-message,.woocommerce-info,.woocommerce-error) { background: #fff; border-radius: 15px; box-shadow: 0 10px 30px rgba(2,48,71,.07); }

/* Shared footer treatment on pages that use the theme footer template. */
body.jae3-global-enabled .jae3-live-footer { color: rgba(255,255,255,.68) !important; background: var(--jae-navy-deep) !important; }
body.jae3-global-enabled .jae3-live-footer :where(h2,h3,h4,.widget-title) { color: #fff !important; }
body.jae3-global-enabled .jae3-live-footer a { transition: color .22s,transform .25s; }
body.jae3-global-enabled .jae3-live-footer a:hover { color: var(--jae-accent) !important; }

@media (max-width: 900px) {
  body.jae3-global-enabled { --jae-content: min(100% - 36px,1320px); }
  .jae3-internal-hero { min-height: 390px; }
  .jae3-internal-hero__content { padding-block: 80px 60px; }
}

@media (max-width: 767px) {
  body.jae3-global-enabled { --jae-content: calc(100% - 30px); }
  .jae3-internal-hero { min-height: 360px; }
  .jae3-internal-hero::after { background: linear-gradient(90deg,rgba(1,31,45,.95),rgba(2,48,71,.64)),linear-gradient(0deg,rgba(1,31,45,.62),transparent); }
  .jae3-internal-hero__content { padding-block: 72px 50px; }
  .jae3-internal-hero h1 { font-size: clamp(46px,14vw,65px); }
  .jae3-internal-hero p { max-width: 92%; font-size: 16px; }
  .jae3-internal-hero__mark { right: -10px; bottom: -28px; font-size: 120px; }
  body.jae3-global-enabled :where(.woocommerce-cart-form,.cart_totals,.woocommerce-checkout-review-order,.woocommerce-form-login,.woocommerce-MyAccount-navigation,.woocommerce-MyAccount-content,.product .summary) { padding: 18px; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .jae3-internal-hero__media img { animation: none; }
}
