/**
 * Final theme overrides — loads last.
 * Buttons, shop/product mobile, archive titles. Keeps one winning layer instead of scattered footer locks.
 */

/* --------------------------------------------------------------------------
   Site layout — main, header, logo, nav, footer
   -------------------------------------------------------------------------- */
.site-main {
  padding-bottom: 0;
}

.terea-logo-img,
.terea-logo-link img,
.custom-logo,
.wh-header-logo img,
.wh-header-logo .custom-logo,
.terea-header-logo .terea-logo-img {
  height: 80px !important;
  max-height: 100px !important;
  max-width: 200px !important;
  width: auto !important;
  object-fit: contain;
}

.wh-site-header {
  padding: 15px 0;
}

.wh-archive-main--cards .wh-archive-specs {
  margin-bottom: 50px;
}

.wh-thank-you-grid {
  padding: 50px 0;
}

.i3d-hero--split .i3d-hero__media {
  background: none;
}

#menu-main-navigation li > a,
.wh-nav-menu > li > a,
.terea-nav-menu > li > a {
  font-size: 24px !important;
  font-weight: 600 !important;
  text-transform: capitalize !important;
}

.footer-col h3.footer-title,
.footer-col .footer-widget-title,
.footer-col .widget-title,
#nav_menu-2 h3,
#nav_menu-3 h3,
#custom_html-2 h3 {
  font-size: 16px !important;
  color: #000 !important;
}

#menu-footer-legal-link li a,
.wh-site-footer .footer-bottom-links a {
  font-size: 16px;
  line-height: 24px;
}

