/*
 * ArthasUp Portal — Main Stylesheet
 *
 * Architecture:
 *  1. Design tokens (CSS custom properties)
 *  2. Reset and base
 *  3. Typography
 *  4. Layout primitives (.ap-container, .ap-section)
 *  5. Buttons
 *  6. Badges and tags
 *  7. Site header
 *  8. Site footer
 *  9. Hero section
 * 10. Trust bar
 * 11. Product grid
 * 12. Product card
 * 13. Homepage featured section
 * 14. Sector browse grid
 * 15. CTA strip
 * 16. Listing page (sidebar + toolbar)
 * 17. Single product page
 * 18. Feature comparison table
 * 19. FAQ
 * 20. Changelog
 * 21. Buy box
 * 22. Tech requirements list
 * 23. Screenshots
 * 24. Fallback / index page
 * 25. Utilities
 *
 * Light mode:
 *  Override token values on [data-ap-theme="light"] or a media query when
 *  that phase arrives. No structural changes to any rule will be needed.
 *
 * Naming convention:
 *  Block:     .ap-block
 *  Element:   .ap-block__element
 *  Modifier:  .ap-block--modifier
 */

/* ─── 1. Design tokens ────────────────────────────────────────────────────── */

:root {
    /* Backgrounds */
    --ap-bg-page:      #0d1117;
    --ap-bg-surface:   #161b27;
    --ap-bg-elevated:  #1e2a3a;
    --ap-bg-input:     #0d1117;
    --ap-bg-overlay:   rgba(13, 17, 23, 0.85);

    /* Text */
    --ap-text-primary:   #f8fafc;
    --ap-text-secondary: #94a3b8;
    --ap-text-muted:     #475569;
    --ap-text-hint:      #334155;

    /* Borders */
    --ap-border:         #1e2a3a;
    --ap-border-subtle:  #0f1923;
    --ap-border-focus:   #2563eb;

    /* Accent / brand */
    --ap-accent:         #2563eb;
    --ap-accent-hover:   #1d4ed8;
    --ap-accent-subtle:  rgba(37, 99, 235, 0.12);

    /* Semantic colours */
    --ap-success:        #10b981;
    --ap-success-subtle: rgba(16, 185, 129, 0.12);
    --ap-warning:        #f59e0b;
    --ap-warning-subtle: rgba(245, 158, 11, 0.12);
    --ap-danger:         #ef4444;
    --ap-danger-subtle:  rgba(239, 68, 68, 0.10);
    --ap-purple:         #8b5cf6;
    --ap-purple-subtle:  rgba(139, 92, 246, 0.12);

    /* Pricing badge colours */
    --ap-color-free:     var(--ap-success);
    --ap-color-freemium: var(--ap-warning);
    --ap-color-premium:  #60a5fa;
    --ap-color-bundle:   #a78bfa;

    /* Typography */
    --ap-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ap-font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    --ap-text-xs:   0.6875rem;  /* 11px */
    --ap-text-sm:   0.8125rem;  /* 13px */
    --ap-text-base: 0.9375rem;  /* 15px */
    --ap-text-md:   1.0625rem;  /* 17px */
    --ap-text-lg:   1.25rem;    /* 20px */
    --ap-text-xl:   1.5rem;     /* 24px */
    --ap-text-2xl:  2rem;       /* 32px */
    --ap-text-3xl:  2.75rem;    /* 44px */

    /* Spacing (4px grid) */
    --ap-space-1:  0.25rem;
    --ap-space-2:  0.5rem;
    --ap-space-3:  0.75rem;
    --ap-space-4:  1rem;
    --ap-space-5:  1.25rem;
    --ap-space-6:  1.5rem;
    --ap-space-8:  2rem;
    --ap-space-10: 2.5rem;
    --ap-space-12: 3rem;
    --ap-space-16: 4rem;
    --ap-space-20: 5rem;

    /* Radii */
    --ap-radius-sm: 4px;
    --ap-radius-md: 8px;
    --ap-radius-lg: 12px;
    --ap-radius-xl: 16px;
    --ap-radius-pill: 100px;

    /* Transitions */
    --ap-transition: 0.14s ease;

    /* Layout */
    --ap-container-max: 1200px;
    --ap-container-pad: var(--ap-space-6);
    --ap-header-height: 60px;

    /* Z-index layers */
    --ap-z-header: 100;
    --ap-z-overlay: 200;
}

/* ─── 2. Reset and base ───────────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--ap-bg-page);
    color: var(--ap-text-primary);
    font-family: var(--ap-font-sans);
    font-size: var(--ap-text-base);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* WordPress admin bar offset */
body.admin-bar .ap-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .ap-header {
        top: 46px;
    }
}

img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--ap-accent);
    text-decoration: none;
    transition: color var(--ap-transition);
}

a:hover {
    color: var(--ap-accent-hover);
}

