/* =====================================================================
   PUBLIC SITE — layout for the shop-facing pages
   =====================================================================
   Built on the cc-v3 tokens, so a shop's accent colour and font — set
   once in Branding — flow through every page without a single rule here
   naming a colour. Customisation that required editing CSS would not be
   customisation a shop owner could actually do.
   ===================================================================== */

.cc-pub-wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.cc-pub-main { min-height: 60vh; }

.cc-announce {
    background: var(--cc-accent);
    color: var(--cc-accent-text);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
}

/* --- header ----------------------------------------------------------- */
.cc-pub-head {
    position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--cc-bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--cc-line);
}
.cc-pub-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.cc-pub-brand { display: flex; align-items: center; text-decoration: none; color: var(--cc-text); min-width: 0; }
.cc-pub-brand img { max-height: 40px; max-width: 200px; object-fit: contain; }
.cc-pub-brand span { font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cc-pub-nav { display: flex; align-items: center; gap: 4px; }
.cc-pub-nav a {
    color: var(--cc-text-dim); text-decoration: none; font-size: 14px; font-weight: 550;
    padding: 8px 12px; border-radius: var(--cc-r-sm);
}
.cc-pub-nav a:hover { color: var(--cc-text); background: var(--cc-surface-2); }
.cc-pub-nav a[aria-current="page"] { color: var(--cc-accent); }
.cc-theme-btn {
    background: none; border: 1px solid var(--cc-line); color: var(--cc-text-dim);
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px; margin-left: 6px;
}
.cc-theme-btn:hover { border-color: var(--cc-accent); color: var(--cc-text); }

/* --- hero ------------------------------------------------------------- */
.cc-pub-hero { padding: 72px 0 56px; border-bottom: 1px solid var(--cc-line); }
.cc-pub-hero h1 {
    margin: 0 0 14px; font-size: clamp(30px, 5.5vw, 52px);
    line-height: 1.08; letter-spacing: -.025em; max-width: 18ch;
}
.cc-pub-hero p { margin: 0; color: var(--cc-text-dim); font-size: 17px; max-width: 56ch; line-height: 1.6; }
.cc-pub-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.cc-pub-stats { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 34px; }
.cc-pub-stats b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.cc-pub-stats span { font-size: 12px; color: var(--cc-text-mute); text-transform: uppercase; letter-spacing: .06em; }

.cc-pub-section { padding: 52px 0; }
/* A page that is both (hold list, gift cards, my account…): keep the side gutter the section padding would zero. */
body .cc-pub-wrap.cc-pub-section { padding-left: 22px; padding-right: 22px; }
.cc-pub-section + .cc-pub-section { border-top: 1px solid var(--cc-line); }
.cc-pub-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cc-pub-section-head h2 { margin: 0; font-size: 24px; letter-spacing: -.015em; }
.cc-pub-section-head p { margin: 4px 0 0; color: var(--cc-text-dim); font-size: 14px; }

/* --- category tiles ----------------------------------------------------- */
.cc-pub-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cc-pub-cat {
    display: block; padding: 18px; text-decoration: none; color: var(--cc-text);
    background: var(--cc-surface); border: 1px solid var(--cc-line); border-radius: var(--cc-r);
    transition: border-color .12s ease, transform .12s ease;
}
.cc-pub-cat:hover { border-color: var(--cc-accent); transform: translateY(-2px); }
.cc-pub-cat b { display: block; font-size: 15px; }
.cc-pub-cat span { font-size: 12.5px; color: var(--cc-text-mute); }

/* --- card grid (home "featured") ----------------------------------------- */
.cc-pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }

/* --- about + visit ------------------------------------------------------- */
.cc-pub-about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.cc-pub-prose { color: var(--cc-text-dim); font-size: 15.5px; line-height: 1.7; }
.cc-pub-prose p { margin: 0 0 14px; }
.cc-pub-card {
    background: var(--cc-surface); border: 1px solid var(--cc-line); border-radius: var(--cc-r); padding: 22px;
}
.cc-pub-card h3 { margin: 0 0 12px; font-size: 15px; }
.cc-pub-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.cc-pub-card dt { color: var(--cc-text-mute); }
.cc-pub-card dd { margin: 0; white-space: pre-line; }

