/* Shop (page-shop.php): compact head with buyer box, sticky tool bar with
 * filter, search and sorting, product cards. The sections of td-licenses
 * below the grid keep their skin (skin-shop.css). */

/* Head */
.phero--shop { padding: 32px 0 72px; }
.phero--shop .crumbs { margin-bottom: 48px; }
.phero--shop.phero--split .phero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 64px; align-items: end; }
.phero--shop .phero__grid:has(> .shop-aside[hidden]) { grid-template-columns: minmax(0, 1fr); }
.phero--shop .phero__title { font-size: clamp(2.5rem, 4.6vw, 4rem); }
.phero--shop .phero__lead { margin-top: 20px; font-size: 19px; }
.shop-badges { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 28px; font-size: 15px; color: var(--text-secondary); }
.shop-badges li { display: inline-flex; align-items: center; gap: 8px; }
.shop-badges svg { flex: none; color: var(--accent-cyan); }

.shop-aside { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-l); background: rgba(13, 27, 42, 0.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.shop-aside__title { font: 700 20px/1.3 var(--font-display); color: #f8fafc; }
.shop-aside__text { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
.shop-aside__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 22px; }
.shop-aside .btn svg { margin-right: 8px; }

/* Tool bar: sticks below the header, moves up when the header hides. */
.shop-catalog { padding-bottom: calc(120px * var(--k, 1)); background: var(--bg); color: var(--text-primary); }
.shop-bar { position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--header-height)); z-index: 30; border-bottom: 1px solid var(--border); background: rgba(246, 248, 251, 0.9); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); transition: top var(--duration-base) var(--ease), box-shadow var(--duration-base) var(--ease); }
body:has(.site-header.is-hidden) .shop-bar { top: var(--wp-admin--admin-bar--height, 0px); }
.shop-bar.is-stuck { box-shadow: 0 10px 30px rgba(7, 17, 31, 0.07); }
.shop-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 80px; }

