/* PanelUI-inspired public web adapter. Loaded after page styles; no framework dependency. */
body.fb-public-controls {
    --control-accent: #e19173;
    --control-accent-hover: #eda588;
    --control-accent-pressed: #d58265;
    --control-on-accent: #241a16;
    --control-surface: #242526;
    --control-hover: #303132;
    --control-pressed: #1c1d1e;
    --control-border: #454647;
    --control-text: #f2f0ec;
    --control-muted: #c2c0bb;
    --control-focus: #f6baa1;
    --control-radius: 8px;
    --control-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* A common button primitive, keeping links and native controls intact. */
body.fb-public-controls :where(
    :where(.product-card) .product-link, :where(.product-card) .product-btn, .btn-buy, .btn-primary,
    .promo-copy-btn, .wb-article-copy, .catalog-reset, .catalog-search-clear,
    .catalog-category-chip, .fb-primary > a, .fb-menu > summary,
    .fb-category-grid a, .fb-mobile-links a, .fb-footer-nav a,
    .lightbox-close, .lightbox-nav, .blog-inline-btn-catalog,
    .blog-inline-btn-wb, .blog-cta-btn, .pump-jump-links a, .back
) {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    height: auto;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
    background: var(--control-surface);
    color: var(--control-text);
    font-family: var(--control-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    text-decoration: none;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body.fb-public-controls :where(
    :where(.product-card) .product-link, :where(.product-card) .product-btn, .btn-buy, .btn-primary,
    .promo-copy-btn, .wb-article-copy, .catalog-reset, .catalog-search-clear,
    .catalog-category-chip, .fb-primary > a, .fb-menu > summary,
    .fb-category-grid a, .fb-mobile-links a, .fb-footer-nav a,
    .lightbox-close, .lightbox-nav, .blog-inline-btn-catalog,
    .blog-inline-btn-wb, .blog-cta-btn, .pump-jump-links a, .back
):hover {
    border-color: #656667;
    background: var(--control-hover);
    color: var(--control-text);
    box-shadow: none;
    transform: none;
}
body.fb-public-controls :where(
    :where(.product-card) .product-link, :where(.product-card) .product-btn, .btn-buy, .btn-primary,
    .promo-copy-btn, .wb-article-copy, .catalog-reset, .catalog-search-clear,
    .catalog-category-chip, .fb-primary > a, .fb-menu > summary,
    .fb-category-grid a, .fb-mobile-links a, .fb-footer-nav a,
    .lightbox-close, .lightbox-nav, .blog-inline-btn-catalog,
    .blog-inline-btn-wb, .blog-cta-btn, .pump-jump-links a, .back
):active { background: var(--control-pressed); border-color: var(--control-accent); }

body.fb-public-controls .product-card :is(.product-link, .product-btn) {
    height: auto; min-height: 44px; border-color: var(--control-border);
    border-radius: var(--control-radius); font-family: var(--control-font);
    font-weight: 600; line-height: 1.4; letter-spacing: 0; box-shadow: none; transform: none;
}

/* Primary: purchase/marketplace links and the main catalogue action. */
body.fb-public-controls :is(.product-card .product-btn, .btn-buy, .btn-primary, .blog-inline-btn-wb, .blog-cta-btn) {
    background: var(--control-accent);
    border-color: var(--control-accent);
    color: var(--control-on-accent);
    box-shadow: inset 0 1px 0 #ffffff1a;
}
body.fb-public-controls :is(.product-card .product-btn, .btn-buy, .btn-primary, .blog-inline-btn-wb, .blog-cta-btn):hover {
    background: var(--control-accent-hover);
    border-color: var(--control-accent-hover);
    color: var(--control-on-accent);
}
body.fb-public-controls :is(.product-card .product-btn, .btn-buy, .btn-primary, .blog-inline-btn-wb, .blog-cta-btn):active {
    background: var(--control-accent-pressed);
    border-color: var(--control-accent-pressed);
}
body.fb-public-controls :is(.product-btn, .btn-primary)::before { display: none; animation: none; }
body.fb-public-controls :is(.btn-buy, .btn-primary) { min-height: 48px; font-size: 15px; padding: 12px 20px; }
body.fb-public-controls .btn-buy { width: 100%; }
body.fb-public-controls :is(.btn-buy, .btn-primary, .product-btn) svg { width: 18px; height: 18px; flex-shrink: 0; transform: none; }

/* Outline: the product's detail link sits beside its primary action. */
body.fb-public-controls .product-card .product-link { background: transparent; }
body.fb-public-controls .product-card .product-link:hover { background: var(--control-surface); border-color: #656667; }
body.fb-public-controls .product-card .product-link:active { background: var(--control-pressed); border-color: var(--control-accent); }
body.fb-public-controls .product-card .product-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    gap: 8px;
    align-items: stretch;
}
body.fb-public-controls .product-card :is(.product-link, .product-btn) { width: 100%; padding: 10px 8px; font-size: 13px; }

/* Navigation and bars use the quiet ghost variant. */
body.fb-public-controls :is(.fb-primary > a, .fb-menu > summary, .fb-category-grid a, .fb-mobile-links a, .fb-footer-nav a, .catalog-search-clear) {
    border-color: transparent;
    background: transparent;
    color: var(--control-muted);
    font-size: 13px;
    font-weight: 500;
    padding: 9px 12px;
}
body.fb-public-controls :is(.fb-primary > a, .fb-menu > summary, .fb-category-grid a, .fb-mobile-links a, .fb-footer-nav a, .catalog-search-clear):hover {
    border-color: transparent;
    background: var(--control-surface);
    color: var(--control-text);
}
body.fb-public-controls :is(.fb-primary > a, .fb-menu > summary, .fb-category-grid a, .fb-mobile-links a, .fb-footer-nav a, .catalog-search-clear):active {
    background: var(--control-pressed);
    border-color: transparent;
}
body.fb-public-controls .fb-header a[aria-current]:not(.fb-wordmark),
body.fb-public-controls .fb-menu[open] > summary {
    background: #342820;
    border-color: #735343;
    color: #f2b79d;
    text-decoration: none;
}
body.fb-public-controls .fb-primary { gap: 8px; }
body.fb-public-controls :is(.fb-category-grid a, .fb-mobile-links a) { justify-content: flex-start; text-align: left; }
body.fb-public-controls .fb-panel { background: #1d1e20; border-color: #414244; border-radius: 0 0 10px 10px; }
body.fb-public-controls .fb-panel .fb-all { margin-top: 12px; border: 1px solid #414244; background: #242526; border-radius: 8px; padding: 10px 12px; }
body.fb-public-controls .fb-footer-nav { gap: 4px 8px; }
body.fb-public-controls .catalog-category-chip { min-height: 44px; padding: 9px 12px; flex-shrink: 0; }
body.fb-public-controls .catalog-category-chip span { font-size: 13px; color: inherit; }
body.fb-public-controls .catalog-category-chip .catalog-chip-count { color: #afada8; font-size: 12px; }
body.fb-public-controls .catalog-category-chip.is-active { background: #342820; border-color: #735343; color: #f2b79d; }
body.fb-public-controls .catalog-category-chip.is-active:hover { background: #443126; }
body.fb-public-controls .catalog-category-chip.is-active span { color: inherit; }
body.fb-public-controls .catalog-search-clear { width: 44px; min-height: 44px; padding: 0; }
body.fb-public-controls .catalog-search { min-height: 48px; border-radius: 8px; }
body.fb-public-controls .catalog-search:focus-within { border-color: var(--control-focus); box-shadow: 0 0 0 2px #f6baa126; }

/* Promotion bars share the dark surface; their text and copy feedback stay intact. */
body.fb-public-controls :is(.product-promo, .pump-promo-banner) { background: #24211f; border: 1px solid #554236; border-radius: 10px; box-shadow: none; }
body.fb-public-controls .product-promo-badge { background: #342820; border-color: #735343; color: #f2b79d; }
body.fb-public-controls .pump-promo-banner strong { color: #f2b79d; }
body.fb-public-controls .promo-copy-btn { min-height: 44px; background: #30302f; color: var(--control-text); border-color: #57534f; }
body.fb-public-controls .promo-copy-btn:hover { background: #3c3530; border-color: var(--control-accent); }
body.fb-public-controls :is(.promo-copy-btn, .wb-article-copy).copied {
    background: #25372c;
    border-color: #5c8268;
    color: #c3dfca;
    box-shadow: none;
}
body.fb-public-controls .wb-article-copy { overflow: visible; }
body.fb-public-controls .wb-article-label { color: var(--control-muted); font: inherit; }
body.fb-public-controls .wb-article-value { color: inherit; }
body.fb-public-controls .wb-article-copy :is(.fire-cursor, .article-particle) { display: none; animation: none; }
body.fb-public-controls .article-toast { background: #25372c; border-color: #5c8268; color: #c3dfca; font-family: var(--control-font); top: auto; bottom: calc(100% + 6px); }

/* Gallery controls keep their fixed positions and keyboard handlers. */
body.fb-public-controls :is(.lightbox-close, .lightbox-nav) { width: 44px; height: 44px; padding: 0; background: #242526f2; }
body.fb-public-controls .lightbox-nav,
body.fb-public-controls .lightbox-nav:hover,
body.fb-public-controls .lightbox-nav:active { transform: translateY(-50%); }
body.fb-public-controls .lightbox-nav svg,
body.fb-public-controls .lightbox-close svg { width: 20px; height: 20px; }
body.fb-public-controls .gallery-thumb { border-radius: 8px; border-color: #414244; }
body.fb-public-controls .gallery-thumb.active { border-color: var(--control-accent); }

/* Native disclosure rows remain native, including their open/closed indicators. */
body.fb-public-controls .pump-faq-list summary { min-height: 44px; padding: 10px 12px; box-sizing: border-box; border-radius: 8px; font-family: var(--control-font); cursor: pointer; }
body.fb-public-controls .pump-faq-list summary:hover { background: var(--control-surface); }
body.fb-public-controls .pump-faq-list details[open] > summary { background: #342820; color: #f2b79d; }

/* Keyboard, hidden, disabled and motion states apply after every page-specific rule. */
body.fb-public-controls :is(a, button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
    outline: 2px solid var(--control-focus);
    outline-offset: 3px;
}
body.fb-public-controls :is(button, input, select, textarea):disabled {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
}
body.fb-public-controls [hidden] { display: none !important; }
@media (max-width: 760px) {
    body.fb-public-controls .fb-primary > .fb-desktop-link { display: none; }
    body.fb-public-controls .fb-primary { gap: 4px; }
    body.fb-public-controls :is(.fb-primary > a, .fb-menu > summary) { padding: 9px 10px; }
}
@media (max-width: 380px) {
    body.fb-public-controls .product-card .product-actions { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    body.fb-public-controls :is(button, a, summary, input, .gallery-thumb, .article-toast) { transition: none; }
    body.fb-public-controls .product-card :is(.product-link, .product-btn) { transition: none; }
}
