/*
 * NuvaPaws Elite Pro v3.0 Responsive QA Layer
 * Purpose: keep every public page inside the screen on mobile/tablet/desktop.
 */
html {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
*, *::before, *::after { box-sizing: inherit; }
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
@supports not (overflow-x: clip) { body { overflow-x: hidden; } }
img, svg, video, canvas, iframe, table { max-width: 100%; }
.site-main, .nuvapaws-pro-theme, .np-site-header, .np-footer, .np-topbar, .np-hero, .np-elite-hero, section, main, header, footer {
  max-width: 100%;
}
.np-container {
  width: min(var(--np-container), calc(100% - 40px));
  max-width: min(var(--np-container), calc(100% - 40px));
}
.np-header-inner,
.np-elite-hero-grid,
.np-hero-grid,
.np-product-grid,
.np-product-grid-elite,
.np-collection-grid,
.np-category-grid,
.np-category-grid-elite,
.np-footer-grid,
.np-benefits-grid,
.np-trust-grid,
.np-comparison-grid,
.np-about-grid,
.np-contact-grid,
.np-policy-grid,
.np-faq-grid,
.np-woo-wrap,
.woocommerce ul.products {
  min-width: 0;
}
.np-product-card,
.np-collection-card,
.np-category-card,
.np-benefit-card,
.np-trust-grid > div,
.np-hero-copy,
.np-elite-copy,
.np-elite-visual,
.np-footer-brand,
.np-newsletter-card,
.np-prose,
.woocommerce ul.products li.product {
  min-width: 0;
  max-width: 100%;
}
.np-product-body h3,
.np-footer p,
.np-footer a,
.np-trust-grid strong,
.np-trust-grid span,
.np-page-hero h1,
.np-shop-hero h1,
.np-hero h1,
.np-elite-copy h1 {
  overflow-wrap: break-word;
  word-break: normal;
}

/* Tablet: keep layout elegant but never squeezed */
@media (max-width: 1120px) {
  .np-container { width: calc(100% - 32px); max-width: calc(100% - 32px); }
  .np-header-inner { grid-template-columns: auto minmax(0, 1fr) auto; }
  .np-brand { min-width: 0; }
  .np-elite-hero-grid, .np-hero-grid { grid-template-columns: 1fr; gap: 32px; min-height: 0; }
  .np-elite-visual { min-height: 560px; max-width: 760px; width: 100%; margin-inline: auto; }
  .np-collection-grid { grid-template-columns: 1fr 1fr; }
  .np-collection-large { grid-column: 1 / -1; }
  .np-product-grid-elite, .np-product-grid, .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .np-category-grid-elite { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Mobile: full-screen fit, no side cut */
@media (max-width: 782px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .np-container { width: calc(100% - 24px); max-width: calc(100% - 24px); }
  .np-topbar-inner { min-height: 36px; padding: 7px 0; font-size: 11.5px; line-height: 1.35; }

  .np-site-header { width: 100%; left: 0; right: 0; }
  .np-header-inner {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 8px 0;
    min-height: 60px;
  }
  .np-menu-toggle { display: inline-grid; }
  .np-primary-nav, .np-header-search, .hide-small { display: none !important; }
  .np-brand { justify-content: center; overflow: hidden; }
  .brand-logo { font-size: clamp(19px, 6vw, 23px); gap: 6px; white-space: nowrap; max-width: 100%; }
  .brand-logo-icon { width: 24px; height: 24px; }
  .custom-logo-link img { max-height: 46px; width: auto; }
  .np-header-actions { gap: 2px; }
  .np-icon-button { width: 38px; height: 38px; }
  .np-cart-link { flex: 0 0 38px; }
  .nuvapaws-cart-count { top: 0; right: -1px; }

  .np-elite-hero-grid, .np-hero-grid { display: block; padding: 30px 0 34px; }
  .np-elite-copy, .np-hero-copy { width: 100%; max-width: 100%; }
  .np-trust-pill { max-width: 100%; width: auto; font-size: 11.5px; padding: 7px 10px 7px 7px; line-height: 1.25; }
  .np-avatar-stack img { width: 23px; height: 23px; }
  .np-elite-copy h1, .np-hero h1 {
    font-size: clamp(34px, 11.2vw, 52px);
    line-height: .98;
    max-width: 100%;
  }
  .np-elite-copy p, .np-hero p { font-size: 15.5px; line-height: 1.6; max-width: 100%; }
  .np-hero-actions { width: 100%; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 22px; }
  .np-button, .np-hero-actions .np-link-arrow { width: 100%; min-height: 48px; justify-content: center; text-align: center; }

  .np-elite-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; max-width: 100%; gap: 7px; margin-top: 18px; }
  .np-elite-stats div { min-width: 0; padding: 11px 6px; text-align: center; border-radius: 14px; }
  .np-elite-stats strong { font-size: 17px; }
  .np-elite-stats span { font-size: 9.8px; line-height: 1.2; }

  .np-elite-visual, .np-hero-image-wrap {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-height: auto;
    width: 100%;
    max-width: 100%;
    margin-top: 22px;
  }
  .np-elite-image-card,
  .np-elite-main-image,
  .np-elite-mini-one,
  .np-elite-mini-two {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    border-width: 4px;
    border-radius: 20px;
  }
  .np-elite-main-image { grid-column: 1 / -1; }
  .np-elite-main-image img, .np-hero-image { aspect-ratio: 1.14 / 1; width: 100%; height: auto; border-radius: 20px; }
  .np-elite-mini-one img, .np-elite-mini-two img { aspect-ratio: 1 / .82; width: 100%; height: auto; }
  .np-floating-card, .np-elite-floating { display: none !important; }

  .np-elite-logo-strip .np-container { width: 100%; max-width: 100%; padding: 0 12px; overflow-x: auto; }
  .np-trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .np-trust-grid > div { min-height: 78px; align-items: flex-start; padding: 13px 7px; gap: 7px; }
  .np-trust-grid .np-icon { width: 21px; height: 21px; flex: 0 0 21px; }
  .np-trust-grid strong { font-size: 11.5px; line-height: 1.25; }
  .np-trust-grid span { font-size: 10.5px; line-height: 1.25; }

  .np-section { padding: 38px 0; }
  .np-section-head { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 18px; }
  .np-section-head h2, .np-elite-story-copy h2, .np-comparison-grid h2, .np-faq-grid h2 { font-size: clamp(29px, 9vw, 40px); line-height: 1.02; }
  .np-kicker { font-size: 10.5px; }

  .np-collection-grid { grid-template-columns: 1fr; gap: 14px; }
  .np-collection-card, .np-collection-large { min-height: 260px; border-radius: 20px; padding: 20px; }
  .np-collection-card strong { font-size: clamp(24px, 8vw, 30px); }

  .np-product-grid, .np-product-grid-elite, .woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 11px;
    width: 100%;
  }
  .np-product-card, .woocommerce ul.products li.product { border-radius: 15px; padding: 7px !important; }
  .np-product-media, .woocommerce ul.products li.product a img { aspect-ratio: 1 / 1; border-radius: 13px; }
  .np-badge { font-size: 9.5px; padding: 5px 7px; top: 8px; left: 8px; }
  .np-wishlist { width: 32px; height: 32px; top: 7px; right: 7px; }
  .np-product-body { padding: 11px 2px 2px; }
  .np-product-body h3, .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 13px; min-height: 37px; line-height: 1.35; }
  .np-rating { margin-top: 7px; font-size: 10.5px; gap: 3px; flex-wrap: wrap; }
  .np-stars { font-size: 11.5px; letter-spacing: 0; }
  .np-price, .woocommerce ul.products li.product .price { font-size: 16.5px !important; margin: 7px 0 9px !important; }
  .np-add-cart, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button { min-height: 39px; font-size: 11.5px !important; padding: 0 7px !important; }
  .np-add-cart .np-icon { width: 16px; height: 16px; }

  .np-elite-story, .np-summer-promo, .np-newsletter-large { grid-template-columns: 1fr; border-radius: 20px; padding: 15px; gap: 16px; }
  .np-elite-story-image { min-height: auto; border-radius: 18px; }
  .np-elite-story-image img, .np-promo-image img { aspect-ratio: 1.16 / 1; width: 100%; height: auto; }
  .np-elite-story-copy { padding: 4px; }
  .np-story-checks div { align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
  .np-promo-icons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .np-promo-icons div { min-height: 72px; }

  .np-category-grid, .np-category-grid-elite { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px 7px; }
  .np-category-card { gap: 8px; }
  .np-category-card span { width: min(27vw, 88px); height: min(27vw, 88px); }
  .np-category-card strong { font-size: 11px; line-height: 1.22; }

  .np-comparison-grid,
  .np-comparison-card,
  .np-faq-grid,
  .np-footer-grid,
  .np-benefits-grid,
  .np-about-grid,
  .np-contact-grid,
  .np-policy-grid,
  .np-testimonial-grid,
  .np-post-grid,
  .np-woo-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .np-comparison-card div, .np-testimonial-grid article, .np-contact-card, .np-contact-form, .np-policy-grid article, .np-benefit-card { padding: 18px; }
  .np-newsletter-large form, .np-newsletter-card form { flex-direction: column; width: 100%; }
  .np-newsletter-large input, .np-newsletter-card input, .np-newsletter-large button, .np-newsletter-card button { width: 100%; }
  .np-footer { padding-bottom: 92px; }
  .np-footer-bottom { flex-direction: column; gap: 8px; }
  .np-mobile-bottom { width: 100%; left: 0; right: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .np-page-hero, .np-shop-hero { padding: 38px 0 22px; }
  .np-page-hero h1, .np-shop-hero h1 { font-size: clamp(32px, 10.5vw, 48px); line-height: 1; }
  .np-page-hero p, .np-shop-hero p { font-size: 15.5px; }
  .np-prose, .np-track-card, .np-size-card, .np-legal-card { padding: 18px; border-radius: 18px; overflow-x: auto; }

  .woocommerce div.product { padding: 14px; overflow: hidden; }
  .woocommerce div.product .product_title { font-size: clamp(30px, 10vw, 44px); }
  .woocommerce div.product form.cart .button { width: 100%; margin-top: 10px; }
  .np-product-assurance { grid-template-columns: 1fr; }
}

/* Very small phones */
@media (max-width: 390px) {
  .np-container { width: calc(100% - 18px); max-width: calc(100% - 18px); }
  .brand-logo { font-size: 19px; }
  .brand-logo-icon { width: 22px; height: 22px; }
  .np-icon-button { width: 35px; height: 35px; }
  .np-header-inner { grid-template-columns: 36px minmax(0, 1fr) 36px; }
  .np-header-actions .np-icon-button:not(.np-cart-link) { display: none; }
  .np-elite-copy h1, .np-hero h1 { font-size: clamp(32px, 11vw, 44px); }
  .np-elite-stats { grid-template-columns: 1fr; }
  .np-product-grid, .np-product-grid-elite, .woocommerce ul.products { grid-template-columns:repeat(2, minmax(0, 1fr)) !important; }
  .np-product-body h3 { min-height: auto; }
  .np-category-grid, .np-category-grid-elite { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .np-category-card span { width: 92px; height: 92px; }
}