.shop-filter { display: flex; gap: 8px; min-width: 0; margin: 0 -4px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
.shop-filter::-webkit-scrollbar { display: none; }
.shop-filter a { display: inline-flex; flex: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); color: var(--text-primary); font-size: 15px; font-weight: 500; white-space: nowrap; transition: background-color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease); }
.shop-filter a:hover { text-decoration: none; border-color: var(--text-muted); }
.shop-filter a[aria-current] { background: var(--brand-midnight); border-color: var(--brand-midnight); color: #f8fafc; }
.shop-filter__n { font: 500 12px/1 var(--font-mono); color: var(--text-muted); }
.shop-filter a[aria-current] .shop-filter__n { color: var(--accent-cyan); }

.shop-tools { display: flex; flex: none; align-items: center; gap: 12px; }
.no-js .shop-tools { display: none; }
.shop-search, .shop-sort { position: relative; display: flex; align-items: center; }
.shop-search svg, .shop-sort svg { position: absolute; left: 15px; color: var(--text-muted); pointer-events: none; }
.shop-search input, .shop-sort select { min-height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background-color: var(--surface); color: var(--text-primary); font: 400 15px/1.2 var(--font-sans); transition: border-color var(--duration-fast) var(--ease), width var(--duration-base) var(--ease); }
.shop-search input { width: 230px; padding: 0 16px 0 42px; }
.shop-search input:focus { width: 280px; }
.shop-sort select { -webkit-appearance: none; appearance: none; padding: 0 40px 0 40px; font-weight: 500; cursor: pointer; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235f6d82' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 16px center / 12px 8px; }
.shop-search input:hover, .shop-sort select:hover { border-color: var(--text-muted); }
.shop-search input:focus-visible, .shop-sort select:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-color: var(--primary); }

/* Status line */
.shop-catalog__body { padding-top: 32px; }
.shop-status { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.shop-count { font-weight: 600; font-size: 15px; }
.shop-note { font: 500 12px/1.5 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.shop-note:empty { display: none; }

/* Grid */
.shop-grid { --shop-cols: 3; display: grid; grid-template-columns: repeat(var(--shop-cols), minmax(0, 1fr)); gap: 28px; }
.shop-cols-2 .shop-grid { --shop-cols: 2; }
.shop-cols-4 .shop-grid { --shop-cols: 4; gap: 22px; }
.shop-media-4-3 .pcard { --shop-ratio: 4 / 3; }
.shop-media-1-1 .pcard { --shop-ratio: 1 / 1; }

/* Card. Reveal and hover use separate properties, so the hover lift
 * starts without the stagger delay of the reveal. */
.pcard { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); view-transition-class: pcard; }
.pcard, .is-motion .pcard[data-reveal] {
  transition-property: opacity, translate, transform, box-shadow, border-color;
  transition-duration: var(--duration-reveal), var(--duration-slow), var(--duration-base), var(--duration-base), var(--duration-base);
  transition-timing-function: var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms), calc(var(--i, 0) * 70ms), 0s, 0s, 0s;
}
.pcard:hover { transform: translateY(-4px); border-color: transparent; box-shadow: var(--shadow-3); }
.pcard:has(.pcard__name a:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

.pcard__media { position: relative; aspect-ratio: var(--shop-ratio, 16 / 10); overflow: hidden; border-radius: calc(var(--radius-l) - 1px) calc(var(--radius-l) - 1px) 0 0; background: var(--surface-2); }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: scale var(--duration-slow) var(--ease); }
.pcard:hover .pcard__media img { scale: 1.04; }
.pcard__media--logo { display: grid; place-items: center; background: linear-gradient(to right, var(--border) 1px, transparent 1px) 0 0 / 40px 100%, var(--surface-2); }
.pcard__media--logo img { width: 44%; height: auto; max-height: 72%; object-fit: contain; }

/* Drawn cover for products without a picture: blueprint grid, light that
 * follows the pointer (--sx/--sy from the card), a tile with the initials. */
.pcard__cover { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; color: #f8fafc;
  background:
    radial-gradient(380px circle at var(--sx, 78%) var(--sy, 16%), rgba(45, 140, 255, 0.42), rgba(45, 140, 255, 0) 62%),
    linear-gradient(to right, rgba(183, 195, 209, 0.1) 1px, transparent 1px) 0 0 / calc(100% / 6) 100%,
    linear-gradient(to bottom, rgba(183, 195, 209, 0.1) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(160deg, var(--brand-deep-navy), var(--brand-midnight)); }
.pcard--service .pcard__cover { background:
    radial-gradient(380px circle at var(--sx, 78%) var(--sy, 16%), rgba(87, 199, 255, 0.34), rgba(87, 199, 255, 0) 62%),
    linear-gradient(to right, rgba(183, 195, 209, 0.1) 1px, transparent 1px) 0 0 / calc(100% / 6) 100%,
    linear-gradient(to bottom, rgba(183, 195, 209, 0.1) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(160deg, var(--brand-deep-navy), var(--brand-midnight)); }
.pcard__tile { display: grid; place-items: center; width: clamp(84px, 28%, 112px); aspect-ratio: 1; border: 1px solid rgba(183, 195, 209, 0.28); border-radius: 28%; background: linear-gradient(145deg, rgba(45, 140, 255, 0.34), rgba(13, 27, 42, 0.7)); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14); font: 800 clamp(2rem, 3vw, 2.75rem)/1 var(--font-display); letter-spacing: -0.04em; transition: transform var(--duration-slow) var(--ease); }
.pcard--service .pcard__tile { background: linear-gradient(145deg, rgba(87, 199, 255, 0.3), rgba(13, 27, 42, 0.7)); }
.pcard:hover .pcard__tile { transform: translateY(-4px) rotate(-3deg); }

.pcard__badges { position: absolute; top: 14px; left: 14px; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.pcard__kind, .pcard__soon { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--radius-pill); font: 600 11px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.pcard__kind { background: rgba(7, 17, 31, 0.74); color: #f8fafc; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pcard__soon { background: var(--accent-cyan); color: #04263a; }

.pcard__body { display: flex; flex: 1; flex-direction: column; padding: 22px 24px 0; }
.pcard__name { font: 700 22px/1.25 var(--font-display); letter-spacing: -0.02em; }
.pcard__name a { color: var(--text-primary); }
.pcard__name a::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pcard__name a:hover { text-decoration: none; }
.pcard__name a:focus-visible { outline: 0; }
.pcard__teaser { display: -webkit-box; margin-top: 10px; overflow: hidden; font-size: 15px; line-height: 1.6; color: var(--text-secondary); -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.pcard__meta { margin-top: 14px; font: 500 12px/1.5 var(--font-mono); letter-spacing: 0.04em; color: var(--text-muted); }

.pcard__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "price demo" "actions actions"; align-items: center; gap: 16px 12px; margin: 22px 24px 0; padding: 20px 0 24px; border-top: 1px solid var(--border); }
.pcard__price { grid-area: price; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.pcard__amount { font: 700 28px/1 var(--font-display); letter-spacing: -0.03em; }
.pcard__once { font-size: 14px; color: var(--text-muted); }
.pcard__demo { grid-area: demo; position: relative; z-index: 3; font-size: 14px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.pcard__demo::after { content: " \2197"; }
.pcard__actions { grid-area: actions; position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.pcard__actions .btn { min-height: 46px; padding: 0 18px; }
.btn--soft { background: var(--primary-soft); color: var(--primary); }
.btn--soft:hover { background: #d8e9ff; color: var(--primary-hover); }

/* Nothing left after filtering */
.shop-empty { display: grid; justify-items: center; gap: 20px; padding: 72px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius-l); text-align: center; }
.shop-empty__text { font: 700 22px/1.3 var(--font-display); }

/* The product chosen on a card is marked in the inquiry form. */
.shop-page .td-shop .td-panel.is-picked { animation: shop-pick 1600ms var(--ease); }
@keyframes shop-pick { 0%, 30% { box-shadow: 0 0 0 1px #dce3ea, 0 0 0 6px var(--primary-soft); } }

/* Filtering: View Transitions where available, otherwise a short fade-in. */
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="off"]) .pcard.is-entering { animation: pcard-in 420ms var(--ease) both; }
  ::view-transition-group(*.pcard) { animation-duration: 460ms; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  ::view-transition-new(*.pcard):only-child { animation: pcard-in 460ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  ::view-transition-old(*.pcard):only-child { animation: pcard-out 220ms ease both; }
}
@keyframes pcard-in { from { opacity: 0; scale: 0.94; } }
@keyframes pcard-out { to { opacity: 0; scale: 0.94; } }

@media (max-width: 1100px) {
  .phero--shop { padding: 24px 0 56px; }
  .phero--shop .crumbs { margin-bottom: 32px; }
  .phero--shop.phero--split .phero__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .shop-grid, .shop-cols-2 .shop-grid, .shop-cols-4 .shop-grid { --shop-cols: 2; gap: 20px; }
  .shop-bar__inner { flex-direction: column; align-items: stretch; gap: 10px; min-height: 0; padding-block: 12px; }
  .shop-tools { width: 100%; }
  .shop-search { flex: 1; }
  .shop-search input, .shop-search input:focus { width: 100%; }
}
@media (max-width: 680px) {
  .shop-bar { position: static; }
  .shop-filter { margin-inline: calc(var(--gutter-mobile) * -1); padding-inline: var(--gutter-mobile); }
  .shop-grid, .shop-cols-2 .shop-grid, .shop-cols-4 .shop-grid { --shop-cols: 1; }
  .shop-catalog__body { padding-top: 24px; }
  .shop-aside { padding: 22px; }
  /* Sorting shrinks to a round button; the native list opens on tap. */
  .shop-tools { gap: 8px; }
  .shop-sort { flex: none; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); }
  .shop-sort svg { position: static; color: var(--text-primary); }
  .shop-sort select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; opacity: 0; }
  .shop-sort:has(select:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
  .pcard__body { padding: 20px 20px 0; }
  .pcard__foot { margin: 20px 20px 0; padding-bottom: 20px; }
}

/* "Auf Anfrage" (td-licenses 1.35.0): same badge, calmer colour than "In Kürze". */
.pcard__soon--ask { background: var(--primary-soft); color: var(--primary); }

/* Licence tiers and extras on the card (Ertragsplan 16). */
.pcard__tiers { margin-top: 14px; font-size: 14px; color: var(--text-secondary); }
.pcard__tiers ul { display: grid; gap: 4px; }
.pcard__tiers li { display: flex; justify-content: space-between; gap: 12px; }
.pcard__tiers li strong { color: var(--text-primary); white-space: nowrap; }
.pcard__tiers p { margin-top: 8px; }
.pcard__tiers p span { font-weight: 600; color: var(--text-primary); }