ul,
ol {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* ─── 3. Typography ───────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    color: var(--ap-text-primary);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 { font-size: var(--ap-text-3xl); }
h2 { font-size: var(--ap-text-2xl); }
h3 { font-size: var(--ap-text-xl); }
h4 { font-size: var(--ap-text-lg); }

p {
    color: var(--ap-text-secondary);
    line-height: 1.7;
}

code {
    font-family: var(--ap-font-mono);
    font-size: var(--ap-text-xs);
    background: var(--ap-bg-elevated);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    padding: 2px 6px;
    color: #a78bfa;
}

/* Prose content area (long product descriptions) */
.ap-prose p  { margin-bottom: var(--ap-space-4); }
.ap-prose ul,
.ap-prose ol { margin: 0 0 var(--ap-space-4) var(--ap-space-6); }
.ap-prose ul { list-style: disc; }
.ap-prose ol { list-style: decimal; }
.ap-prose li { color: var(--ap-text-secondary); margin-bottom: var(--ap-space-1); }
.ap-prose h2,
.ap-prose h3 { margin: var(--ap-space-6) 0 var(--ap-space-3); }

/* ─── 4. Layout primitives ────────────────────────────────────────────────── */

.ap-container {
    width: 100%;
    max-width: var(--ap-container-max);
    margin-inline: auto;
    padding-inline: var(--ap-container-pad);
}

.ap-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ap-main {
    flex: 1;
    padding-top: var(--ap-header-height);
}

.ap-section {
    padding-block: var(--ap-space-16);
}

.ap-section__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--ap-space-4);
    margin-bottom: var(--ap-space-8);
    flex-wrap: wrap;
}

.ap-section__title {
    font-size: var(--ap-text-xl);
    font-weight: 700;
    color: var(--ap-text-primary);
}

.ap-section__link {
    font-size: var(--ap-text-sm);
    color: var(--ap-accent);
    white-space: nowrap;
}

.ap-section__link:hover {
    color: var(--ap-accent-hover);
}

.ap-section-title {
    font-size: var(--ap-text-lg);
    font-weight: 700;
    color: var(--ap-text-primary);
    padding-bottom: var(--ap-space-3);
    border-bottom: 1px solid var(--ap-border);
    margin-bottom: var(--ap-space-6);
}

/* Screen-reader only */
.ap-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─── 5. Buttons ──────────────────────────────────────────────────────────── */

.ap-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--ap-space-2);
    border: 1px solid transparent;
    border-radius: var(--ap-radius-md);
    font-family: var(--ap-font-sans);
    font-size: var(--ap-text-sm);
    font-weight: 600;
    padding: 9px 18px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--ap-transition),
                border-color var(--ap-transition),
                color var(--ap-transition);
    cursor: pointer;
    user-select: none;
}

.ap-btn--primary {
    background-color: var(--ap-accent);
    border-color: var(--ap-accent);
    color: #ffffff;
}

.ap-btn--primary:hover {
    background-color: var(--ap-accent-hover);
    border-color: var(--ap-accent-hover);
    color: #ffffff;
}

.ap-btn--ghost {
    background-color: transparent;
    border-color: var(--ap-border);
    color: var(--ap-text-secondary);
}

.ap-btn--ghost:hover {
    border-color: var(--ap-text-muted);
    color: var(--ap-text-primary);
}

.ap-btn--sm {
    font-size: var(--ap-text-xs);
    padding: 6px 14px;
}

.ap-btn--full {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* ─── 6. Badges and tags ──────────────────────────────────────────────────── */

.ap-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--ap-radius-sm);
    border: 1px solid transparent;
    line-height: 1.4;
}

.ap-badge--free {
    background: var(--ap-success-subtle);
    color: var(--ap-success);
    border-color: rgba(16, 185, 129, 0.22);
}

.ap-badge--freemium {
    background: var(--ap-warning-subtle);
    color: var(--ap-warning);
    border-color: rgba(245, 158, 11, 0.22);
}

.ap-badge--premium {
    background: var(--ap-accent-subtle);
    color: var(--ap-color-premium);
    border-color: rgba(37, 99, 235, 0.22);
}

.ap-badge--bundle {
    background: var(--ap-purple-subtle);
    color: var(--ap-color-bundle);
    border-color: rgba(139, 92, 246, 0.22);
}

.ap-badge--highlight {
    background: var(--ap-danger-subtle);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.22);
}

.ap-badge--type {
    background: var(--ap-bg-elevated);
    color: var(--ap-text-muted);
    border-color: var(--ap-border);
}

.ap-badge--current {
    background: var(--ap-success-subtle);
    color: var(--ap-success);
    border-color: rgba(16, 185, 129, 0.22);
}

.ap-tag {
    display: inline-block;
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    background: var(--ap-bg-elevated);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    padding: 2px 8px;
    text-decoration: none;
    transition: border-color var(--ap-transition), color var(--ap-transition);
}

.ap-tag:hover {
    border-color: var(--ap-text-muted);
    color: var(--ap-text-secondary);
}

.ap-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ap-space-2);
}

/* ─── 7. Site header ──────────────────────────────────────────────────────── */

.ap-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--ap-z-header);
    height: var(--ap-header-height);
    background: var(--ap-bg-page);
    border-bottom: 1px solid var(--ap-border);
}

.ap-header__inner {
    display: flex;
    align-items: center;
    height: var(--ap-header-height);
    gap: var(--ap-space-6);
}