@media (max-width: 992px) {
  .terea-logo-img,
  .terea-logo-link img,
  .custom-logo,
  .wh-header-logo img,
  .wh-header-logo .custom-logo,
  .terea-header-logo .terea-logo-img,
  .terea-cat-drawer-brand .terea-logo-img {
    height: auto !important;
    max-height: 36px !important;
    max-width: 160px !important;
    width: auto !important;
  }

  #menu-main-navigation li > a,
  .wh-nav-menu > li > a,
  .terea-nav-menu > li > a {
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  .terea-logo-img,
  .terea-logo-link img,
  .custom-logo,
  .wh-header-logo img,
  .wh-header-logo .custom-logo,
  .terea-header-logo .terea-logo-img,
  .terea-cat-drawer-brand .terea-logo-img {
    height: auto !important;
    max-height: 32px !important;
    max-width: 140px !important;
  }
}

/* About + Case Study — natural image ratio, no fill boxes (source: i3d-brand.css) */
.wh-about-main .i3d-about-story__frame,
.wh-about-main .wh-rnd-process__media,
.wh-about-main .i3d-qa__shot,
.wh-case-study-page .wh-rnd-hero__media {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.wh-about-main .i3d-about-story__media img,
.wh-about-main .wh-rnd-process__media img,
.wh-about-main .i3d-qa__shot img,
.wh-case-study-page .wh-rnd-hero__media img {
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  background: transparent !important;
}

/* QA slider — edge-to-edge photos, no grey card fill */
.wh-about-main .i3d-qa {
  background: #fff !important;
}
.wh-about-main .i3d-qa__slide {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.wh-about-main .i3d-qa__slide img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  padding: 0 !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  object-position: center !important;
  background: transparent !important;
}

/* About page — tighter mobile vertical rhythm (kill empty gaps) */
@media (max-width: 720px) {
  .wh-about-main .i3d-about-story,
  .wh-about-main .i3d-about-values,
  .wh-about-main .i3d-about-consult,
  .wh-about-main .i3d-qa,
  .wh-about-main .i3d-rnd,
  .wh-about-main .i3d-consult:not(.i3d-consult--campaign),
  .wh-about-main .i3d-careers,
  .wh-about-main .wh-rnd-process,
  .wh-about-main .i3d-about-facts,
  .wh-about-main .i3d-about-vision {
    padding-top: 36px !important;
    padding-bottom: 28px !important;
  }

  .wh-about-main .i3d-about-hero,
  .wh-about-main .i3d-about-dark,
  .wh-about-main .i3d-about-team__intro,
  .wh-about-main .i3d-about-team__cards {
    padding-top: 40px !important;
    padding-bottom: 32px !important;
  }

  .wh-about-main .i3d-careers + .i3d-consult,
  .wh-about-main .i3d-careers + .i3d-about-consult {
    padding-top: 24px !important;
  }

  .wh-about-main .i3d-section-head,
  .wh-about-main .i3d-qa__head {
    margin-bottom: 22px !important;
  }

  .wh-about-main .i3d-qa__slide {
    max-height: 200px !important;
  }
}

/* --------------------------------------------------------------------------
   Buttons — match “Our story” (sentence case, body font, 8px radius)
   -------------------------------------------------------------------------- */
.i3d-btn,
button.i3d-btn,
a.i3d-btn,
.wh-btn,
button.wh-btn,
a.wh-btn,
.tx-btn,
.terea-quick-add-btn,
.wh-header-cta,
.wh-drawer-cta,
.i3d-cat-strip__link,
.i3d-cat-strip__link--all,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.single_add_to_cart_button,
.wc-block-components-button,
.wc-block-cart__submit-button {
  font-family: var(--tx-font-body, Manrope, sans-serif) !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  border-radius: 8px !important;
}

/* --------------------------------------------------------------------------
   Archive product cards — readable titles, clamped excerpt
   -------------------------------------------------------------------------- */
.terea-product-card-title,
.terea-product-card-title a {
  font-family: var(--tx-font-heading, Syne, sans-serif) !important;
  font-size: clamp(1rem, 1.2vw, 1.125rem) !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.02em !important;
  text-transform: none !important;
  min-height: 0 !important;
}

.terea-product-card-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--tx-muted, #64748b);
}

/* --------------------------------------------------------------------------
   Mobile — shop, category, product
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .i3d-masthead__title,
  .wh-archive-title,
  .wh-archive-hero h1,
  .wh-archive-products__title,
  .wh-archive-products__head h2 {
    font-size: clamp(1.45rem, 6.5vw, 2rem) !important;
    line-height: 1.12 !important;
  }

  .wh-archive-main ul.products,
  .wh-archive-main .terea-products-list,
  .i3d-archive ul.products,
  .archive-product-main ul.products,
  body.post-type-archive-product ul.products,
  body.tax-product_cat ul.products {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .terea-product-card-title,
  .terea-product-card-title a {
    font-size: max(1.0625rem, 17px) !important;
  }

  .wh-archive-main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  body.post-type-archive-product .terea-scroll-top,
  body.tax-product_cat .terea-scroll-top {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 40px;
    height: 40px;
    z-index: 40;
  }

  .i3d-hero__actions .i3d-btn,
  .i3d-intro__actions .i3d-btn,
  .i3d-consult__inner .i3d-btn {
    width: 100%;
    min-height: 50px;
    justify-content: center;
    font-size: max(1rem, 16px) !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
  }

  .wh-banner-title,
  .wh-banner h1,
  .wh-overview-title {
    font-size: clamp(1.45rem, 6.5vw, 2rem) !important;
    line-height: 1.12 !important;
  }

  .wh-product-main {
    overflow-x: clip;
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  body.single-product .terea-scroll-top {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 40px;
    height: 40px;
    z-index: 55;
  }

  /* Homepage category strip — stack chips, match hero button scale */
  .i3d-cat-strip__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
  }

  .i3d-cat-strip__label {
    width: 100%;
    font-size: 12px !important;
    letter-spacing: 0.04em !important;
    text-transform: none !important;
  }

  .i3d-cat-strip__track {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    overflow: visible !important;
    gap: 8px !important;
  }

  .i3d-cat-strip__link {
    width: 100% !important;
    min-height: 48px !important;
    font-size: max(0.9375rem, 15px) !important;
    justify-content: space-between !important;
  }

  .i3d-cat-strip__link--all {
    width: 100% !important;
    min-height: 50px !important;
    margin-left: 0 !important;
    justify-content: center !important;
    font-size: max(1rem, 16px) !important;
  }

  /* Checkout — contact/billing form before order summary */
  body.woocommerce-checkout .wc-block-components-main {
    order: -1 !important;
  }

  body.woocommerce-checkout .wc-block-components-sidebar {
    order: 0 !important;
  }

  body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .checkout-order-summary-block-fill {
    border: 0 !important;
    border-radius: 5px !important;
  }
}
