/* 1.2.1: only catalog/detail content; mobile rules remain in the original assets. */
.petf-product-page > .petf-product-hero,
.petf-product-hero > .petf-product-summary { display: contents; }

@media (min-width: 768px) {
  /* Release the actual Elementor ancestor chain, not unrelated page widgets. */
  body :is(.elementor, .e-con, .e-con-inner, .elementor-section, .elementor-container,
    .elementor-column, .elementor-widget-wrap, .elementor-widget-shortcode,
    .elementor-widget-container, .elementor-shortcode):has(.petf-catalog) {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    --width: 100%;
    --content-width: 1280px;
    --container-max-width: 1280px;
    margin-inline: auto !important;
    padding-inline: 0 !important;
    flex-shrink: 1;
  }
  body #content.petf-product-shell {
    width: 100%; max-width: none; min-width: 0;
    margin-inline: auto; padding-inline: 0;
  }
  body .petf-catalog,
  body .petf-product-page {
    width: 100%; max-width: 1280px;
    padding-inline: 28px; padding-bottom: 40px;
    margin-inline: auto;
  }
  .petf-catalog .petf-catalog-intro { margin-bottom: 8px; }
  .petf-catalog h1 { font-size: 38px; letter-spacing: -1.2px; }
  .petf-catalog .petf-catalog-subtitle { font-size: 15px; }
  .petf-catalog .petf-catalog-search { max-width: 520px; }
  .petf-catalog .petf-catalog-search input::placeholder { font-size: 13px; }
  .petf-catalog .petf-catalog-primary {
    grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  }
  .petf-catalog .petf-catalog-category { min-height: 80px; }
  .petf-catalog .petf-catalog-category-label { font-size: 13px; }
  .petf-catalog .petf-catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px;
  }
  .petf-catalog .petf-catalog-product-info { padding: 16px; }
  .petf-catalog .petf-catalog-product-name { font-size: 15px; line-height: 21px; height: 42px; }
  .petf-catalog .petf-catalog-model { font-size: 12px; }
  .petf-catalog .petf-catalog-results,
  .petf-catalog .petf-catalog-subcount { font-size: 12px; }
  .petf-catalog .petf-catalog-more { max-width: 360px; margin-inline: auto; }
  .petf-catalog .petf-catalog-cta { padding: 28px; }
  .petf-catalog .petf-catalog-cta h2 { max-width: none; }
  .petf-catalog .petf-catalog-cta-actions { max-width: 440px; }
  .petf-product-page .petf-product-gallery,
  .petf-product-page .petf-product-summary { min-width: 0; }
  .petf-product-page .petf-product-main { max-width: 580px; margin-inline: auto; }
  .petf-product-page .petf-product-thumbnails { justify-content: center; flex-wrap: wrap; }
  .petf-product-page .petf-product-related {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px; overflow: visible;
  }
  .petf-product-page .petf-product-related-card { width: auto; min-width: 0; }
  .petf-product-page .petf-product-related-name {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; font-size: 15px; line-height: 21px; height: 42px;
  }
  .petf-product-page .petf-product-related-image { position: relative; }
  .petf-product-page .petf-product-related-image img { position: absolute; inset: 0; }
  .petf-product-page .petf-product-spec dt { font-size: 11px; }
  .petf-product-page .petf-product-spec dd { font-size: 16px; }
  .petf-product-page .petf-product-cta { padding: 28px; }
  .petf-product-page .petf-product-cta .petf-product-actions { max-width: 480px; }
}

/* Narrow tablets keep the comfortable stacked gallery; landscape tablets use columns. */
@media (min-width: 900px) {
  .petf-product-page > .petf-product-hero {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 32px; align-items: start;
  }
  .petf-product-hero > .petf-product-summary { display: block; }
  .petf-product-page .petf-product-info { margin-top: 0; }
  .petf-product-page .petf-product-title { font-size: clamp(28px, 2.8vw, 38px); }
  .petf-product-page .petf-product-spec-section { margin-top: 24px; }
  .petf-product-page .petf-product-main { max-width: none; max-height: 580px; }
}