.ap-header__brand {
    flex-shrink: 0;
}

.ap-header__logo-link {
    text-decoration: none;
}

.ap-header__logo-text {
    font-size: var(--ap-text-md);
    font-weight: 800;
    color: var(--ap-text-primary);
    letter-spacing: -0.03em;
}

.ap-header__nav {
    flex: 1;
}

.ap-nav-menu {
    display: flex;
    gap: var(--ap-space-1);
    align-items: center;
}

.ap-nav-menu li a {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    padding: var(--ap-space-2) var(--ap-space-3);
    border-radius: var(--ap-radius-sm);
    transition: color var(--ap-transition), background-color var(--ap-transition);
}

.ap-nav-menu li a:hover,
.ap-nav-menu li.current-menu-item > a,
.ap-nav-menu li.current-page-ancestor > a {
    color: var(--ap-text-primary);
    background: var(--ap-bg-elevated);
}

.ap-header__actions {
    display: flex;
    align-items: center;
    gap: var(--ap-space-3);
    flex-shrink: 0;
}

.ap-header__menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    padding: var(--ap-space-2);
    cursor: pointer;
}

.ap-header__menu-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ap-text-secondary);
    border-radius: 1px;
    transition: transform var(--ap-transition), opacity var(--ap-transition);
}

@media (max-width: 768px) {
    .ap-header__nav {
        display: none;
        position: absolute;
        top: var(--ap-header-height);
        left: 0;
        right: 0;
        background: var(--ap-bg-surface);
        border-bottom: 1px solid var(--ap-border);
        padding: var(--ap-space-4);
    }

    .ap-header__nav.is-open {
        display: block;
    }

    .ap-nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--ap-space-1);
    }

    .ap-nav-menu li {
        width: 100%;
    }

    .ap-nav-menu li a {
        display: block;
        width: 100%;
    }

    .ap-header__menu-toggle {
        display: flex;
    }

    .ap-header__actions .ap-btn:not(.ap-btn--primary) {
        display: none;
    }
}

/* ─── 8. Site footer ──────────────────────────────────────────────────────── */

.ap-footer {
    background: var(--ap-bg-surface);
    border-top: 1px solid var(--ap-border);
    padding-block: var(--ap-space-12) var(--ap-space-8);
    margin-top: var(--ap-space-16);
}

.ap-footer__grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--ap-space-8);
    margin-bottom: var(--ap-space-8);
}

.ap-footer__logo-link {
    text-decoration: none;
    display: inline-block;
    margin-bottom: var(--ap-space-3);
}

.ap-footer__logo-text {
    font-size: var(--ap-text-md);
    font-weight: 800;
    color: var(--ap-text-primary);
    letter-spacing: -0.03em;
}

.ap-footer__tagline {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-muted);
    line-height: 1.6;
}

.ap-footer__nav-heading {
    font-size: var(--ap-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ap-text-muted);
    margin-bottom: var(--ap-space-4);
}

.ap-footer__nav-list {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-3);
}

.ap-footer__nav-list li a,
.ap-footer__nav-list a {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    text-decoration: none;
    transition: color var(--ap-transition);
}

.ap-footer__nav-list li a:hover,
.ap-footer__nav-list a:hover {
    color: var(--ap-text-primary);
}

.ap-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--ap-space-6);
    border-top: 1px solid var(--ap-border);
    flex-wrap: wrap;
    gap: var(--ap-space-4);
}

.ap-footer__copyright,
.ap-footer__legal {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    margin: 0;
}

.ap-footer__legal a {
    color: var(--ap-text-muted);
    text-decoration: none;
}

.ap-footer__legal a:hover {
    color: var(--ap-text-secondary);
}

@media (max-width: 900px) {
    .ap-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .ap-footer__grid {
        grid-template-columns: 1fr;
    }
}

/* ─── 9. Hero section ─────────────────────────────────────────────────────── */

.ap-hero {
    padding-block: var(--ap-space-20) var(--ap-space-16);
    border-bottom: 1px solid var(--ap-border);
    background: radial-gradient(
        ellipse 80% 60% at 50% 0%,
        rgba(37, 99, 235, 0.08) 0%,
        transparent 70%
    );
}

.ap-hero__inner {
    max-width: 680px;
    margin-inline: auto;
    text-align: center;
}

.ap-hero__eyebrow {
    display: inline-block;
    font-size: var(--ap-text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ap-accent);
    background: var(--ap-accent-subtle);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: var(--ap-radius-pill);
    padding: 4px 14px;
    margin-bottom: var(--ap-space-5);
}

.ap-hero__heading {
    font-size: clamp(var(--ap-text-2xl), 5vw, var(--ap-text-3xl));
    font-weight: 800;
    color: var(--ap-text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: var(--ap-space-5);
}

.ap-hero__subheading {
    font-size: var(--ap-text-md);
    color: var(--ap-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--ap-space-8);
    max-width: 520px;
    margin-inline: auto;
}

.ap-hero__actions {
    display: flex;
    gap: var(--ap-space-3);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--ap-space-10);
}

