/*
 * Marketplace public-site page styles. The brand base (tokens, nav, CTA, footer,
 * headings, …) comes from the shared /brand.css @imported below; this file adds
 * ONLY the marketplace-specific components: the sidebar-nav shell, category/type
 * tiles, breadcrumbs, section heads, the (in-column) hero band, the listing grid,
 * tier/tag pills, and the product-detail page.
 *
 * Served at /marketplace.css and linked by the marketplace pages, which are
 * RENDERED BY the mango-team `marketplace-publisher` lambda (not Astro). The lambda
 * emits plain HTML using the class names here + in brand.css (.nav__*, .footer,
 * .shell*, .snav*, .card, .tiles/.tile, .pdp-*, .cta, .tag, .tier, …) and links
 * this file.
 *
 * Changing the marketplace chrome (this file, /brand.css, or the Header/Footer
 * markup) affects the public marketplace site — keep the lambda's rendered HTML
 * matching these classes. See CLAUDE.md → "Brand base & marketplace chrome
 * (shared with mango-team)".
 */
@import url("/brand.css");

/* Sticky footer: fill at least the viewport so the footer sits at the bottom on
   short pages instead of floating mid-screen. (Marketplace-only — the marketing
   site lays out its own long pages.) */
body{min-height:100vh;display:flex;flex-direction:column}
main{flex:1 0 auto}

/* ===== Shell — sidebar nav + content column ============================== */
/* The browse pages are a two-column shell: a sticky left sidebar of fixed nav
   items beside the scrolling content column. The shell is container-width and
   centred; the content column carries its own gutter (hero + .mkt-body). */
/* Full-bleed shell: the sidebar sits flush in the left gutter and the content
   column runs to the right viewport edge, so the hero band bleeds yellow all the
   way right. The content INSIDE the column is capped at container width (see
   .mkt-hero / .mkt-body) so it reads at the same measure as other paiweb pages. */
.shell{
  flex:1 0 auto;
  width:100%;
  display:grid;
  /* [sidebar fills the left gutter] [content, capped at container width] [right
     gutter]. The content sits in the centred middle column (same measure/position
     as every other paiweb page); the sidebar grows to fill the left gutter, and the
     right gutter is spacing that the hero's background bleeds across. */
  grid-template-columns:minmax(248px,1fr) minmax(0,var(--p-container)) minmax(0,1fr);
  align-items:start;
}
.shell__nav{
  grid-column:1;
  position:sticky;top:var(--p-nav-h);
  align-self:start;
  height:calc(100vh - var(--p-nav-h));
  border-right:1px solid var(--p-light-gray);
  padding:32px 14px 24px 14px;
  display:flex;flex-direction:column;
  background:var(--p-white);
}
/* Span the content column INTO the right gutter so the hero's yellow band bleeds
   to the right edge; the content inside stays capped (.mkt-body / hero text). */
.shell__main{min-width:0;grid-column:2 / 4}

/* Sidebar nav */
.snav{display:flex;flex-direction:column;gap:2px}
.snav__group{
  font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.14em;
  color:var(--p-slate);margin:26px 0 8px;padding-left:10px;
}
.snav a{
  display:flex;align-items:center;gap:11px;
  padding:9px 10px;border-radius:var(--p-radius-sm);
  font-size:14.5px;font-weight:500;color:var(--p-charcoal);
  transition:background var(--p-motion-fast) ease,color var(--p-motion-fast) ease;
}
.snav a:not(.is-active):hover{background:var(--p-off-white);color:var(--p-black)}
.snav a span{white-space:nowrap}
.snav a.is-active{background:var(--p-black);color:var(--p-white);font-weight:600}
/* Icons are class-free inline SVGs (published by name from paiweb's lucide adapter),
   so they're sized/coloured by their container — these selectors match both the new
   classless markup and the publisher's current class-based markup. */
.snav a svg{width:17px;height:17px;flex:0 0 17px;color:var(--p-slate)}
.snav a.is-active svg{color:var(--p-yellow)}
.snav a:not(.is-active):hover svg{color:var(--p-black)}
.snav__foot{margin-top:auto;padding-top:24px;border-top:1px solid var(--p-light-gray)}
.snav__foot a{font-size:13.5px;color:var(--p-slate)}
.snav__foot a svg{width:17px;height:17px;color:var(--p-slate)}

