/**
 * EONYX LABS release compatibility layer.
 *
 * Loaded after all component/page styles. It normalizes the responsive
 * behavior of the classic WordPress and WooCommerce templates without
 * changing their visual identity.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

/* Keep section backgrounds full-bleed while giving homepage content a visible
 * desktop gutter. Product detail pages intentionally remain unchanged. */
body:not(.single-product) .covert-main > .section > .container,
body:not(.single-product) .covert-main > .container,
body:not(.single-product) .covert-main > header > .container,
body:not(.single-product) .covert-main > .covert-signal-band > .container,
body:not(.single-product) .covert-main > .eonyx-delivery-signal,
body:not(.single-product) .covert-main > .covert-hero > .covert-hero__content {
  width: min(var(--container-max), calc(100% - 32px));
}

@media (max-width: 640px) {
  body:not(.single-product) .covert-main > .section > .container,
  body:not(.single-product) .covert-main > .container,
  body:not(.single-product) .covert-main > header > .container,
  body:not(.single-product) .covert-main > .covert-signal-band > .container,
  body:not(.single-product) .covert-main > .eonyx-delivery-signal,
  body:not(.single-product) .covert-main > .covert-hero > .covert-hero__content {
    width: calc(100% - 16px);
  }
}

body,
.covert-site,
.covert-main,
main,
section,
.container,
.covert-pdp,
.covert-pdp > *,
.woocommerce,
.woocommerce-page {
  min-width: 0;
  max-width: 100%;
}

body {
  overflow-x: clip;
}

img,
svg,
video,
canvas,
iframe,
embed,
object {
  max-width: 100%;
}

img,
svg,
video,
canvas {
  height: auto;
}

table {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
  font: inherit;
}

.covert-post-content,
.covert-page-content,
.woocommerce-product-details__short-description,
.covert-pdp-description,
.covert-cart-drawer,
.covert-cart-drawer * {
  overflow-wrap: anywhere;
}

