/* Rounded catalogue surfaces and a full-width direction picker. */
body[data-theme="graphite"] #catalog .catalog-heading {
  border: 1px solid var(--gn-edge);
  border-radius: 26px;
  padding: clamp(22px, 3vw, 38px);
  overflow: hidden;
}

body[data-theme="graphite"] #catalog .catalog-filters {
  min-width: 0;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--gn-edge);
  border-radius: 26px;
  backdrop-filter: blur(24px) saturate(115%);
  -webkit-backdrop-filter: blur(24px) saturate(115%);
}

body[data-theme="graphite"] #catalog .catalog-filters .catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent!important;
  box-shadow: none;
}

body[data-theme="graphite"] #catalog .catalog-toolbar:has(.filter-tabs:not([hidden]))::before { display: none; }

body[data-theme="graphite"] #catalog .catalog-filters .filter-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  gap: 10px;
  padding: 0;
  overflow: visible;
}

body[data-theme="graphite"] #catalog .catalog-filters .filter-tabs[hidden],
body[data-theme="graphite"] #catalog .filter-tab[hidden] { display: none; }

body[data-theme="graphite"] #catalog .filter-tabs .filter-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--gn-edge);
  border-radius: 16px;
  font-size: 14px;
  text-align: left;
  white-space: normal;
  line-height: 1.4;
}

body[data-theme="graphite"] #catalog .filter-tab .category-label {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font: inherit;
  color: inherit;
  opacity: 1;
  padding: 0;
  background: none!important;
  text-transform: none;
  letter-spacing: 0;
}

body[data-theme="graphite"] #catalog .filter-tab .category-count {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 26px;
  margin: 0;
  padding: 2px 7px;
  border-radius: 9px;
  background: rgba(119,237,218,.12);
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

body[data-theme="graphite"] #catalog .catalog-toolbar .sort-label {
  justify-self: end;
  margin: 0;
  border-radius: 12px;
}

body[data-theme="graphite"] #catalog :is(.sort-label,.secondary-filters,.catalog-facets) select {
  border-radius: 12px;
  min-height: 44px;
}
body[data-theme="graphite"] #catalog .back-link { border-radius: 10px; }

body[data-theme="graphite"] #catalog .catalog-filters .filter-line {
  padding: 0;
  border: 0;
  background: transparent!important;
  box-shadow: none;
}

body[data-theme="graphite"] #catalog .catalog-filters[data-scoped="true"] .catalog-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

@media(max-width:1000px) {
  body[data-theme="graphite"] #catalog .catalog-filters .filter-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media(max-width:700px) {
  body[data-theme="graphite"] #catalog .catalog-heading,
  body[data-theme="graphite"] #catalog .catalog-filters { border-radius: 22px; }
  body[data-theme="graphite"] #catalog .catalog-filters .filter-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body[data-theme="graphite"] #catalog .filter-tabs .filter-tab { min-height: 56px; padding: 10px; font-size: 12px; gap: 7px; border-radius: 14px; }
  body[data-theme="graphite"] #catalog .filter-tab .category-count { min-width: 24px; padding-inline: 5px; font-size: 11px; }
  body[data-theme="graphite"] #catalog .catalog-filters[data-scoped="true"] .catalog-toolbar { grid-template-columns: minmax(0, 1fr); }
}
@media(max-width:360px) {
  body[data-theme="graphite"] #catalog .catalog-filters .filter-tabs { grid-template-columns: minmax(0, 1fr); }
}

/* Product geometry is shared by every catalog renderer. A definite media
   height resolves nested 100% heights; aspect-ratio alone left the original
   photo height in the auto-size calculation on narrow cards. */