/* ===== Hero band (inside the content column) ============================= */
/* Yellow brand band, matching the marketing site's hero. Text stays black; the
   eyebrow square is black (amber would vanish on yellow). */
.mkt-hero{background:var(--p-yellow-gradient);padding:64px var(--p-gutter) 52px}
.mkt-hero .eyebrow{color:var(--p-black)}
.mkt-hero .eyebrow::before{background:var(--p-black)}
.mkt-hero .subhead{color:var(--p-black);max-width:60ch}
.mkt-hero .h1{max-width:24ch}
.mkt-hero--sub{padding:48px var(--p-gutter) 44px}
.mkt-hero--sub .h1{font-size:clamp(30px,3.4vw,42px)}

/* Breadcrumb */
.crumbs{display:flex;align-items:center;gap:9px;font-size:13px;color:var(--p-charcoal);margin:0 0 16px}
.crumbs a{font-weight:600;border-bottom:1px solid var(--p-overlay-dark);padding-bottom:1px}
.crumbs a:hover{border-bottom-color:var(--p-black)}
.crumbs span{opacity:.55}

/* ===== Sections ========================================================= */
.mkt-body{max-width:var(--p-container);padding:0 var(--p-gutter)}
.mkt-section{padding:52px 0}
.mkt-section+.mkt-section{border-top:1px solid var(--p-light-gray)}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 26px}
.section-head--tight{margin-bottom:10px}
.section-title{
  font-family:var(--p-font-display);font-weight:700;font-size:26px;line-height:1.1;
  letter-spacing:-.01em;text-transform:uppercase;margin:0;
  display:flex;align-items:center;gap:12px;
}
.section-title::before{content:"";width:14px;height:14px;background:var(--p-yellow);flex-shrink:0}
.section-sub{font-size:15px;color:var(--p-slate);margin:0 0 26px 26px;max-width:76ch}
.more{
  display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;
  font-size:14px;font-weight:600;color:var(--p-black);
  padding-bottom:2px;border-bottom:2px solid var(--p-yellow);
  transition:border-color var(--p-motion-fast) ease;white-space:nowrap;
}
.more:hover{border-bottom-color:var(--p-black)}
.more svg{width:15px;height:15px}

/* ===== Cards ============================================================= */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:24px}
.card{display:flex;flex-direction:column;color:inherit;background:var(--p-white);border:1px solid var(--p-light-gray);border-radius:var(--p-radius-sm);overflow:hidden;transition:transform var(--p-motion-fast) ease,border-color var(--p-motion-fast) ease,box-shadow var(--p-motion-fast) ease}
.card:hover{transform:translateY(-3px);border-color:var(--p-black);box-shadow:var(--p-shadow-md)}
.thumb{width:100%;aspect-ratio:16/10;object-fit:cover;display:block;background:var(--p-off-white)}
.thumb--empty{background:var(--p-off-white);display:flex;align-items:center;justify-content:center}
.thumb--empty svg{width:44px;height:44px;color:var(--p-slate)}
.card-body{padding:16px 18px 20px;display:flex;flex-direction:column;flex:1}
.card-title{font-family:var(--p-font-display);font-weight:500;font-size:17.5px;line-height:1.2;letter-spacing:-.01em;margin:0 0 7px}
.desc{margin:0 0 14px;font-size:14px;line-height:1.5;color:var(--p-charcoal);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

.tags{display:flex;flex-wrap:wrap;gap:8px}
.tag{font-size:12px;font-weight:500;padding:4px 10px;border-radius:var(--p-radius-xs);background:var(--p-off-white);color:var(--p-charcoal)}
.tiers{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px}
/* In a card, pin the availability row to the bottom so a row of cards aligns. */
.card-body .tiers{margin-top:auto}
.tiers .group-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--p-slate)}
.tier{font-size:12px;font-weight:600;padding:4px 10px;border-radius:var(--p-radius-xs);background:var(--p-black);color:var(--p-white)}