@media (max-width: 760px) {
    .cc-pub-about { grid-template-columns: 1fr; gap: 24px; }
    .cc-pub-hero { padding: 46px 0 38px; }
    .cc-pub-nav a { padding: 8px 8px; font-size: 13.5px; }
}

/* --- banner (Settings → Branding → Banner image) ------------------------- */
.cc-pub-banner { position: relative; overflow: hidden; background: #111; }
.cc-pub-banner picture, .cc-pub-banner img { display: block; width: 100%; }
.cc-pub-banner-short  { height: 200px; }
.cc-pub-banner-medium { height: 340px; }
.cc-pub-banner-tall   { height: 480px; }
.cc-pub-banner-short img, .cc-pub-banner-medium img, .cc-pub-banner-tall img { height: 100%; object-fit: cover; object-position: center; }
.cc-pub-banner-full img { height: auto; }
.cc-pub-banner.has-text { height: auto; display: grid; }
.cc-pub-banner.has-text > picture, .cc-pub-banner.has-text > .cc-pub-banner-shade, .cc-pub-banner.has-text > .cc-pub-banner-inner { grid-area: 1 / 1; }
.cc-pub-banner.has-text > picture { position: relative; }
.cc-pub-banner.has-text.cc-pub-banner-short  { min-height: 200px; }
.cc-pub-banner.has-text.cc-pub-banner-medium { min-height: 340px; }
.cc-pub-banner.has-text.cc-pub-banner-tall   { min-height: 480px; }
.cc-pub-banner.has-text:not(.cc-pub-banner-full) > picture { position: absolute; inset: 0; }
.cc-pub-banner.has-text:not(.cc-pub-banner-full) img { height: 100%; object-fit: cover; }
.cc-pub-banner-shade { position: relative; z-index: 1; pointer-events: none; }
.cc-pub-banner-inner { position: relative; z-index: 2; display: flex; align-items: flex-end; color: #fff; }
.cc-pub-banner-inner > * { width: 100%; }
.cc-pub-hero-on-banner { border-bottom: 0; background: transparent; text-shadow: 0 1px 12px rgba(0,0,0,.45); }
.cc-pub-hero-on-banner h1 { color: #fff; }
.cc-pub-hero-on-banner p, .cc-pub-hero-on-banner .cc-pub-stats span { color: rgba(255,255,255,.88); }
.cc-pub-hero-on-banner .cc-pub-stats b { color: #fff; }
.cc-pub-hero-on-banner .cc-btn-ghost, .cc-pub-hero-on-banner .cc-btn:not(.cc-btn-primary) { color: #fff; border-color: rgba(255,255,255,.7); background: rgba(0,0,0,.25); }
@media (max-width: 700px) {
    .cc-pub-banner-short  { height: 140px; }
    .cc-pub-banner-medium { height: 220px; }
    .cc-pub-banner-tall   { height: 320px; }
    .cc-pub-banner.has-text.cc-pub-banner-short, .cc-pub-banner.has-text.cc-pub-banner-medium, .cc-pub-banner.has-text.cc-pub-banner-tall { min-height: 260px; }
}

/* --- hold form ----------------------------------------------------------- */
.cc-hold { margin-top: 18px; padding: 18px; }
.cc-hold summary { cursor: pointer; font-weight: 600; list-style: none; }
.cc-hold summary::-webkit-details-marker { display: none; }
.cc-hold form { display: grid; gap: 10px; margin-top: 14px; }
.cc-hold label { font-size: 12px; color: var(--cc-text-mute); text-transform: uppercase; letter-spacing: .05em; }
.cc-hold .cc-hp, .cc-hold-checkout .cc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cc-note-ok, .cc-note-err {
    padding: 12px 14px; border-radius: var(--cc-r-sm); font-size: 14px; margin-bottom: 16px;
}
.cc-note-ok  { background: var(--cc-good-soft); color: var(--cc-text); border-left: 3px solid var(--cc-good); }
.cc-note-err { background: var(--cc-bad-soft);  color: var(--cc-text); border-left: 3px solid var(--cc-bad); }

/* --- footer -------------------------------------------------------------- */
.cc-pub-foot { margin-top: 60px; border-top: 1px solid var(--cc-line); padding: 36px 0 26px; font-size: 13.5px; }
.cc-pub-foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 26px; }
.cc-pub-foot p { margin: 4px 0; color: var(--cc-text-dim); }
.cc-pub-foot a { color: var(--cc-text-dim); text-decoration: none; }
.cc-pub-foot a:hover { color: var(--cc-accent); }
.cc-pub-social { display: flex; gap: 14px; flex-wrap: wrap; align-content: flex-start; }
.cc-pub-legal { margin-top: 26px; color: var(--cc-text-mute); font-size: 12px; }

/* ---------------------------------------------------------------------
   Narrow screens: the shop's name gets its own row.
   ---------------------------------------------------------------------
   The brand and the nav shared one line, and the name gave way with an
   ellipsis — "Maple Street C…" on a phone. For a page whose whole point
   is letting a shop present itself, truncating its name on the device
   most customers use is the wrong thing to give up. Wrapping costs one
   line of height; the name stays whole.
   --------------------------------------------------------------------- */
@media (max-width: 520px) {
    .cc-pub-head { flex-wrap: wrap; row-gap: 6px; }
    .cc-pub-brand { flex: 1 1 100%; }
    .cc-pub-brand span { white-space: normal; overflow: visible; text-overflow: clip; }
    .cc-pub-nav { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------
   The shop's own custom HTML section (sanitized server-side).
   Scoped so a shop's markup inherits the palette instead of
   fighting it, and can never push the page wider than the screen.
   --------------------------------------------------------------- */
.cc-pub-custom { padding: 36px 0; }
.cc-pub-custom h2, .cc-pub-custom h3, .cc-pub-custom h4 { margin: 0 0 10px; color: var(--cc-text); }
.cc-pub-custom p { margin: 0 0 12px; line-height: 1.65; color: var(--cc-text-dim); }
.cc-pub-custom a { color: var(--cc-accent); text-decoration: underline; text-underline-offset: 2px; }
.cc-pub-custom img { max-width: 100%; height: auto; border-radius: var(--cc-r); }
.cc-pub-custom iframe { max-width: 100%; border: 0; border-radius: var(--cc-r); aspect-ratio: 16 / 9; width: 100%; height: auto; }
.cc-pub-custom table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.cc-pub-custom th, .cc-pub-custom td { padding: 8px 10px; border-bottom: 1px solid var(--cc-line); text-align: left; }
.cc-pub-custom blockquote { margin: 0 0 12px; padding: 12px 16px; border-radius: var(--cc-r); background: var(--cc-highlight-soft); }

/* Highlight color from the shop's palette: graded slabs and badges. */
.cc-pill-graded { background: var(--cc-highlight-soft); color: var(--cc-text); border-color: transparent; }
.cc-pub-eyebrow { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--cc-text-dim); }
.cc-pub-eyebrow::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cc-highlight); margin-right: 8px; vertical-align: 1px; }

/* Hold + Buy side by side on each card; wraps cleanly on narrow tiles. */
.cc-result-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.cc-layout-gallery .cc-result-actions, .cc-layout-binder .cc-result-actions { justify-content: flex-start; }
@media (max-width: 640px) { .cc-result-actions .cc-btn { flex: 1 1 auto; justify-content: center; min-height: 44px; } }

/* ---------------------------------------------------------------
   Hold list (hold.php)
   --------------------------------------------------------------- */
.cc-hold-list { background: var(--cc-surface); border: 1px solid var(--cc-line); border-radius: var(--cc-r); overflow: hidden; margin-bottom: 20px; }
.cc-hold-line { display: grid; grid-template-columns: 56px minmax(0,1fr) auto auto auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--cc-line); }
.cc-hold-line.is-flagged { background: var(--cc-bad-soft); }
.cc-hold-img { width: 56px; aspect-ratio: 5/7; background: var(--cc-surface-2); border-radius: 6px; overflow: hidden; display: block; }
.cc-hold-img img { width: 100%; height: 100%; object-fit: cover; }
.cc-hold-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cc-hold-qty .cc-select { width: auto; min-height: 40px; }
.cc-hold-price { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }
.cc-hold-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; background: var(--cc-surface-2); }
.cc-hold-total b { font-size: 20px; font-variant-numeric: tabular-nums; }
.cc-hold-checkout { display: grid; gap: 10px; max-width: 520px; }
.cc-hold-checkout label { font-size: 12px; color: var(--cc-text-mute); text-transform: uppercase; letter-spacing: .05em; }
.cc-pub-nav .cc-holdlink b { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px;
    background: var(--cc-highlight); color: var(--cc-highlight-text); font-size: 12px; text-align: center; }
@media (max-width: 640px) {
    .cc-hold-line { grid-template-columns: 48px minmax(0,1fr) auto; }
    .cc-hold-qty { grid-column: 2; }
    .cc-hold-price { grid-column: 3; grid-row: 1; }
}

/* Phones: brand on its own line, menu in a single scrollable row below,
   instead of squeezing every link into the header until they wrap into
   three-line stacks. */
@media (max-width: 640px) {
    .cc-pub-bar { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 6px; row-gap: 4px; }
    /* Wraps to a second line rather than scrolling: a scrolling row cut
       "Sign in" off at the edge with nothing to say there was more. */
    .cc-pub-nav { width: 100%; flex-wrap: wrap; row-gap: 2px; }
    .cc-pub-nav a { white-space: nowrap; }
    .cc-pub-nav .cc-theme-btn { flex-shrink: 0; }
    /* Two cards across on every layout, like the shop page — one per row
       made each card most of a screen tall. */
    .cc-pub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
}

/* "Notify me" request form on the shop page. */
.cc-alert-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.cc-alert-form .cc-field { min-width: 0; }


/* ---------------------------------------------------------------------
   Collapsed menu (phones, or whenever the links don't fit on one line).
   The footer script adds .is-collapsed; .is-open drops the list down
   under the header. Without script none of this applies and the links
   wrap as before.
   --------------------------------------------------------------------- */
.cc-menu-btn[hidden] { display: none; }
.cc-menu-btn {
    display: none; align-items: center; gap: 7px; flex: none;
    padding: 9px 14px; min-height: 42px; border-radius: var(--cc-r-sm);
    border: 1px solid var(--cc-line); background: var(--cc-surface); color: var(--cc-text);
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.cc-menu-btn:hover { border-color: var(--cc-accent); }
.cc-menu-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--cc-highlight); color: var(--cc-highlight-text); font-size: 12px; text-align: center; }