.ap-hero__stats {
    display: flex;
    gap: var(--ap-space-8);
    justify-content: center;
    flex-wrap: wrap;
    padding-top: var(--ap-space-8);
    border-top: 1px solid var(--ap-border);
}

.ap-stat {
    text-align: center;
}

.ap-stat__number {
    display: block;
    font-size: var(--ap-text-2xl);
    font-weight: 800;
    color: var(--ap-text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: var(--ap-space-1);
}

.ap-stat__label {
    font-size: var(--ap-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ap-text-muted);
}

/* ─── 10. Trust bar ───────────────────────────────────────────────────────── */

.ap-trust-bar {
    background: var(--ap-bg-surface);
    border-bottom: 1px solid var(--ap-border);
    padding-block: var(--ap-space-4);
}

.ap-trust-bar__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ap-space-6);
    align-items: center;
    justify-content: center;
}

.ap-trust-bar__item {
    display: flex;
    align-items: center;
    gap: var(--ap-space-2);
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    white-space: nowrap;
}

.ap-trust-bar__check {
    color: var(--ap-success);
    font-size: var(--ap-text-sm);
    flex-shrink: 0;
}

/* ─── 11. Product grid ────────────────────────────────────────────────────── */

.ap-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ap-space-5);
}

.ap-product-grid--featured {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
    .ap-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .ap-product-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── 12. Product card ────────────────────────────────────────────────────── */

.ap-product-card {
    background: var(--ap-bg-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    padding: var(--ap-space-5);
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-3);
    transition: border-color var(--ap-transition), transform 0.15s ease;
    text-decoration: none;
    height: 100%;
}

.ap-product-card:hover {
    border-color: rgba(37, 99, 235, 0.45);
    transform: translateY(-2px);
}

.ap-product-card__badges {
    display: flex;
    gap: var(--ap-space-2);
    flex-wrap: wrap;
}

.ap-product-card__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--ap-radius-md);
    overflow: hidden;
    background: var(--ap-bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ap-product-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-product-card__icon-placeholder {
    display: block;
    width: 24px;
    height: 24px;
    background: var(--ap-border);
    border-radius: var(--ap-radius-sm);
}

.ap-product-card__title {
    font-size: var(--ap-text-base);
    font-weight: 700;
    color: var(--ap-text-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.ap-product-card__title a {
    color: inherit;
    text-decoration: none;
}

.ap-product-card__title a:hover {
    color: var(--ap-accent);
}

.ap-product-card__description {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    line-height: 1.6;
    flex: 1;
    /* Clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ap-product-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ap-space-1);
}

.ap-product-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ap-space-3);
    align-items: center;
}

.ap-product-card__version {
    font-size: var(--ap-text-xs);
    font-family: var(--ap-font-mono);
    color: var(--ap-text-muted);
}

.ap-product-card__release-date {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
}

.ap-product-card__price {
    margin-top: auto;
}

.ap-price {
    font-size: var(--ap-text-base);
    font-weight: 700;
    color: var(--ap-text-primary);
}

.ap-price--free {
    color: var(--ap-success);
}

.ap-product-card__actions {
    display: flex;
    gap: var(--ap-space-2);
    margin-top: var(--ap-space-1);
}

.ap-product-card__actions .ap-btn {
    flex: 1;
    justify-content: center;
}

/* ─── 13. Homepage featured section ──────────────────────────────────────── */

.ap-section--featured {
    padding-top: var(--ap-space-16);
    padding-bottom: var(--ap-space-12);
}

/* ─── 14. Sector browse grid ──────────────────────────────────────────────── */

.ap-section--sectors {
    background: var(--ap-bg-surface);
    border-top: 1px solid var(--ap-border);
    border-bottom: 1px solid var(--ap-border);
}

.ap-sector-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--ap-space-3);
}

@media (max-width: 900px) {
    .ap-sector-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 560px) {
    .ap-sector-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ap-sector-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ap-space-2);
    padding: var(--ap-space-5) var(--ap-space-4);
    background: var(--ap-bg-elevated);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    text-decoration: none;
    text-align: center;
    transition: border-color var(--ap-transition), background-color var(--ap-transition);
}

.ap-sector-card:hover {
    border-color: var(--ap-accent);
    background: var(--ap-accent-subtle);
}

.ap-sector-card__name {
    font-size: var(--ap-text-sm);
    font-weight: 600;
    color: var(--ap-text-primary);
}

.ap-sector-card__count {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
}

/* ─── 15. CTA strip ───────────────────────────────────────────────────────── */

.ap-cta-strip {
    background: var(--ap-bg-surface);
    border-top: 1px solid var(--ap-border);
    padding-block: var(--ap-space-10);
}

.ap-cta-strip__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ap-space-6);
    flex-wrap: wrap;
}

.ap-cta-strip__heading {
    font-size: var(--ap-text-xl);
    font-weight: 700;
    margin-bottom: var(--ap-space-2);
}

.ap-cta-strip__subheading {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-muted);
    margin: 0;
}

/* ─── 16. Listing page ────────────────────────────────────────────────────── */

.ap-main--listing {
    padding-top: calc(var(--ap-header-height) + var(--ap-space-8));
}

