/*
 * Keylink storefront kit: brand tokens and the small set of shared
 * components every Keylink package builds on. Plain CSS (no build step),
 * every class prefixed `kl-` so nothing collides with Visual Debut's
 * Tailwind utilities. Body font and colour stay the theme's (set them in
 * Visual's theme settings, see CLAUDE.md section 6).
 *
 * Design: a calm trade catalogue. Warm-neutral paper bands, white product
 * wells so pack shots read like a printed catalogue, serif headings, dark
 * teal for authority and gold as a thin accent. Gold is never text on white.
 */

:root {
    --kl-teal: #47bab9;
    --kl-teal-dark: #237a79;
    --kl-teal-ink: #1f6f6e;
    --kl-navy: #004a5f;
    --kl-navy-deep: #003646;
    --kl-cyan: #c7eaea;
    --kl-cyan-soft: #e8f5f5;
    --kl-gold: #ffc107;
    --kl-gold-soft: #fff3cd;
    --kl-text: #31313f;
    --kl-muted: #4d5052;
    --kl-grey: #eaebea;
    --kl-line: #e2e5e3;
    --kl-paper: #f7f7f4;
    --kl-red: #dc3545;
    --kl-radius: 10px;
    --kl-radius-sm: 6px;
    --kl-font-heading: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
    --kl-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --kl-shadow: 0 18px 40px -28px rgba(0, 54, 70, 0.45);
}

.kl-container {
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

@media (min-width: 640px) {
    .kl-container { padding-inline: 1.5rem; }
}

@media (min-width: 1024px) {
    .kl-container { padding-inline: 2rem; }
}

.kl-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.kl-icon--sm { width: 1rem; height: 1rem; }
.kl-icon--lg { width: 1.5rem; height: 1.5rem; }
.kl-icon--xl { width: 2rem; height: 2rem; }

.kl-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.kl-section {
    padding-block: 3rem;
}

@media (min-width: 768px) {
    .kl-section { padding-block: 4rem; }
}

.kl-section--paper { background: var(--kl-paper); }
.kl-section--navy { background: var(--kl-navy); color: #fff; }
.kl-section--tight { padding-block: 1.5rem; }

.kl-eyebrow {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--kl-teal-dark);
}

.kl-section--navy .kl-eyebrow { color: var(--kl-cyan); }

.kl-display,
.kl-h1,
.kl-h2,
.kl-h3 {
    margin: 0;
    font-family: var(--kl-font-heading);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--kl-navy);
}

.kl-display { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.3rem); }
.kl-h1 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); }
.kl-h2 { font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.85rem); }
.kl-h3 { font-size: 1.15rem; }
.kl-section--navy .kl-h2 { color: #fff; }

.kl-lead {
    margin: 0;
    max-width: 40rem;
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--kl-muted);
}

.kl-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kl-head-row p { margin: 0; }

.kl-link {
    font-weight: 600;
    color: var(--kl-teal-dark);
    text-decoration: none;
}

.kl-link:hover { text-decoration: underline; }

.kl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.55rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s var(--kl-ease), border-color 0.2s var(--kl-ease), color 0.2s var(--kl-ease);
}

.kl-btn--primary { background: var(--kl-teal); color: var(--kl-navy-deep); }
.kl-btn--primary:hover { background: #3aa6a5; }
.kl-btn--dark { background: var(--kl-navy); color: #fff; }
.kl-btn--dark:hover { background: var(--kl-navy-deep); }
.kl-btn--secondary { background: #fff; color: var(--kl-navy); border-color: rgba(0, 74, 95, 0.3); }
.kl-btn--secondary:hover { border-color: var(--kl-navy); }
.kl-btn--ghost { background: transparent; color: var(--kl-navy); }
.kl-btn--ghost:hover { background: var(--kl-grey); }
.kl-btn--lg { min-height: 3rem; padding-inline: 1.5rem; font-size: 1rem; }

.kl-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--kl-line);
    border-radius: 999px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--kl-navy);
    text-decoration: none;
}

.kl-chip:hover { border-color: var(--kl-teal); }
.kl-chip--current { border-color: var(--kl-navy); background: var(--kl-navy); color: #fff; }

.kl-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kl-badge--new { background: var(--kl-gold); color: var(--kl-navy-deep); }
.kl-badge--offer { background: var(--kl-navy); color: var(--kl-gold); }
.kl-badge--muted { background: var(--kl-grey); color: var(--kl-muted); }

.kl-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--kl-line);
    border-radius: var(--kl-radius);
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s var(--kl-ease), box-shadow 0.2s var(--kl-ease);
}

.kl-tile:hover { border-color: var(--kl-teal); box-shadow: var(--kl-shadow); }

.kl-tile__img {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #fff;
    color: var(--kl-teal);
}

.kl-tile__img img { width: 100%; height: 100%; object-fit: contain; padding: 0.75rem; }
.kl-tile__img--photo img { object-fit: cover; padding: 0; }

.kl-tile__body {
    display: flex;
    flex: 1;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.8rem;
    border-top: 1px solid var(--kl-line);
}

.kl-tile__name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--kl-navy);
}

.kl-tile__meta {
    font-size: 0.75rem;
    color: var(--kl-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.kl-tile:hover .kl-tile__name { text-decoration: underline; }

.kl-tiles {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .kl-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
}

@media (min-width: 1024px) {
    .kl-tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .kl-tiles--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .kl-tiles--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.kl-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
}

.kl-rail > * { scroll-snap-align: start; }

@media (min-width: 1024px) {
    .kl-rail { grid-auto-columns: calc((100% - 3rem) / 4); }
}

.kl-prose { line-height: 1.65; color: var(--kl-text); }
.kl-prose p { margin: 0 0 0.8em; }
.kl-prose a { color: var(--kl-teal-dark); font-weight: 600; }
.kl-prose ul, .kl-prose ol { margin: 0 0 0.8em 1.25em; }
.kl-prose h2, .kl-prose h3 { font-family: var(--kl-font-heading); color: var(--kl-navy); margin: 1.2em 0 0.4em; }

.kl-empty {
    padding: 3rem 1.5rem;
    border-radius: var(--kl-radius);
    background: var(--kl-paper);
    text-align: center;
    color: var(--kl-muted);
}

.kl-num { font-variant-numeric: tabular-nums; }

.kl-crumbs { margin-bottom: 0.75rem; font-size: 0.8rem; color: var(--kl-muted); }
.kl-crumbs a { color: inherit; text-decoration: none; }
.kl-crumbs a:hover { color: var(--kl-navy); text-decoration: underline; }

.kl-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 2rem;
}

.kl-pagination a,
.kl-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding-inline: 0.6rem;
    border: 1px solid var(--kl-line);
    border-radius: var(--kl-radius-sm);
    font-size: 0.9rem;
    color: var(--kl-navy);
    text-decoration: none;
}

.kl-pagination [aria-current] { background: var(--kl-navy); border-color: var(--kl-navy); color: #fff; }

[data-kl-js] [data-kl-reveal] { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .kl-tile, .kl-btn { transition: none; }
}
