/* ==========================================================================
   Wheelchire — global mobile polish
   ========================================================================== */

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* Prefer readable tap targets on touch devices */
@media (max-width: 992px) {
  a,
  button,
  input,
  select,
  textarea {
    touch-action: manipulation;
  }

  .terea-page-header {
    padding: 28px 0 18px !important;
  }

  .terea-page-header h1 {
    font-size: clamp(1.55rem, 7vw, 2.1rem) !important;
    line-height: 1.15 !important;
    word-break: break-word;
  }

  .terea-page-header p {
    font-size: max(1.0625rem, 17px) !important;
    line-height: 1.65 !important;
    max-width: 42ch;
  }

  .container,
  .wh-product-main .container,
  .wh-site-page .container,
  .terea-container {
    /* Shell padding is owned by layout-responsive (header-matched breakpoints) */
    max-width: min(1320px, 100%);
  }

  .wh-site-footer .footer-grid {
    gap: 28px !important;
  }

  .wh-btn,
  .wh-drawer-cta,
  .terea-contact-submit,
  button[type="submit"]:not(.wh-contact-submit),
  .woocommerce a.button,
  .woocommerce button.button {
    min-height: 50px;
    min-width: 44px;
    font-size: var(--tx-btn-font-size, 17px);
  }

  .wh-contact-form .wh-contact-submit {
    min-height: 44px;
    min-width: 148px;
    width: auto;
    font-size: 15px;
    text-transform: none;
  }

  /* Keep header CTA compact — do not inherit large button polish */
  .wh-header-cta {
    min-height: 40px;
    min-width: 0;
    font-size: 12px;
  }

  .main-navigation a,
  .terea-nav a,
  .wh-nav a {
    font-size: max(17px, var(--tx-nav-font-size, 18px));
    padding-top: 12px;
    padding-bottom: 12px;
  }

  /* Shop archive */
  .wh-shop-hero,
  .wh-archive-hero {
    padding-top: 36px !important;
    padding-bottom: 36px !important;
  }

  .wh-shop-hero h1,
  .wh-archive-hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
  }

  /* Forms — readable contrast + spacing */
  .wh-contact-form-card,
  .wh-contact-aside,
  .wh-inquiry-form,
  .wh-dealer-card-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important; /* avoid iOS zoom */
    line-height: 1.45;
    min-height: 44px;
  }

  body.woocommerce-cart .wc-block-components-text-input input,
  body.woocommerce-checkout .wc-block-components-text-input input,
  body.woocommerce-checkout .wc-block-components-combobox input,
  body.woocommerce-checkout .terea-checkout-form .input-text,
  body.woocommerce-cart .wh-flow-form .input-text {
    min-height: 44px !important;
    padding: 10px 12px !important;
    font-size: 16px !important;
  }

  textarea {
    min-height: 120px;
  }

  /* Prevent sticky CTA covering content */
  .wh-product-main,
  .wh-kseries {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  /* Homepage sections breathing room */
  .tx-section,
  .terea-section {
    overflow-x: clip;
  }

  .site-footer {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    overflow: visible;
  }

  .site-footer .container,
  .wh-site-footer .container {
    max-width: min(1320px, 100%);
  }

  .footer-grid {
    gap: 28px !important;
  }

  .footer-col a,
  .footer-contact-list span,
  .footer-contact-list a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .footer-payment {
    display: flex !important;
    visibility: visible !important;
  }

  .footer-bottom-links a {
    color: inherit;
    font-size: 14px;
    font-weight: 600;
  }
}

@media (max-width: 768px) {
  body:not(.woocommerce-cart):not(.woocommerce-checkout) {
    font-size: max(1.0625rem, var(--tx-font-size, 18px));
  }

  body:not(.woocommerce-cart):not(.woocommerce-checkout) h1 {
    font-size: clamp(1.85rem, 8vw, var(--tx-font-h1, 2.75rem)) !important;
  }

  body:not(.woocommerce-cart):not(.woocommerce-checkout) h2 {
    font-size: clamp(1.5rem, 6vw, var(--tx-font-h2, 2.125rem)) !important;
  }

  body:not(.woocommerce-cart):not(.woocommerce-checkout) h3 {
    font-size: clamp(1.25rem, 5vw, var(--tx-font-h3, 1.75rem)) !important;
  }

  /* Shop / category archive — keep page titles proportional */
  .wh-archive-hero h1,
  .wh-archive-title,
  .wh-shop-hero h1 {
    font-size: clamp(1.45rem, 6.5vw, 2rem) !important;
    line-height: 1.12 !important;
  }

  /* Product cards — readable but not oversized on narrow screens */
  .terea-product-card-title,
  .terea-product-card-title a {
    font-size: max(1.0625rem, 17px) !important;
    min-height: 0 !important;
  }

  .terea-product-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.45;
    color: #64748b;
  }

  /* Scroll-to-top — avoid overlapping product cards / sticky CTA */
  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;
  }

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

  /* Product page — lock hero/overview titles against global h1 inflation */
  .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-jump,
  .wh-jump-nav {
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .wh-product-jump::-webkit-scrollbar,
  .wh-jump-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 640px) {
  .wh-stat-chips {
    gap: 18px;
  }

  .wh-stat-chip {
    width: 104px;
  }

  .wh-stat-chip-value {
    width: 84px;
    height: 84px;
    font-size: 0.95rem;
  }

  .wh-about-cta-inner,
  .wh-dealer-strip-inner,
  .wh-options-summary {
    align-items: stretch !important;
  }

  .wh-dealers-toolbar input,
  .wh-dealers-toolbar select,
  .wh-contact-form input,
  .wh-contact-form select,
  .wh-contact-form textarea,
  .wh-field input,
  .wh-field textarea {
    font-size: 16px; /* avoid iOS zoom */
  }
}

@media (max-width: 380px) {
  .wh-banner-actions {
    flex-direction: column;
  }

  .wh-banner-actions .wh-btn {
    width: 100%;
  }
}