.ap-listing-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--ap-space-8);
    align-items: start;
    padding-bottom: var(--ap-space-16);
}

@media (max-width: 900px) {
    .ap-listing-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.ap-listing-sidebar {
    position: sticky;
    top: calc(var(--ap-header-height) + var(--ap-space-6));
}

.ap-filter-group {
    border: none;
    padding: 0;
    margin-bottom: var(--ap-space-6);
}

.ap-filter-group__label {
    display: block;
    font-size: var(--ap-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ap-text-muted);
    margin-bottom: var(--ap-space-3);
}

.ap-filter-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ap-filter-option {
    display: block;
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    padding: var(--ap-space-2) var(--ap-space-3);
    border-radius: var(--ap-radius-sm);
    text-decoration: none;
    transition: background-color var(--ap-transition), color var(--ap-transition);
}

.ap-filter-option:hover {
    background: var(--ap-bg-elevated);
    color: var(--ap-text-primary);
}

.ap-filter-option.is-active {
    background: var(--ap-accent-subtle);
    color: var(--ap-color-premium);
    font-weight: 600;
}

/* Toolbar */
.ap-listing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--ap-space-5);
    gap: var(--ap-space-4);
    flex-wrap: wrap;
}

.ap-listing-count {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-muted);
    margin: 0;
}

.ap-sort-select {
    background: var(--ap-bg-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-md);
    color: var(--ap-text-secondary);
    font-family: var(--ap-font-sans);
    font-size: var(--ap-text-sm);
    padding: var(--ap-space-2) var(--ap-space-8) var(--ap-space-2) var(--ap-space-3);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.ap-sort-select:focus {
    border-color: var(--ap-accent);
    outline: none;
}

/* Empty state */
.ap-listing-empty {
    text-align: center;
    padding: var(--ap-space-16) 0;
}

.ap-listing-empty p {
    color: var(--ap-text-muted);
    margin-bottom: var(--ap-space-5);
}

/* ─── 17. Single product page ─────────────────────────────────────────────── */

.ap-main--single-product {
    padding-top: calc(var(--ap-header-height) + var(--ap-space-8));
    padding-bottom: var(--ap-space-20);
}

.ap-product-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--ap-space-10);
    align-items: start;
}

@media (max-width: 1024px) {
    .ap-product-layout {
        grid-template-columns: 1fr;
    }
}

.ap-product-body {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-10);
}

/* Hero */
.ap-product-hero {
    padding-bottom: var(--ap-space-8);
    border-bottom: 1px solid var(--ap-border);
}

.ap-product-hero__header {
    display: flex;
    gap: var(--ap-space-5);
    align-items: flex-start;
    margin-bottom: var(--ap-space-6);
}

.ap-product-hero__icon {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--ap-radius-lg);
    overflow: hidden;
    background: var(--ap-bg-elevated);
}

.ap-product-hero__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-product-hero__badges {
    display: flex;
    gap: var(--ap-space-2);
    flex-wrap: wrap;
    margin-bottom: var(--ap-space-3);
}

.ap-product-hero__title {
    font-size: clamp(var(--ap-text-xl), 4vw, var(--ap-text-2xl));
    font-weight: 800;
    color: var(--ap-text-primary);
    letter-spacing: -0.03em;
    margin-bottom: var(--ap-space-3);
}

.ap-product-hero__short-desc {
    font-size: var(--ap-text-base);
    color: var(--ap-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--ap-space-4);
    margin: 0;
}

.ap-product-hero__info-strip {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ap-space-3);
    align-items: center;
    margin-top: var(--ap-space-4);
}

.ap-product-hero__version,
.ap-product-hero__updated {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
}

.ap-product-hero__compat-tag {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    background: var(--ap-bg-elevated);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-pill);
    padding: 2px 10px;
}

.ap-product-hero__actions {
    display: flex;
    gap: var(--ap-space-3);
    flex-wrap: wrap;
}

/* ─── 18. Feature comparison table ───────────────────────────────────────── */

.ap-comparison-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
}

.ap-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--ap-text-sm);
}

.ap-comparison-table thead tr {
    background: var(--ap-bg-elevated);
}

.ap-comparison-table th {
    padding: var(--ap-space-4) var(--ap-space-5);
    text-align: left;
    font-size: var(--ap-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ap-text-muted);
    border-bottom: 1px solid var(--ap-border);
}

.ap-comparison-table__tier-col {
    text-align: center;
    width: 100px;
}

.ap-comparison-table__tier-col--pro {
    color: var(--ap-color-premium) !important;
}

.ap-comparison-table td {
    padding: var(--ap-space-4) var(--ap-space-5);
    border-bottom: 1px solid var(--ap-border-subtle);
    vertical-align: top;
}

.ap-comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.ap-comparison-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.ap-comparison-table__feature-title {
    display: block;
    font-weight: 600;
    color: var(--ap-text-primary);
    margin-bottom: 2px;
}

.ap-comparison-table__feature-desc {
    display: block;
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    line-height: 1.5;
}

.ap-comparison-table__check {
    text-align: center;
}