@media (min-width: 1025px) {
  /* Hello Elementor paints body white; the old 1280px plugin box alone painted
     cream. Separate the full-width canvas from the centered content, including
     the transparent absolute header. These selectors never match other pages. */
  body:has(:is(.petf-catalog, .petf-product-page)),
  body:has(:is(.petf-catalog, .petf-product-page)) :is(.elementor-location-header, .petf-header-section),
  body #content.petf-product-shell,
  body :is(.elementor, .e-con, .e-con-inner, .elementor-section, .elementor-container,
    .elementor-column, .elementor-widget-wrap, .elementor-widget-shortcode,
    .elementor-widget-container, .elementor-shortcode):has(.petf-catalog) {
    background-color: #FBF7F1;
  }
  body :is(.elementor, .e-con, .e-con-inner):has(.petf-catalog) {
    --content-width: 1600px;
    --container-max-width: 1600px;
  }
  body .petf-catalog,
  body .petf-product-page,
  body:has(:is(.petf-catalog, .petf-product-page)) .petf-header-section .petf-header-inner {
    width: 92%; max-width: 1600px; padding-inline: 0; margin-inline: auto;
  }
  .petf-product-page > .petf-product-hero { gap: clamp(40px, 3vw, 56px); }
  .petf-product-page .petf-product-main {
    aspect-ratio: auto; height: clamp(500px, 38vw, 620px); max-height: none;
  }
  .petf-product-page .petf-product-title {
    margin-top: 6px; font-size: clamp(28px, 2.5vw, 36px); line-height: 1.15;
  }
  .petf-product-page .petf-product-model { margin-top: 6px; }
  .petf-product-page .petf-product-info .petf-product-actions { margin-top: 14px; }
  .petf-product-page .petf-product-info .petf-product-button { min-height: 48px; }
  .petf-product-page .petf-product-section { margin-top: 24px; }
  .petf-product-page .petf-product-spec-section { margin-top: 20px; }
  .petf-product-page .petf-product-specs { margin-top: 12px; }
  .petf-product-page .petf-product-spec { padding: 14px; }
  .petf-product-page .petf-product-spec dd { margin-top: 6px; }
  body .petf-catalog { display: grid; grid-template-columns: 240px minmax(0, 1fr); column-gap: 32px; row-gap: 32px; }
  .petf-catalog .petf-catalog-intro {
    grid-column: 1 / -1; margin: 0;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
    column-gap: 40px; align-items: center;
  }
  .petf-catalog .petf-catalog-eyebrow,
  .petf-catalog .petf-catalog-intro h1,
  .petf-catalog .petf-catalog-subtitle { grid-column: 1; }
  .petf-catalog .petf-catalog-intro h1 { font-size: 42px; }
  .petf-catalog .petf-catalog-search { grid-column: 2; grid-row: 1 / 4; margin: 0; max-width: none; }
  .petf-catalog .petf-catalog-paw { display: none; }
  .petf-catalog .petf-catalog-primary { grid-column: 1; grid-row: 2; grid-template-columns: 1fr; align-self: start; margin: 0; gap: 10px; }
  .petf-catalog .petf-catalog-category { min-height: 72px; padding: 14px; gap: 12px; }
  .petf-catalog .petf-catalog-category-label { font-size: 14px; }
  .petf-catalog .petf-catalog-collection { grid-column: 2; grid-row: 2; margin: 0; }
  .petf-catalog .petf-catalog-tabs {
    flex-wrap: wrap; overflow: visible; margin-inline: 0;
    mask-image: none; -webkit-mask-image: none;
  }
  .petf-catalog .petf-catalog-tab { white-space: normal; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
  .petf-catalog .petf-catalog-scroll-arrow { display: none; }
  .petf-catalog .petf-catalog-grid { grid-template-columns: repeat(auto-fill, minmax(max(200px, calc((100% - 66px) / 4)), 1fr)); }
  .petf-catalog .petf-catalog-cta { grid-column: 2; margin-top: 0; }
  .petf-product-page .petf-product-related { grid-template-columns: repeat(auto-fill, minmax(max(240px, calc((100% - 66px) / 4)), 1fr)); }
  .petf-product-page .petf-product-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .petf-product-page .petf-product-highlight { border-bottom: 0; }
  /* Catalog/product safe-area spacing is unnecessary on desktop. */
  body:has(:is(.petf-catalog, .petf-product-page)) .petf-page-end-space {
    display: none !important; height: 0 !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important;
  }
}