.covert-responsive-table,
.woocommerce .shop_table_responsive,
.woocommerce-cart-form,
.woocommerce-checkout-review-order {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

/* Normal document scrolling: the gallery is sticky on wide screens only.
   There is deliberately no inner scroll area on the purchase column. */
@media (min-width: 1100px) {
  .single-product .covert-pdp {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.88fr);
    align-items: start;
  }

  .single-product .covert-pdp__gallery {
    position: sticky;
    top: 118px;
    align-self: start;
    max-height: none;
    overflow: visible;
  }

  .single-product .covert-pdp__info,
  .single-product .covert-pdp__summary {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

.single-product .covert-pdp__gallery-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.single-product .covert-pdp__gallery-main img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.single-product .covert-pdp__thumbs {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.single-product .covert-pdp__thumbs button {
  flex: 0 0 clamp(68px, 8vw, 92px);
}

.single-product .covert-pdp-purchase-actions,
.single-product .covert-pdp-purchase-actions form.cart,
.single-product .covert-pdp-purchase-actions .woocommerce-variation-add-to-cart {
  width: 100%;
  min-width: 0;
}

.single-product .covert-pdp-buy-now,
.single-product .single_add_to_cart_button {
  min-height: 48px;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .select2-container {
  width: 100% !important;
}

.covert-archive-header h1,
.covert-page-hero h1,
.covert-pdp__title,
.covert-pdp__info h1,
.section-head h2 {
  text-wrap: balance;
}

@media (max-width: 1099px) {
  .single-product .covert-pdp {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.5rem, 5vw, 3.5rem);
  }

  .single-product .covert-pdp__gallery {
    position: static;
    top: auto;
    width: 100%;
    max-height: none;
    overflow: visible;
  }

  .single-product .covert-pdp__gallery-main {
    max-height: min(76vh, 760px);
  }

  .single-product .covert-pdp__info,
  .single-product .covert-pdp__summary {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .covert-info-grid,
  .covert-pdp-features,
  .covert-pdp-features--purchase {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .covert-product-grid,
  .products.columns-4,
  .products.columns-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .covert-collection-editorial,
  .covert-contact-strip__inner,
  .covert-delivery-signal__inner,
  .covert-split-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 782px) {
  body.admin-bar .site-header,
  body.admin-bar .covert-header {
    top: 46px;
  }

  .container,
  .section,
  .covert-woo-wrap,
  .covert-page-hero,
  .covert-archive-header {
    padding-inline: clamp(1rem, 4vw, 1.5rem);
  }

  .covert-page-hero,
  .inner-hero {
    min-height: 0;
    padding-top: clamp(9rem, 25vw, 12rem);
    padding-bottom: clamp(3rem, 10vw, 5rem);
  }

  .covert-page-hero h1,
  .inner-hero h1,
  .covert-pdp__title,
  .covert-pdp__info h1 {
    max-width: 100%;
    font-size: clamp(2.5rem, 13vw, 4.75rem);
    line-height: 0.86;
  }

  .covert-product-grid,
  .products.columns-4,
  .products.columns-3,
  .covert-info-grid,
  .covert-pdp-features,
  .covert-pdp-features--purchase,
  .covert-blog-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .covert-pdp-pricing {
    grid-template-columns: minmax(0, 1fr);
  }

  .covert-pdp-pricing__status,
  .covert-pdp-pricing__unit {
    text-align: left;
  }

  .covert-pdp-tabs__nav {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .covert-pdp-tabs__nav button {
    flex: 0 0 auto;
    min-width: 148px;
  }

  .covert-pdp-tabs__nav button:last-child {
    grid-column: auto;
  }

  .covert-pdp-tabs__panel,
  .covert-lab-results,
  .covert-storage-panel,
  .covert-certificate-panel {
    min-width: 0;
  }

  .covert-lab-results,
  .covert-storage-panel,
  .covert-certificate-panel,
  .covert-contact-strip__fields,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .covert-cart-drawer {
    width: min(100%, 430px);
    max-width: 100%;
  }

  .covert-cart-drawer__benefits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .woocommerce table.shop_table_responsive thead {
    display: none;
  }
}

@media (max-width: 600px) {
  .notice,
  .covert-announcement {
    font-size: 0.55rem;
  }

  .site-header,
  .covert-header {
    padding-inline: 1rem;
  }

  .logo img,
  .covert-header__logo img {
    width: clamp(118px, 38vw, 150px);
  }

  .covert-pdp__gallery,
  .covert-pdp__info {
    padding: 0.75rem;
    border-radius: 14px;
  }

  .single-product .covert-pdp__gallery-main {
    max-height: none;
  }

  .covert-pdp-options__choices,
  .covert-pdp-volume__choices,
  .covert-quick-buy__presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .single-product .covert-variations .woocommerce-variation-add-to-cart,
  .single-product .covert-variations form.cart:not(.variations_form) {
    grid-template-columns: minmax(78px, 0.3fr) minmax(0, 1fr);
  }

  .covert-pdp-purchase-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .covert-pdp-buy-now,
  .single-product .single_add_to_cart_button,
  .woocommerce a.button,
  .woocommerce button.button,
  .woocommerce input.button {
    width: 100%;
    justify-content: center;
  }

  .covert-cart-drawer {
    inset-inline: 0;
    width: 100%;
    border-left: 0;
  }

  .covert-cart-drawer__benefits {
    grid-template-columns: minmax(0, 1fr);
  }

  .covert-delivery-signal__map,
  .covert-delivery-signal__copy {
    min-width: 0;
  }

  .copyright,
  .covert-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (max-width: 380px) {
  .covert-pdp-options__choices,
  .covert-pdp-volume__choices,
  .covert-quick-buy__presets {
    grid-template-columns: minmax(0, 1fr);
  }

  .single-product .covert-variations .woocommerce-variation-add-to-cart,
  .single-product .covert-variations form.cart:not(.variations_form) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .covert-header,
  .covert-announcement,
  .covert-cart-drawer,
  .covert-mobile-menu,
  .covert-contact-strip,
  footer {
    display: none !important;
  }

  body,
  .covert-main {
    background: #fff !important;
    color: #000 !important;
  }
}

/* Final mobile guardrails: this file is enqueued after the visual layers. */
@media (max-width: 782px) {
  html, body, #page, .covert-site, .covert-main, .covert-main > * { max-width: 100%; min-width: 0; }
  .covert-header__inner { width: 100%; min-height: 70px; padding-inline: .25rem; gap: .5rem; }
  .covert-header > .container { width: 100%; max-width: none; padding-inline: .5rem; }
  .covert-logo, .covert-logo img, .covert-logo .custom-logo { min-width: 0; max-width: 48vw; width: 145px; height: auto; }
  .covert-header__actions { min-width: 0; margin-left: auto; gap: .15rem; }
  .covert-header__actions .covert-icon-btn, .covert-hamburger { flex: 0 0 36px; width: 36px; height: 36px; }
  .covert-mobile-menu { display: block; width: min(360px, 88vw); max-width: 100vw; height: 100dvh; padding: 1.25rem; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .covert-mobile-menu ul, .covert-mobile-menu li, .covert-mobile-menu li > a { width: 100%; min-width: 0; }
  .covert-mobile-menu li > a { box-sizing: border-box; overflow-wrap: anywhere; }
  .covert-mobile-menu li > a.covert-mobile-collection { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: .75rem; font-size: 1rem; line-height: 1.1; }
  .covert-mobile-collection img { display: block; width: 58px; height: 48px; max-width: 58px; object-fit: cover; }
  .covert-main > .section > .container, .covert-main > .container, .covert-main > header > .container, .covert-main > .covert-signal-band > .container, .covert-main > .eonyx-delivery-signal, .covert-main > .covert-hero > .covert-hero__content { width: calc(100% - 16px); max-width: calc(100% - 16px); padding-inline: .5rem; }
  .covert-product-grid, .woocommerce ul.products, .covert-card, .covert-card__body, .covert-card__title-row { min-width: 0; max-width: 100%; }
  .covert-product-grid, .woocommerce ul.products { grid-template-columns: minmax(0, 1fr) !important; width: 100%; }
  .covert-card__media, .covert-card__image, .covert-card__image--front { display: block !important; visibility: visible !important; opacity: 1 !important; width: 100%; max-width: 100%; }
  .covert-card__image, .covert-card__image--front { height: 100%; object-fit: cover; }
  .covert-card__title, .covert-card__title a, .covert-card__name, .covert-card__name a { display: block !important; visibility: visible !important; opacity: 1 !important; max-width: 100%; color: #fff !important; overflow-wrap: anywhere; }
  .covert-card__title { font-size: 1.2rem; line-height: 1.05; }
  .covert-card__description, .covert-quick-buy, .covert-quick-buy__actions, .covert-quick-buy__quantity-row { min-width: 0; max-width: 100%; }
  .covert-quick-buy__actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .covert-quick-buy__submit { grid-column: 1 / -1; }
  img, svg, video, iframe { max-width: 100%; }

  /* Mobile must never hide content while waiting for scroll-reveal JS. */
  [data-covert-reveal] { opacity: 1 !important; transform: none !important; }
  .covert-main, .covert-main section, .covert-main .container, .covert-main article, .covert-main a { overflow-wrap: anywhere; }
  .covert-main p, .covert-main h1, .covert-main h2, .covert-main h3 { max-width: 100%; }

  .covert-hero--v2 { min-height: 620px; width: 100%; overflow: hidden; }
  .covert-hero--v2 .covert-hero__content { box-sizing: border-box; width: 100%; max-width: 100%; padding-block: 3rem; }
  .covert-hero--v2 h1 { font-size: clamp(2.6rem, 14vw, 4.6rem); line-height: .88; overflow-wrap: anywhere; }
  .covert-hero--v2 p { max-width: 100%; font-size: 1rem; line-height: 1.5; }

  #shop-by-need .covert-need-carousel__track { width: 100%; max-width: 100%; margin-inline: 0; padding-inline: 0; }
  #shop-by-need .covert-need-carousel__track > .covert-banner-tile { flex-basis: 100%; width: 100%; max-width: 100%; }
  .covert-banner-tile { min-width: 0; width: 100%; max-width: 100%; aspect-ratio: 1 / 1.15; }
  .covert-banner-tile__label { max-width: calc(100% - 2rem); font-size: clamp(1.8rem, 9vw, 3rem); line-height: .9; overflow-wrap: anywhere; }

  .covert-showcase-grid, .covert-showcase-tile { width: 100%; max-width: 100%; min-width: 0; }
  .covert-showcase-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .covert-showcase-tile { min-height: 420px; aspect-ratio: auto; }
  .covert-showcase-tile__content { box-sizing: border-box; width: 100%; max-width: 100%; padding: 1.25rem; }
  .covert-showcase-tile__content h3 { max-width: 100%; font-size: clamp(2rem, 10vw, 3.8rem); line-height: .9; overflow-wrap: anywhere; }
  .covert-showcase-tile__content p { max-width: 100%; font-size: 1rem; line-height: 1.45; overflow-wrap: anywhere; }

  .covert-archive-hero { width: 100%; max-width: 100%; aspect-ratio: auto; min-height: 420px; }
  .covert-archive-hero__content { width: 100%; max-width: 100%; box-sizing: border-box; padding: 1rem; }
  .covert-archive-hero__content h1 { font-size: clamp(2rem, 10vw, 3.5rem); line-height: .92; overflow-wrap: anywhere; }
  .covert-archive-hero__content p { max-width: 100%; line-height: 1.45; }
}