/* ===== Category / type tiles ============================================ */
/* Category tiles are text-only (no .tile__icon). The icon rules below drive the
   "By type" overview tiles (.tile--type) and any large tile (.tile--lg). */
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(258px,1fr));gap:20px}
.tiles--4{grid-template-columns:repeat(4,minmax(0,1fr))}
.tile{
  display:flex;flex-direction:column;
  background:var(--p-white);border:1px solid var(--p-light-gray);
  border-radius:var(--p-radius-sm);padding:24px 22px 22px;
  transition:transform var(--p-motion-fast) ease,border-color var(--p-motion-fast) ease,box-shadow var(--p-motion-fast) ease;
}
.tile:hover{transform:translateY(-3px);border-color:var(--p-black);box-shadow:var(--p-shadow-md)}
.tile__icon{
  width:54px;height:54px;flex:0 0 54px;
  display:flex;align-items:center;justify-content:center;
  background:var(--p-yellow);border-radius:var(--p-radius-sm);margin-bottom:18px;
}
.tile__icon svg{width:30px;height:30px;color:var(--p-black)}
.tile--lg .tile__icon{width:62px;height:62px;flex-basis:62px}
.tile--lg .tile__icon svg{width:34px;height:34px}
.tile__title{
  font-family:var(--p-font-display);font-weight:700;font-size:19px;line-height:1.2;
  letter-spacing:-.01em;margin:0 0 8px;
}
.tile__desc{font-size:14px;line-height:1.5;color:var(--p-charcoal);margin:0 0 16px}
.tile__count{
  margin-top:auto;font-size:12px;font-weight:600;text-transform:uppercase;
  letter-spacing:.1em;color:var(--p-slate);
}
/* Type tiles ("By type" overview) use a dark glyph instead of the yellow chip. */
.tile--type .tile__icon{background:var(--p-slate-dark)}
.tile--type .tile__icon svg{color:var(--p-yellow)}

/* ===== Listing / empty states =========================================== */
.empty{color:var(--p-slate);padding:56px 0}

.listing-wrap{padding:32px 0 72px}
.back{margin:0 0 24px}
.back a{color:var(--p-slate);font-size:14px}
.back a:hover{color:var(--p-black)}
.listing{max-width:760px}
.meta{color:var(--p-slate);font-size:14px;margin:8px 0 20px}
.full-desc{white-space:pre-wrap;font-size:17px;line-height:1.6;color:var(--p-charcoal)}
/* Detail gallery carousel: prev/next buttons (carousel.js) drive a scroll-snap track;
   swipe still works on touch, and the scrollbar is hidden. Slides cap at 440px so a wide
   screen shows ~two with the next peeking in, a phone shows one plus a peek — no media
   query. object-fit contain (not crop) so any aspect fits, matching the app. */