.ap-check--yes {
    color: var(--ap-success);
    font-size: var(--ap-text-md);
    font-weight: 700;
}

.ap-check--no {
    color: var(--ap-text-hint);
    font-size: var(--ap-text-md);
}

/* Feature list (single tier) */
.ap-feature-list {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-4);
}

.ap-feature-list__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: var(--ap-space-5);
    position: relative;
}

.ap-feature-list__item::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--ap-success);
    font-weight: 700;
}

.ap-feature-list__item--pro::before {
    color: var(--ap-color-premium);
}

.ap-feature-list__title {
    font-size: var(--ap-text-sm);
    font-weight: 600;
    color: var(--ap-text-primary);
}

.ap-feature-list__desc {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    line-height: 1.5;
}

/* ─── 19. FAQ ─────────────────────────────────────────────────────────────── */

.ap-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ap-faq-list__item {
    border-bottom: 1px solid var(--ap-border);
    padding-block: var(--ap-space-5);
}

.ap-faq-list__item:first-child {
    border-top: 1px solid var(--ap-border);
}

.ap-faq-list__question {
    font-size: var(--ap-text-base);
    font-weight: 600;
    color: var(--ap-text-primary);
    line-height: 1.4;
    margin-bottom: var(--ap-space-3);
    cursor: default;
}

.ap-faq-list__answer {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    line-height: 1.7;
}

/* ─── 20. Changelog ───────────────────────────────────────────────────────── */

.ap-changelog-list {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-5);
}

.ap-changelog-list__item {
    background: var(--ap-bg-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-5);
}

.ap-changelog-list__item--current {
    border-color: rgba(37, 99, 235, 0.3);
    background: rgba(37, 99, 235, 0.04);
}

.ap-changelog-list__header {
    display: flex;
    align-items: center;
    gap: var(--ap-space-3);
    flex-wrap: wrap;
    margin-bottom: var(--ap-space-3);
}

.ap-changelog-list__version {
    font-size: var(--ap-text-sm);
    font-weight: 700;
}

.ap-changelog-list__date {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
}

.ap-changelog-list__notes {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    line-height: 1.7;
}

/* ─── 21. Buy box ─────────────────────────────────────────────────────────── */

.ap-product-sidebar {
    position: sticky;
    top: calc(var(--ap-header-height) + var(--ap-space-6));
}

.ap-buy-box {
    background: var(--ap-bg-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    padding: var(--ap-space-5);
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-4);
}

.ap-buy-box__choose-label {
    font-size: var(--ap-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ap-text-muted);
}

.ap-buy-box__tiers {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-2);
}

.ap-buy-box__tier {
    display: flex;
    align-items: center;
    gap: var(--ap-space-3);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-3) var(--ap-space-4);
    cursor: pointer;
    transition: border-color var(--ap-transition), background-color var(--ap-transition);
}

.ap-buy-box__tier:hover,
.ap-buy-box__tier.is-selected {
    border-color: var(--ap-accent);
    background: var(--ap-accent-subtle);
}

.ap-buy-box__tier-radio {
    width: 15px;
    height: 15px;
    accent-color: var(--ap-accent);
    flex-shrink: 0;
    cursor: pointer;
}

.ap-buy-box__tier-label {
    font-size: var(--ap-text-sm);
    font-weight: 600;
    color: var(--ap-text-primary);
    flex: 1;
}

.ap-buy-box__tier-price {
    font-size: var(--ap-text-sm);
    font-weight: 700;
    color: var(--ap-text-primary);
    white-space: nowrap;
}

.ap-buy-box__trust {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-2);
    padding-top: var(--ap-space-3);
    border-top: 1px solid var(--ap-border);
}

.ap-buy-box__trust li {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    padding-left: var(--ap-space-5);
    position: relative;
}

.ap-buy-box__trust li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--ap-success);
    font-weight: 700;
}

.ap-buy-box__links {
    display: flex;
    gap: var(--ap-space-4);
    flex-wrap: wrap;
}

.ap-buy-box__link {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    text-decoration: none;
    transition: color var(--ap-transition);
}

.ap-buy-box__link:hover {
    color: var(--ap-text-secondary);
}

.ap-buy-box__free-label {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    margin: 0 0 var(--ap-space-3);
}

/* ─── 22. Technical requirements ──────────────────────────────────────────── */

.ap-tech-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ap-space-3);
}

@media (max-width: 600px) {
    .ap-tech-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ap-tech-list__row {
    background: var(--ap-bg-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-4);
}

.ap-tech-list__label {
    font-size: var(--ap-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ap-text-muted);
    margin-bottom: var(--ap-space-2);
    display: block;
}

.ap-tech-list__value {
    display: block;
}

/* ─── 23. Screenshots ─────────────────────────────────────────────────────── */

.ap-screenshots-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--ap-space-3);
}

.ap-screenshots-gallery .ap-screenshot:first-child {
    grid-column: 1 / -1;
}

.ap-screenshot {
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-md);
    overflow: hidden;
    background: var(--ap-bg-elevated);
}

.ap-screenshot a {
    display: block;
}

.ap-screenshot img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity var(--ap-transition);
}

