/* PennyPuffin public-page UI fixes — KP-UI-B + fix1 (restaged).
   Scope: .pp-pub only. Charcoal/orange identity kept. */

/* ── B8: language links — AA contrast + states + 44px targets ── */
.pp-pub .language-links { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; flex-wrap: wrap; }
.pp-pub .language-links a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; padding: 0 .5rem;
    color: #4b5b6c; font-weight: 600; font-size: .8rem;
    border-radius: 8px; text-decoration: none;
}
.pp-pub .language-links a:hover,
.pp-pub .language-links a:focus-visible { color: #0e558b; background: #edf4f8; }
.pp-pub .language-links a:focus-visible { outline: 2px solid #0e558b; outline-offset: 1px; }
.pp-pub .language-links a[aria-current="true"] { color: #0e558b; text-decoration: underline; }
.pp-pub .pp-on-orange .language-links a { color: #fff; }
.pp-pub .pp-on-orange .language-links a:hover,
.pp-pub .pp-on-orange .language-links a:focus-visible { color: #fff; background: rgba(0,0,0,.18); }
.pp-pub .pp-on-orange .language-links a[aria-current="true"] { color: #fff; }

/* ── B3: signed-in header controls collapse <=480px / <=400px ── */
@media (max-width: 480px) {
    .pp-pub .nav-actions { gap: 2px; }
    .pp-pub .header-messaging-toggle { min-width: 44px; min-height: 44px; padding: 0 .5rem; }
    .pp-pub .header-messaging-toggle > span:not(.notification-badge) { display: none; }
    .pp-pub .notification-link,
    .pp-pub .user-avatar-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .pp-pub .user-avatar-name, .pp-pub .user-avatar-chevron { display: none; }
    .pp-pub .user-dropdown { right: 0; left: auto; max-width: calc(100vw - 16px); }
}
@media (max-width: 400px) {
    .pp-pub .language-select { min-height: 44px; font-size: .8rem; padding: 0 .4rem; max-width: 92px; }
    .pp-pub .nav-actions .notification-link,
    .pp-pub .nav-actions .header-messaging-shell { display: none; }
    .pp-pub .nav-actions.pp-moved .notification-link,
    .pp-pub .nav-actions.pp-moved .header-messaging-shell { display: inline-flex; }
}
.pp-pub .pp-nav-extras { display: flex; align-items: center; gap: 8px; padding: .75rem 1rem; border-top: 1px solid rgba(15,23,42,.08); }
.pp-pub .pp-nav-extras .notification-link, .pp-pub .pp-nav-extras .header-messaging-shell { position: relative; }

/* ── fix1-1: Puff bubble (.stugepub-*) vs install banner — EXACT selectors ── */
.pp-pub #pwa-install-banner {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9998;
    display: flex; align-items: center; gap: .6rem;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: .6rem .8rem; box-shadow: 0 8px 30px rgba(15,23,42,.18);
}
.pp-pub #pwa-install-banner button { min-height: 44px; }
/* One at a time: banner wins, stugepub bubble hides (never overlaps) */
.pp-pub.pp-install-open #stugePubBubble,
.pp-pub.pp-install-open .stugepub-bubble {
    opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
}
/* Desktop+ wide screens where the banner is bottom-left: offset the bubble */
@media (min-width: 481px) {
    .pp-pub.pp-install-open #stugePubBubble { transform: translateY(-84px) !important; transition: transform .2s ease; }
}
/* Session-dismissed Puff stays hidden — exact selectors only */
.pp-pub.pp-puff-hidden #stugePubBubble,
.pp-pub.pp-puff-hidden .stugepub-bubble,
.pp-pub.pp-puff-hidden .stugepub-modal { display: none !important; }

/* ── fix1-2: nav toggle reachable above overlays ── */
.pp-pub #mobileNavToggle { position: relative; z-index: 1002; min-width: 44px; min-height: 44px; touch-action: manipulation; }

/* ── fix1-3: overflow guards <=480px ── */
@media (max-width: 480px) {
    .pp-pub .nav-menu { max-width: 100vw; }
    .pp-pub .user-dropdown { max-width: calc(100vw - 12px); right: 0; }
}

/* ── b-design-5-flea: flea market interior polish (.pp-pub scoped) ── */
.pp-pub .fm-browse-hero h1 { color: #132539; }
.pp-pub .fm-browse-hero p { color: #4b5b6c; }
.pp-pub .fm-filter-bar { gap: .5rem; flex-wrap: wrap; }
.pp-pub .fm-filter-bar .form-control { min-height: 44px; }
.pp-pub .fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.pp-pub .fm-grid > a, .pp-pub .fm-item { border-radius: 12px; transition: transform .15s ease, box-shadow .15s ease; }
.pp-pub .fm-grid > a:hover, .pp-pub .fm-item:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15,23,42,.10); }
.pp-pub .fm-item-img { border-radius: 12px 12px 0 0; background: #f1f5f9; }
.pp-pub .fm-item-img img { border-radius: 12px 12px 0 0; object-fit: cover; }
.pp-pub .fm-item-seller { color: #4b5b6c; font-size: .8rem; }
.pp-pub .fm-item-footer { align-items: center; }
.pp-pub .fm-item-footer .btn, .pp-pub .fm-filter-bar .btn-primary { background: #0e558b; border-color: #0e558b; color: #fff; min-height: 44px; }
.pp-pub .fm-item-footer .btn:hover, .pp-pub .fm-filter-bar .btn-primary:hover { background: #0b416b; border-color: #0b416b; }
.pp-pub .fm-item-footer .btn:focus-visible, .pp-pub .fm-filter-bar .btn-primary:focus-visible { outline: 2px solid #0e558b; outline-offset: 1px; }
.pp-pub .btn-outline { color: #0e558b; border-color: #0e558b; background: transparent; min-height: 44px; }
.pp-pub .btn-outline:hover { background: #edf4f8; }
.pp-pub .fm-pagination a, .pp-pub .fm-pagination span { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.pp-pub .fm-pagination a { color: #0e558b; }
.pp-pub .fm-pagination a:hover { background: #edf4f8; }
.pp-pub .fm-empty { color: #4b5b6c; }
@media (max-width: 480px) {
    .pp-pub .fm-grid { grid-template-columns: 1fr; }
    .pp-pub .fm-filter-bar { flex-direction: column; }
    .pp-pub .fm-filter-bar input, .pp-pub .fm-filter-bar select, .pp-pub .fm-filter-bar .form-control, .pp-pub .fm-filter-bar .btn { width: 100%; flex: 1 1 100%; min-width: 0; }
    .pp-pub .fm-browse-hero { flex-direction: column; align-items: flex-start; gap: .75rem; }
    .pp-pub .fm-browse-hero .btn { width: 100%; justify-content: center; }
}

/* KP-UI-B-fix2 (2026-11-08): <=480px Puff launcher vs install banner —
   exactly one visible at a time; banner wins while shown, launcher
   returns when the banner is dismissed (body.pp-install-open toggles
   off via the MutationObserver). */
@media (max-width:480px){
  body.pp-pub.pp-install-open #stugePubBtn{
    display:none !important; visibility:hidden !important;
  }
}
/* Injected session 'Not now' control inside #pwa-install-banner. */
.pp-pub #pwa-install-banner .pp-install-notnow{
  min-height:44px; padding:.4rem .8rem; border:1.5px solid #0e558b;
  border-radius:8px; background:#fff; color:#0e558b; font-weight:600;
  font-size:.8rem; cursor:pointer; white-space:nowrap;
}
.pp-pub #pwa-install-banner .pp-install-notnow:hover{ background:#edf4f8; }
.pp-pub #pwa-install-banner .pp-install-notnow:focus-visible{
  outline:2px solid #0e558b; outline-offset:2px;
}

/* KP-UI-B-fix2: flea browse hero -> charcoal/orange brand (was purple #7c3aed). */
.pp-pub .fm-browse-hero{
  background:#edf4f8;
  border-bottom:1px solid #ced9de;
}
.pp-pub .sell-cta{ background:#0e558b; }
.pp-pub .sell-cta:hover{ background:#0b416b; }
.pp-pub .sell-cta:focus-visible{ outline:2px solid #0e558b; outline-offset:2px; }

/* KP-UI-B-fix2 restage (per LINT HOLD 00:50): AA contrast inside the
   charcoal flea hero — headings/icon white, body text light enough for
   >=4.5:1 on #111-#0f1e2f. */
.pp-pub .fm-browse-hero h1{ color:#132539 !important; }
.pp-pub .fm-browse-hero i{ color:#0e558b !important; }
.pp-pub .fm-browse-hero h2{ color:#0e558b !important; }
.pp-pub .fm-browse-hero p{ color:#4b5b6c; opacity:1; }

/* KP-UI-B-fix2b (2026-11-08, SCOPE-revised: bug fixes only; hero redesign
   VOIDED). Eyebrow at full opacity (overrides inline .6) - AA on charcoal. */
.pp-pub .fm-browse-hero h2{ opacity:1 !important; }
/* ADDENDUM restage (per LINT HOLD 03:32): while the cookie consent banner
   (#pp-consent-banner) is open at <=480px, LIFT the Puff/chat launchers
   above it — they stay visible and 44px-tappable, no overlap. The banner
   height is measured live into --pp-consent-h by pp-public.js; fallback
   6.5rem covers the unmeasured first frame. stuge_public.php already
   toggles body.pp-consent-open. */
@media (max-width:480px){
  body.pp-pub.pp-consent-open:not(.pp-bottom-managed) #stugePubBtn,
  body.pp-pub.pp-consent-open:not(.pp-bottom-managed) .stugepub-btn,
  body.pp-pub.pp-consent-open:not(.pp-bottom-managed) #biznizChatLauncher{
    bottom:calc(var(--pp-consent-h, 6.5rem) + 12px + env(safe-area-inset-bottom, 0px)) !important;
    z-index:2147483000 !important;
  }
}

/* KP-UI-B-fix3 (2026-11-08, restaged per HOLD: .fm-page-btn lives OUTSIDE
   .fm-filter-bar, so it gets its own selector). >=44px touch targets on
   flea filter/search controls + pagination; .btn-outline states, AA. */
.pp-pub .fm-filter-bar input,
.pp-pub .fm-filter-bar select,
.pp-pub .fm-filter-bar button,
.pp-pub .fm-search input,
.pp-pub .fm-search select,
.pp-pub .fm-search button{ min-height:44px; }
.pp-pub .fm-page-btn{ display:inline-flex; align-items:center; min-height:44px; }
.pp-pub .btn-outline{
  display:inline-flex; align-items:center; justify-content:center;
  min-height:44px; border-color:#0e558b; color:#0e558b;
}
.pp-pub .btn-outline:hover{ background:#0e558b; color:#fff; }
.pp-pub .btn-outline:active{ background:#0b416b; border-color:#0b416b; color:#fff; }
.pp-pub .btn-outline:focus-visible{ outline:2px solid #0e558b; outline-offset:2px; }


/* B-pagesmith-shared-2 (2026-11-08): DESIGN.md shared chrome.
   Peach accent surface (badges/chips), card + input tokens, peach
   label markers. Palette: primary #0e558b / hover #0b416b, secondary
   #dceaf3 / fg #0b416b, surface #edf4f8, border #ced9de, ink #132539. */
.pp-pub .badge,
.pp-pub .pp-badge,
.pp-pub .fm-badge,
.pp-pub .ws-badge{
  background:#dceaf3; color:#0b416b; border-radius:9999px;
  padding:.15rem .6rem; font-size:.75rem; font-weight:600;
}
.pp-pub .fm-browse-hero h2::before{
  content:''; display:inline-block; width:10px; height:10px;
  background:#dceaf3; border:1px solid #0b416b; border-radius:50%;
  margin-right:.45rem; vertical-align:baseline;
}
.pp-pub .card,
.pp-pub .business-card,
.pp-pub .rc-card,
.pp-pub .fm-item{
  border-radius:10px; border:1px solid #ced9de;
  box-shadow:0 1px 2px rgba(0,0,0,.05);
}
.pp-pub .card:not([class*="tint"]),
.pp-pub .business-card:not([class*="tint"]),
.pp-pub .rc-card:not([class*="tint"]),
.pp-pub .fm-item:not([class*="tint"]){
  background:#fff;
}
.pp-pub input[type="text"],
.pp-pub input[type="search"],
.pp-pub input[type="email"],
.pp-pub input[type="password"],
.pp-pub input[type="number"],
.pp-pub select,
.pp-pub textarea{
  min-height:48px; border:1px solid #ced9de; border-radius:10px;
  background:#edf4f8; padding:0 .75rem;
}
.pp-pub textarea{ padding:.75rem; }
.pp-pub input:focus,
.pp-pub select:focus,
.pp-pub textarea:focus{
  outline:2px solid #0e558b; outline-offset:1px; border-color:#0e558b;
}

/* B-pagesmith-header-1 Addendum 1 (2026-11-08): shared public button system.
   primary = navy filled #0e558b (hover #0b416b), white text, >=16px,
   weight>=600; secondary/outline = white bg + 2px navy border + navy text;
   >=44px targets; AA focus ring; dark text only on tints/badges. */
.pp-pub .btn,
.pp-pub .btn-primary{
  display:inline-flex; align-items:center; justify-content:center; gap:.4rem;
  min-height:44px; padding:0 .9rem; border-radius:10px;
  font-size:1rem; font-weight:600; cursor:pointer; text-decoration:none;
  border:1px solid transparent;
}
.pp-pub .btn-primary{
  background:#0e558b; color:#fff; border-color:#0e558b;
}
.pp-pub .btn-primary:hover{ background:#0b416b; border-color:#0b416b; color:#fff; }
.pp-pub .btn-primary:active{ background:#093556; border-color:#093556; color:#fff; }
.pp-pub .btn-primary:focus-visible{ outline:2px solid #0e558b; outline-offset:2px; }
.pp-pub .btn-secondary,
.pp-pub .btn-outline{
  background:#fff; color:#0e558b; border:2px solid #0e558b;
}
.pp-pub .btn-secondary:hover,
.pp-pub .btn-outline:hover{ background:#edf4f8; color:#0b416b; border-color:#0b416b; }
.pp-pub .btn-secondary:active,
.pp-pub .btn-outline:active{ background:#dceaf3; color:#0b416b; border-color:#0b416b; }
.pp-pub .btn-secondary:focus-visible,
.pp-pub .btn-outline:focus-visible{ outline:2px solid #0e558b; outline-offset:2px; }
/* CTA variants */
.pp-pub .sell-cta{ background:#0e558b; color:#fff; }
.pp-pub .sell-cta:hover{ background:#0b416b; color:#fff; }
.pp-pub .sell-cta:focus-visible{ outline:2px solid #0e558b; outline-offset:2px; }
/* badges keep dark ink text on peach (no low-contrast text on tints) */
.pp-pub .badge,.pp-pub .pp-badge,.pp-pub .fm-badge,.pp-pub .ws-badge{ color:#0b416b; }

/* B-pagesmith-header-1 Addendum 2 (2026-11-08): real mobile layout fixes
   verified from live 360/390px headless shots (see stage-b\...\shots\).
   (a) flea filter-bar horizontal overflow at 360px: text input had
   min-width:160px and select/number flexed past the viewport — stack
   controls below 480px. (b) flea hero subtitle clipped at viewport edge —
   allow wrap + side padding. (c) cookie-consent buttons retokened:
   Accept navy primary, Reject ghost, Settings text — .cc-* selectors are
   global (stuge_public.php is unowned), so the overrides are .pp-pub-scoped. */
@media (max-width:480px){
  .pp-pub .fm-filter-bar input[type="text"]{ min-width:0; flex:1 1 100%; }
  .pp-pub .fm-filter-bar select,
  .pp-pub .fm-filter-bar input[type="number"]{ flex:1 1 100%; width:100%; min-width:0; }
  .pp-pub .fm-filter-bar button,
  .pp-pub .fm-filter-bar .btn{ flex:1 1 100%; justify-content:center; }
  .pp-pub .fm-browse-hero p{ overflow-wrap:anywhere; padding:0 .5rem; }
}
.pp-pub #pp-consent-banner .cc-accept{
  background:#0e558b; color:#fff; border-color:#0e558b;
}
.pp-pub #pp-consent-banner .cc-accept:hover{ background:#0b416b; border-color:#0b416b; }
.pp-pub #pp-consent-banner .cc-reject{
  background:#fff; color:#0e558b; border:1px solid #ced9de;
}
.pp-pub #pp-consent-banner .cc-btn{ min-height:44px; border-radius:10px; font-weight:600; }
.pp-pub #pp-consent-banner .cc-btn:focus-visible{ outline:2px solid #0e558b; outline-offset:2px; }
/* Mobile nav drawer: larger tap rows + spacing */
.pp-pub .mobile-quick-btn{ min-height:44px; }
.pp-pub .nav-menu-open .nav-link{ display:block; padding:.8rem 1rem; min-height:44px; }
.pp-pub .nav-menu-open .nav-dropdown-item{ min-height:44px; display:flex; align-items:center; }

/* B-pagesmith-shared-3 (2026-11-08): consent Reject gets equal solid weight
   on .pp-pub interiors (homepage rule lives in header.php inline style
   because pp-public.css is not loaded on /). */
.pp-pub #pp-consent-banner .cc-reject{
  background:#132539; color:#fff; border:2px solid #132539;
}
.pp-pub #pp-consent-banner .cc-reject:hover{ background:#0f1e2f; }

/* B-theme-1 batch-5a: Puff dismiss X contrast + 44px tap (scoped override;
   stuge_public.php itself is not B-owned). */
.pp-pub .stugepub-close{background:#fff;border:1px solid #ced9de;border-radius:8px;width:44px;height:44px;color:#132539;font-weight:700;font-size:1.15rem;line-height:1}
.pp-pub .stugepub-close:hover{background:#edf4f8}

/* B-theme-1 batch-6: stugepub orange accents -> navy (scoped override, stuge_public.php not B-owned) */
.pp-pub .stugepub-bubble .yes,
.pp-pub .stugepub-bubble-actions .stugepub-btn.yes{background:#0e558b;color:#fff}
.pp-pub .stugepub-bubble .yes,.pp-pub .stugepub-bubble .no{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
.pp-pub .stugepub-link:not(.alt){color:#fff}
.pp-pub .stugepub-link:not(.alt):hover,.pp-pub .stugepub-link:not(.alt):focus-visible{color:#fff;background:#0b416b}
.pp-pub .stugepub-link:not(.alt):focus-visible{outline:2px solid #0e558b;outline-offset:2px}

/* B-cookie-puff-recheck-2: lift Puff bubble/modal + install/push banners above
   the consent banner while it is visible (gtag sets body.pp-consent-open +
   --pp-consent-h). Restores automatically when consent closes (class removed). */
.pp-pub.pp-consent-open .stugepub-bubble,
.pp-pub.pp-consent-open .stugepub-modal,
.pp-pub.pp-consent-open:not(.pp-bottom-managed) #pwa-install-banner,
.pp-pub.pp-consent-open:not(.pp-bottom-managed) #push-banner {
  bottom: calc(var(--pp-consent-h, 0px) + 12px) !important;
}

/* B-push-banner-footer-4 (option a + right clearance): keep the fixed Puff
   button/bubble off footer links at every width — WW anon-3 still saw a
   4.4px sliver on /fi/ 360 + a 57x4.4px clip at /fi/ 1280, and the bubble
   covered the last link's top edge by 13-22px.
   (a) <=380px: hide #stugePubBtnLabel -> icon-only ~54px button, the 44px
       target + aria-label are untouched (stuge_public.php not B-owned).
   (b) right clearance on footer link rows so no link rect reaches the
       button zone: 128px signed-out, 190px when #biznizChatLauncher sits
       left of the Puff (signed-in).
   (c) #stugePubBubble lifted 48px above its anchor so its bottom edge
       clears the last footer row (transform, so every bottom variant —
       default / consent-open / :has(#biznizChatLauncher) — is lifted
       uniformly; the .pp-install-open -84px !important rule still wins). */
.pp-pub .site-footer .site-footer-tools { padding-right: 128px; }
body.pp-pub:has(#biznizChatLauncher) .site-footer .site-footer-tools { padding-right: 190px; }
@media (max-width:480px){
  .pp-pub .site-footer .site-footer-links { padding-right: 128px; }
  body.pp-pub:has(#biznizChatLauncher) .site-footer .site-footer-links { padding-right: 190px; }
}
@media (max-width:380px){
  .pp-pub #stugePubBtnLabel { display: none !important; }
}
.pp-pub #stugePubBubble { transform: translateY(-48px); }