.carousel{position:relative;margin-top:28px}
.gallery{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.gallery::-webkit-scrollbar{display:none}
.gallery > img{flex:0 0 auto;width:min(82%,440px);scroll-snap-align:start}
.gallery img{width:100%;aspect-ratio:16/9;object-fit:contain;background:var(--p-off-white);border-radius:var(--p-radius-sm);border:1px solid var(--p-light-gray);display:block}
/* One image (or the placeholder): a single full-width frame, no scroll, no buttons. */
.gallery--single{margin-top:28px;display:block;overflow:visible}
.carousel-btn{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:40px;display:flex;align-items:center;justify-content:center;font-size:24px;line-height:1;color:var(--p-charcoal);background:var(--p-white);border:1px solid var(--p-light-gray);border-radius:50%;box-shadow:var(--p-shadow-sm);cursor:pointer;transition:background var(--p-motion-fast) ease,border-color var(--p-motion-fast) ease,color var(--p-motion-fast) ease}
.carousel-btn:hover{background:var(--p-off-white);border-color:var(--p-black);color:var(--p-black)}
.carousel-btn svg{width:20px;height:20px;display:block}
/* At a scroll extent the control is disabled (see carousel.js): dim it, drop the
   affordance, and neutralise hover so it doesn't read as pressable. */
.carousel-btn:disabled{opacity:.35;cursor:default;box-shadow:none}
.carousel-btn:disabled:hover{background:var(--p-white);border-color:var(--p-light-gray);color:var(--p-charcoal)}
.carousel-prev{left:10px}
.carousel-next{right:10px}

/* ===== Product detail page (Play-Store-inspired) ========================== */
/* Slate-dark (not pure black) so the hero matches the nav/footer + the marketing
   site's dark bands. */
.pdp-hero{position:relative;overflow:hidden;background:var(--p-slate-dark);color:var(--p-white);padding:76px 0 60px;min-height:360px}
/* The cover sits on the right ~two-thirds and fades into the solid-dark left (where the
   text lives) via a left-edge mask — the Play-Store treatment. Light blur only, since
   the source is a 400px thumbnail scaled up. */
.pdp-hero__bg{position:absolute;top:0;bottom:0;right:0;width:64%;background-size:cover;background-position:center;filter:blur(4px) brightness(.9);-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 42%);mask-image:linear-gradient(90deg,transparent 0,#000 42%)}
.pdp-hero__inner{position:relative}
.pdp-hero__title{color:var(--p-white);margin:0 0 6px;max-width:18ch}
.pdp-author{font-family:var(--p-font-body);font-weight:600;font-size:16px;color:var(--p-amber);margin:0 0 22px}
.pdp-hero__meta{display:flex;align-items:center;gap:12px;margin:0 0 24px}
.pdp-hero__meta .tags{margin-top:0}
/* Install button's external-link icon (spacing comes from .cta's inline-flex gap). */
.pdp-hero__actions .cta svg{width:15px;height:15px}

/* padding-block only — keep the shared .container's horizontal gutter (56px, 24px
   on mobile) instead of resetting it to 0. */
/* Gallery on the left, About + details on the right, top-aligned — mirrors the
   in-app listing pane. */
.pdp-body{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:48px;padding-block:40px 72px;align-items:start}
.pdp-main{min-width:0}
.pdp-side{min-width:0}
/* First element in each column sits flush at the top so the two columns align. */
.pdp-main .carousel,.pdp-main .gallery--single{margin-top:0}
.pdp-side > :first-child{margin-top:0}
.pdp-section-title{font-family:var(--p-font-display);font-weight:700;font-size:24px;letter-spacing:-.01em;margin:36px 0 14px}
.pdp-desc{font-size:16px;line-height:1.65;color:var(--p-charcoal)}
.pdp-desc>*:first-child{margin-top:0}
.pdp-desc>*:last-child{margin-bottom:0}
.pdp-desc p{margin:0 0 12px}
.pdp-desc h3,.pdp-desc h4{font-family:var(--p-font-display);font-weight:700;letter-spacing:-.01em;margin:20px 0 8px}
.pdp-desc h3{font-size:18px}
.pdp-desc h4{font-size:16px}
.pdp-desc ul,.pdp-desc ol{margin:0 0 12px;padding-left:22px}
.pdp-desc li{margin:2px 0}
.pdp-desc a{color:var(--p-blue);text-decoration:underline}
.pdp-desc strong{font-weight:700}
.pdp-facts{display:flex;flex-wrap:wrap;gap:40px;margin:28px 0 8px}
.pdp-facts > div{font-size:15px;color:var(--p-charcoal)}
.pdp-fact-label{display:block;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.1em;color:var(--p-slate);margin-bottom:4px}

/* ===== Responsive ======================================================= */
/* Collapse the shell to a single column; the sidebar becomes a horizontal strip
   above the content. */
@media (max-width:900px){
  .shell{grid-template-columns:1fr}
  .shell__main{grid-column:1}
  .shell__nav{
    position:static;height:auto;border-right:0;
    border-bottom:1px solid var(--p-light-gray);
    padding:20px var(--p-gutter);
  }
  .snav{flex-direction:row;flex-wrap:wrap;gap:6px}
  .snav__group{margin:0;padding:9px 0;width:100%}
  .snav__foot{margin:0;padding-top:16px;width:100%;border-top:0}
}

@media (max-width:860px){
  .pdp-body{grid-template-columns:1fr;gap:32px}
  .pdp-hero__title{max-width:none}
  /* On a narrow screen the right-anchored cover would collide with the text — drop it
     to a clean solid-dark hero. */
  .pdp-hero__bg{display:none}
}

/* The marketing site collapses the 4-col footer to 2 at this width (that rule lives
   in global.css, which the marketplace doesn't load) — mirror it here. */
@media(max-width:921px){
  .footer__top{grid-template-columns:1fr 1fr}
}

@media(max-width:1180px){
  .tiles--4{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:640px){
  .mkt-hero{padding:44px var(--p-gutter) 34px}
  .mkt-section{padding:38px 0}
  .section-head{flex-direction:column;align-items:flex-start;gap:12px}
}

@media(max-width:560px){
  .tiles--4{grid-template-columns:1fr}
}