.cc-pub-head.is-collapsed .cc-menu-btn { display: inline-flex; }
.cc-pub-head.is-collapsed .cc-pub-bar,
.cc-layout-showcase .cc-pub-head.is-collapsed .cc-pub-bar {
    flex-direction: row; flex-wrap: nowrap; align-items: center; height: auto; min-height: 60px;
    padding-top: 8px; padding-bottom: 8px; gap: 12px;
}
.cc-pub-head.is-collapsed .cc-pub-brand { flex: 1 1 auto; min-width: 0; }
.cc-pub-head.is-collapsed .cc-pub-brand span {
    white-space: normal; overflow: hidden; text-overflow: clip; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cc-layout-showcase .cc-pub-head.is-collapsed .cc-pub-brand span { font-size: 19px; }
.cc-layout-showcase .cc-pub-head.is-collapsed .cc-pub-brand img { max-height: 42px; }
.cc-pub-head.is-collapsed .cc-pub-nav { display: none; }
.cc-pub-head.is-collapsed.is-open .cc-pub-nav {
    display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 40; box-sizing: border-box;
    padding: 8px 16px 16px; background: var(--cc-bg); border-bottom: 1px solid var(--cc-line);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .14);
    max-height: calc(100vh - 70px); overflow-y: auto; overscroll-behavior: contain;
}
.cc-pub-head.is-collapsed.is-open .cc-pub-nav a {
    padding: 13px 12px; font-size: 16px; white-space: normal; border-radius: var(--cc-r-sm);
    box-sizing: border-box; width: 100%; max-width: 100%;
}
.cc-pub-head.is-collapsed.is-open .cc-pub-nav a[aria-current="page"] { background: var(--cc-surface-2); }
.cc-pub-head.is-collapsed.is-open .cc-theme-btn { order: 99; margin: 8px 0 0 12px; align-self: flex-start; }
.cc-pub-head.is-collapsed.is-open .cc-menu-btn { border-color: var(--cc-accent); }
/* Wider screens with a long menu: a panel under the button, not a full-width sheet. */
@media (min-width: 700px) {
    .cc-pub-head.is-collapsed.is-open .cc-pub-nav {
        left: auto; right: max(16px, calc((100vw - 1180px) / 2 + 16px)); width: 300px;
        border: 1px solid var(--cc-line); border-radius: var(--cc-r); margin-top: 6px;
    }
}