.ap-screenshot:hover img {
    opacity: 0.88;
}

.ap-screenshot__caption {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    padding: var(--ap-space-2) var(--ap-space-3);
    background: var(--ap-bg-surface);
    border-top: 1px solid var(--ap-border);
}

/* ─── 24. Fallback / index page ───────────────────────────────────────────── */

.ap-main--fallback {
    padding-top: calc(var(--ap-header-height) + var(--ap-space-10));
    padding-bottom: var(--ap-space-16);
}

.ap-archive-header {
    margin-bottom: var(--ap-space-8);
    padding-bottom: var(--ap-space-6);
    border-bottom: 1px solid var(--ap-border);
}

.ap-archive-header__title {
    font-size: var(--ap-text-2xl);
    font-weight: 800;
}

.ap-post-list {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-6);
}

.ap-post-list__item {
    padding-bottom: var(--ap-space-6);
    border-bottom: 1px solid var(--ap-border);
}

.ap-post-list__title {
    font-size: var(--ap-text-xl);
    font-weight: 700;
    margin-bottom: var(--ap-space-3);
}

.ap-post-list__title a {
    color: var(--ap-text-primary);
    text-decoration: none;
}

.ap-post-list__title a:hover {
    color: var(--ap-accent);
}

.ap-post-list__meta {
    margin-bottom: var(--ap-space-4);
}

.ap-post-list__date {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
}

.ap-post-list__content {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    line-height: 1.7;
}

.ap-not-found {
    text-align: center;
    padding: var(--ap-space-20) 0;
}

.ap-not-found__title {
    font-size: var(--ap-text-2xl);
    margin-bottom: var(--ap-space-4);
}

.ap-not-found__message {
    color: var(--ap-text-muted);
    margin-bottom: var(--ap-space-6);
}

/* Pagination */
.ap-pagination {
    margin-top: var(--ap-space-10);
    display: flex;
    justify-content: center;
}

.ap-pagination .nav-links {
    display: flex;
    gap: var(--ap-space-2);
    align-items: center;
}

.ap-pagination a,
.ap-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-md);
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    text-decoration: none;
    transition: border-color var(--ap-transition), color var(--ap-transition);
}

.ap-pagination a:hover {
    border-color: var(--ap-accent);
    color: var(--ap-accent);
}

.ap-pagination .current {
    background: var(--ap-accent);
    border-color: var(--ap-accent);
    color: #fff;
}

/* ─── 25. Utilities ───────────────────────────────────────────────────────── */

.ap-product-taxonomy {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-4);
}

.ap-product-taxonomy__group {
    display: flex;
    align-items: center;
    gap: var(--ap-space-3);
    flex-wrap: wrap;
}

.ap-product-taxonomy__label {
    font-size: var(--ap-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ap-text-muted);
    flex-shrink: 0;
}

.ap-header.is-scrolled {
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.4);
}
/* ─── Buy box refinements ─────────────────────────────────────────────────── */

.ap-buy-box {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-4);
}

.ap-buy-box__choose-label {
    font-size: var(--ap-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ap-text-muted);
    margin: 0;
}

/* Tier items */
.ap-buy-box__tier {
    display: flex;
    align-items: center;
    gap: var(--ap-space-3);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-4);
    cursor: pointer;
    transition: border-color var(--ap-transition),
                background-color var(--ap-transition);
    position: relative;
}

.ap-buy-box__tier:hover {
    border-color: rgba(37, 99, 235, 0.4);
    background: rgba(37, 99, 235, 0.04);
}

.ap-buy-box__tier.is-selected {
    border-color: var(--ap-accent);
    background: rgba(37, 99, 235, 0.07);
}

/* Selected indicator dot in top-right corner */
.ap-buy-box__tier.is-selected::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ap-accent);
}

.ap-buy-box__tier-radio {
    width: 16px;
    height: 16px;
    accent-color: var(--ap-accent);
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
}

.ap-buy-box__tier-label {
    flex: 1;
    font-size: var(--ap-text-sm);
    font-weight: 600;
    color: var(--ap-text-primary);
    line-height: 1.3;
}

/* Sublabel line inside tier */
.ap-buy-box__tier-sublabel {
    display: block;
    font-size: var(--ap-text-xs);
    font-weight: 400;
    color: var(--ap-text-muted);
    margin-top: 2px;
}

.ap-buy-box__tier-price {
    font-size: var(--ap-text-base);
    font-weight: 700;
    color: var(--ap-text-primary);
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.ap-buy-box__tier.is-selected .ap-buy-box__tier-price {
    color: var(--ap-accent);
}

/* CTA button area */
.ap-buy-box__cta-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-2);
}

.ap-buy-box__cta {
    font-size: var(--ap-text-base);
    font-weight: 700;
    padding: 13px 20px;
    border-radius: var(--ap-radius-md);
    letter-spacing: 0.01em;
    justify-content: center;
}

.ap-buy-box__cta--unavailable {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* Trust list */
.ap-buy-box__trust {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-2);
    padding: var(--ap-space-4);
    background: rgba(16, 185, 129, 0.04);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: var(--ap-radius-md);
}

