/* Shared component classes — the semantic layer over the theme TOKENS.
   Loaded by BOTH the storefront (shop/base.html) and the staff area
   (staff/base_staff.html), after each area's own theme/base.css. Every
   colour/spacing value resolves through the active theme's custom
   properties, so a new brand only ever adds a tokens file.

   Reach for these before composing utility chains in markup: a label is
   .field-label, not "text-xs text-muted block mb-1". */

/* ---- Form molecules ------------------------------------------------------ */
/* Field labels (196 uses before this existed) */
.field-label {
    font-size: .75rem;
    color: var(--brand-muted);
    display: block;
    margin-bottom: .25rem;
}
/* Help / meta text under fields; spacing variants stay in markup
   ("help-text mt-1") — only the typography is semantic. */
.help-text {
    font-size: .75rem;
    color: var(--brand-muted);
}
/* Settings-card action row (Save button + status, right-aligned) */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    padding-top: .5rem;
}

/* ---- Links ---------------------------------------------------------------- */
/* Accent-coloured inline links ("details →", "how pricing works") */
.link-accent {
    color: var(--brand-terra);
    text-decoration: underline;
}
.link-accent:hover {
    color: var(--brand-terradark, var(--brand-terra));
}

/* ---- Status text ---------------------------------------------------------- */
/* Amber warning text driven by the theme's semantic warning token. */
.text-warning {
    color: var(--brand-warning, #B45309);
}

/* ---- Buttons: size variants ----------------------------------------------- */
/* The areas' own .btn / .btn-ghost are the base look; these are the common
   sizes so markup doesn't re-assemble "btn text-sm" everywhere. Values
   mirror the staff .btn; hover follows the area accent. */
.btn-sm {
    background: var(--brand-ink);
    color: var(--brand-on-accent, #fff);
    padding: .45rem 1rem;
    border-radius: .5rem;
    font-size: .85rem;
}
.btn-sm:hover {
    background: var(--brand-terradark);
}
.btn-ghost-sm {
    border: 1px solid var(--brand-border, var(--brand-sand-deep));
    padding: .4rem .9rem;
    border-radius: .5rem;
    font-size: .85rem;
}
.btn-ghost-sm:hover {
    border-color: var(--brand-terradark);
    color: var(--brand-terradark);
}

/* ---- Badges ---------------------------------------------------------------- */
/* Muted pill badge ("badge bg-sand") for counts and statuses. Text matches
   the other neutral chips (main ink) — --brand-muted is too low-contrast
   at this size against the sand fill. */
.badge-muted {
    font-size: .65rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: 9999px;
    background: var(--brand-sand);
    color: var(--brand-ink, var(--brand-muted));
}

/* Semantic chips shared by staff + shop (shop themes may lack the ok
   tokens — fallbacks keep them readable). */
.ok-chip {
    background: color-mix(in srgb, var(--brand-ok, #166534) 16%, var(--brand-panel, #fff));
    color: var(--brand-ok, #166534);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-ok, #166534) 30%, transparent);
}
.danger-chip {
    background: color-mix(in srgb, var(--brand-danger, #B3341F) 14%, var(--brand-panel, #fff));
    color: var(--brand-danger, #B3341F);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-danger, #B3341F) 35%, transparent);
}

/* ---- Shared chrome (identical in both areas; lives here so a
   change applies everywhere at once) ------------------------------------ */
img {
    aspect-ratio: var(--brand-img-aspect);
    height: auto !important;
    object-fit: cover;
}
.logo-img {
    aspect-ratio: auto;
    object-fit: contain;
}
.lightbox-overlay {
    background: rgba(0, 0, 0, .92);
}
.tag-dot {
    background: var(--tag-colour, transparent);
}
.site-navmenu {
    position: relative;
    display: flex;
    align-items: center;
}
.site-topnav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 40px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
}
.site-topnav-toggle span {
    display: block;
    height: 2px;
    background: var(--brand-ink);
    transition: transform .2s ease, opacity .2s ease;
}
.menu-open .site-topnav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-open .site-topnav-toggle span:nth-child(2) {
    opacity: 0;
}
.menu-open .site-topnav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
.site-topnav-menu a {
    color: var(--brand-ink);
    font-size: .95rem;
    line-height: 1.4;
    text-decoration: none;
    padding: .55em .8em;
    border-radius: .5rem;
}
.site-topnav-menu a:hover {
    background: var(--brand-cream);
    text-decoration: none;
}
.menu-open .site-topnav-menu {
    display: flex;
}

/* Mobile-only wrapper: renders the bar markup as the mobile category list
   whenever the mobile layout is the expandable list (any desktop layout). */
.sidebar-mobile-only { display: block; }
@media (min-width: 768px) {
    .sidebar-mobile-only { display: none; }
}