body[data-theme="graphite"] .product-card[data-category]:not([data-category="starlink"]) > .product-kicker {
  position: relative;
  inset: auto;
  display: flex;
  align-items: center;
  min-height: 44px;
  height: auto;
  max-width: none;
  margin: 12px 54px 6px 16px;
  overflow-wrap: anywhere;
}
body[data-theme="graphite"] .product-card[data-category]:not([data-category="starlink"]) > .product-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(230px, 22vw, 300px);
  min-height: 0;
  aspect-ratio: auto;
  margin: 0;
  padding: 12px 20px 30px;
  overflow: hidden;
}
body[data-theme="graphite"] .product-card[data-category]:not([data-category="starlink"]) .product-image-link :is(.model-visual,.model-object,.partner-product-photo,.dji-component-photo) {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  margin: 0;
  top: auto;
  aspect-ratio: auto;
}
body[data-theme="graphite"] .product-card[data-category]:not([data-category="starlink"]) .product-image-link :is(img,svg) {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
/* Remove presentation mats, while preserving the actual source pixels. */
body[data-theme="graphite"] :is(.product-card,.product-scene,.dji-component-stage) :is(.partner-product-photo,.dji-component-photo) {
  background: transparent;
  border: 0;
  border-radius: 0;
}
body[data-theme="graphite"] .product-card[data-category]:not([data-category="starlink"]) .dji-component-photo img { padding: 0; }
/* These catalog photographs show dark radio equipment on a neutral white
   source mat. Blend only that wrapper, never white DJI/power products or the
   actual source files. This is display compositing, not an alpha cutout. */
body[data-theme="graphite"] .product-card[data-category="radio"] > .product-image-link:has(.partner-product-photo),
body[data-theme="graphite"] .product-scene[data-category="radio"] > .scene-object:has(.partner-product-photo) {
  mix-blend-mode: multiply !important;
  background: transparent !important;
}
body[data-theme="graphite"] .product-card[data-category]:not([data-category="starlink"]) > .product-info {
  position: relative;
  z-index: 4;
  min-width: 0;
}
body[data-theme="graphite"] .product-card[data-category]:not([data-category="starlink"]) .product-title {
  min-height: 0;
  overflow-wrap: anywhere;
}
@media(max-width:650px) {
  body[data-theme="graphite"] .product-card[data-category]:not([data-category="starlink"]) > .product-kicker { margin: 9px 42px 4px 12px; min-height: 38px; }
  body[data-theme="graphite"] .product-card[data-category]:not([data-category="starlink"]) > .product-image-link { height: clamp(145px, 44vw, 235px); padding: 8px 10px 26px; }
}

/* Scene titles previously sat behind an absolute photo. Mobile now gives the
   heading, equipment and specifications their own rows, even for long names. */
@media(max-width:650px) {
  body[data-theme="graphite"] .product-scene[data-category]:not([data-category="starlink"]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    height: auto;
    min-height: 0;
    padding: 30px 18px 24px;
  }
  body[data-theme="graphite"] .product-scene[data-category]:not([data-category="starlink"]) > :is(.scene-eyebrow,.scene-title,.scene-highlights,.scene-aircraft,.scene-object) {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
  body[data-theme="graphite"] .product-scene[data-category]:not([data-category="starlink"]) > .scene-title { font-size: clamp(25px, 7vw, 38px); line-height: 1.15; overflow-wrap: anywhere; }
  body[data-theme="graphite"] .product-scene[data-category]:not([data-category="starlink"]) > :is(.scene-aircraft,.scene-object) { height: clamp(230px, 65vw, 350px); }
  body[data-theme="graphite"] .product-scene[data-category]:not([data-category="starlink"]) > .scene-highlights { display: flex; flex-wrap: wrap; gap: 8px; }
  body[data-theme="graphite"] .product-scene[data-category]:not([data-category="starlink"]) > .scene-highlights > * { flex: 1 1 100px; min-width: 0; overflow-wrap: anywhere; }
}
/* Let the dark radio photo blend with the dialog's glass rather than with an
   isolated transparent scene. This leaves the source image and other products intact. */
body[data-theme="graphite"] .product-scene[data-category="radio"]:has(.partner-product-photo) { isolation: auto; }

/* Compact touch catalogue. Detail pages retain the complete description,
   configuration, delivery terms and specifications; previews focus on choice. */
@media (max-width: 900px) {
  body[data-theme="graphite"] #catalog #product-grid,
  body[data-theme="graphite"] #graphite-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card[data-category] {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 18px;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card > .product-kicker {
    position: relative;
    inset: auto;
    height: 32px;
    min-height: 32px;
    max-width: none;
    margin: 8px 48px 0 10px;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card .product-brand-logo {
    width: 92px;
    height: 26px;
    max-width: 100%;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card .compare-toggle {
    top: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 12px;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card > .product-image-link {
    height: clamp(112px, 30vw, 172px);
    min-height: 0;
    flex: 0 0 auto;
    aspect-ratio: auto;
    margin: 0;
    padding: 6px 10px 20px;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card > .product-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    min-width: 0;
    padding: 12px;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card .product-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    min-height: 44px;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.35;
    text-align: left;
    overflow-wrap: anywhere;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card :is(.product-summary, .product-variant-button, .product-fulfillment-summary, .laser-card-context) {
    display: none;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card .product-buy {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: auto;
    padding-top: 3px;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card .product-buy > div {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card .product-price {
    margin: 0;
    font-size: clamp(18px, 4.7vw, 23px);
    line-height: 1.25;
    letter-spacing: -.04em;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card .product-price .from { font-size: 12px; }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card :is(.price-caption, .price-payment-note, .product-partner) {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card :is(.add-cart, .laser-model-button) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 6px;
    gap: 5px;
    font-size: 14px;
    line-height: 1.35;
    border-radius: 12px;
  }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card :is(.add-cart, .laser-model-button) svg { width: 17px; height: 17px; flex-shrink: 0; }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card :is(.dji-photo-count, .visualization-label, .laser-image-label) { font-size: 9px; bottom: 4px; }

  /* Foldable phones also need normal document flow in the opened preview. */
  body[data-theme="graphite"] #product-dialog .product-scene[data-category]:not([data-category="starlink"]):not(:has(.fv-product-island-host)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    height: auto;
    min-height: 0;
    padding: 26px 20px 18px;
  }
  body[data-theme="graphite"] #product-dialog .product-scene[data-category]:not([data-category="starlink"]):not(:has(.fv-product-island-host)) > :is(.scene-eyebrow, .scene-title, .scene-highlights, .scene-aircraft, .scene-object) {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    transform: none;
  }
  body[data-theme="graphite"] #product-dialog .product-scene[data-category]:not([data-category="starlink"]):not(:has(.fv-product-island-host)) > .scene-title {
    font-size: clamp(22px, 4vw, 30px);
    line-height: 1.2;
    padding-right: 36px;
    overflow-wrap: anywhere;
  }
  body[data-theme="graphite"] #product-dialog .product-scene[data-category]:not([data-category="starlink"]):not(:has(.fv-product-island-host)) > :is(.scene-aircraft, .scene-object) {
    height: clamp(160px, 38vw, 240px);
    min-height: 0;
  }
  body[data-theme="graphite"] #product-dialog .product-scene[data-category]:not([data-category="starlink"]):not(:has(.fv-product-island-host)) > .scene-highlights { display: flex; flex-wrap: wrap; gap: 8px; }
  body[data-theme="graphite"] #product-dialog .product-scene[data-category]:not([data-category="starlink"]):not(:has(.fv-product-island-host)) > .scene-highlights > * { flex: 1 1 85px; min-width: 0; }
}
@media (max-width: 360px) {
  body[data-theme="graphite"] #catalog #product-grid,
  body[data-theme="graphite"] #graphite-featured-grid { gap: 8px; }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card > .product-info { padding: 10px 8px; }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card .product-title { font-size: 15px; }
  body[data-theme="graphite"] :is(#catalog #product-grid, #home #graphite-featured-grid) .product-card :is(.add-cart, .laser-model-button) { font-size: 13px; }
}