.ap-buy-box__trust li {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-secondary);
    padding-left: var(--ap-space-5);
    position: relative;
    line-height: 1.5;
}

.ap-buy-box__trust li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--ap-success);
    font-weight: 700;
    font-size: 11px;
}

/* Guarantee badge strip */
.ap-buy-box__guarantee {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    text-align: center;
    padding-top: var(--ap-space-1);
}

/* Links */
.ap-buy-box__links {
    display: flex;
    gap: var(--ap-space-4);
    justify-content: center;
    padding-top: var(--ap-space-2);
    border-top: 1px solid var(--ap-border);
}

.ap-buy-box__link {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    text-decoration: none;
    transition: color var(--ap-transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ap-buy-box__link:hover {
    color: var(--ap-text-secondary);
}

/* Free download state */
.ap-buy-box__free {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-3);
}

.ap-buy-box__free-label {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    margin: 0;
    text-align: center;
}

/* No mapping fallback */
.ap-buy-box__no-mapping {
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-3);
    align-items: center;
    padding: var(--ap-space-4);
    text-align: center;
}

.ap-buy-box__no-mapping-text {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-muted);
    margin: 0;
}

/* ─── Product card refinements ────────────────────────────────────────────── */

.ap-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--ap-space-3);
    background: var(--ap-bg-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-lg);
    padding: var(--ap-space-5);
    transition: border-color 0.18s ease,
                transform 0.15s ease,
                background-color 0.18s ease;
    cursor: pointer;
    height: 100%;
    text-decoration: none;
}

.ap-product-card:hover {
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(37, 99, 235, 0.025);
    transform: translateY(-3px);
}

/* Top badges row */
.ap-product-card__badges {
    display: flex;
    gap: var(--ap-space-2);
    flex-wrap: wrap;
    min-height: 20px;
}

/* Icon */
.ap-product-card__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--ap-radius-md);
    overflow: hidden;
    background: var(--ap-bg-elevated);
    border: 1px solid var(--ap-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-product-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Title */
.ap-product-card__title {
    font-size: var(--ap-text-base);
    font-weight: 700;
    color: var(--ap-text-primary);
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0;
}

.ap-product-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--ap-transition);
}

.ap-product-card:hover .ap-product-card__title a {
    color: var(--ap-accent);
}

/* Description */
.ap-product-card__description {
    font-size: var(--ap-text-sm);
    color: var(--ap-text-secondary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* Tags */
.ap-product-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ap-space-1);
    margin: 0;
}

/* Meta row (version + date) */
.ap-product-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ap-space-3);
    align-items: center;
    padding-top: var(--ap-space-3);
    border-top: 1px solid var(--ap-border-subtle);
}

.ap-product-card__version,
.ap-product-card__release-date {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
}

/* Price + actions row */
.ap-product-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ap-space-3);
    margin-top: auto;
}

.ap-product-card__price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ap-price {
    font-size: var(--ap-text-base);
    font-weight: 700;
    color: var(--ap-text-primary);
    line-height: 1;
}

.ap-price--free {
    color: var(--ap-success);
}

.ap-price--period {
    font-size: var(--ap-text-xs);
    color: var(--ap-text-muted);
    font-weight: 400;
}

/* CTA buttons inside card */
.ap-product-card__actions {
    display: flex;
    gap: var(--ap-space-2);
    flex-shrink: 0;
}

.ap-product-card__actions .ap-btn {
    padding: 7px 14px;
    font-size: var(--ap-text-xs);
}

/* Badge size refinements */
.ap-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--ap-radius-sm);
    border: 1px solid transparent;
    line-height: 1.4;
    white-space: nowrap;
}

/* Active filter chip (listing page) */
.ap-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ap-space-2);
    margin-bottom: var(--ap-space-4);
}

.ap-active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--ap-accent-subtle);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--ap-color-premium);
    font-size: var(--ap-text-xs);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--ap-radius-pill);
    text-decoration: none;
    transition: background-color var(--ap-transition), color var(--ap-transition);
}

.ap-active-filter-chip:hover {
    background: rgba(37, 99, 235, 0.18);
    color: #fff;
}

.ap-active-filter-chip--clear {
    background: var(--ap-bg-elevated);
    border-color: var(--ap-border);
    color: var(--ap-text-muted);
}

.ap-active-filter-chip--clear:hover {
    color: var(--ap-text-primary);
}

/* ─── Listing page toolbar refinements ───────────────────────────────────── */

.ap-listing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ap-space-4);
    margin-bottom: var(--ap-space-5);
    padding-bottom: var(--ap-space-4);
    border-bottom: 1px solid var(--ap-border);
    flex-wrap: wrap;
}
/* ─── Buy now pulse animation (fires on tier change) ─────────────────────── */

@keyframes ap-pulse {
    0%   { opacity: 1; transform: scale( 1 ); }
    40%  { opacity: 0.82; transform: scale( 0.97 ); }
    100% { opacity: 1; transform: scale( 1 ); }
}

@media ( prefers-reduced-motion: no-preference ) {
    .ap-cta-pulse {
        animation: ap-pulse 0.28s ease-out;
    }
}
