/* =====================================================================
   Bakery POS — Katalog (public storefront) styles
   Reuses the CSS variables defined in app.css so this reads as the same
   design system as the staff side, just without the sidebar shell.
   ===================================================================== */

.klg-body { background: var(--bg); }

.klg-header {
  position: sticky; top: 0; z-index: 100; min-height: 66px;
  background: #fff; color: var(--navy); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px; flex-wrap: wrap;
}
.klg-brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 800; flex-shrink: 0; }
.klg-brand__logo-link { display: inline-flex; align-items: center; text-decoration: none; transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out); cursor: pointer; }
.klg-brand__logo-link:hover { transform: scale(1.08); opacity: 0.9; }
.klg-brand__logo-link:active { transform: scale(0.95); }
.klg-brand__name-link { color: var(--navy); text-decoration: none; font-weight: 800; font-size: 15px; transition: color var(--dur-fast) var(--ease-out); cursor: pointer; display: inline-flex; align-items: center; }
.klg-brand__name-link:hover { color: var(--teal); }
.klg-brand__logo { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.klg-brand__logo--fallback { background: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 16px; }

.klg-header__search { position: relative; flex: 1 1 380px; max-width: 560px; }
.klg-header__search input {
  width: 100%; padding: 10px 50px 10px 16px; border-radius: 24px; border: 1px solid var(--border);
  font-size: 13px; font-family: inherit; background: var(--bg); color: var(--navy);
}
.klg-header__search input:focus { outline: none; border-color: var(--teal); background: #fff; }
.klg-header__search button {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; background: var(--teal); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.klg-header__search button:hover { background: var(--teal-600); }

.klg-header__actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.klg-cart-btn { display: flex; align-items: center; gap: 8px; color: var(--navy); background: none; padding: 4px; border: none; cursor: pointer; font-family: inherit; }
.klg-cart-btn__icon { position: relative; display: flex; color: var(--slate); }
.klg-cart-btn__label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3; }
.klg-cart-btn__title { font-size: 10px; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: .4px; }
.klg-cart-btn__subtotal { font-size: 13px; font-weight: 800; color: var(--navy); }
.klg-cart-badge { position: absolute; top: -8px; right: -10px; background: var(--teal); color: #fff; font-size: 10px; font-weight: 800; border-radius: 10px; padding: 2px 6px; line-height: 1; }
.klg-staff-link { display: flex; align-items: center; color: var(--slate); text-decoration: none; white-space: nowrap; padding: 6px; border-radius: 8px; }
.klg-staff-link:hover { color: var(--navy); background: var(--border-soft); }

@media (max-width: 640px) {
  .klg-cart-btn__label { display: none; }
}

.klg-main { max-width: 1440px; margin: 0 auto; padding: 24px 20px 60px; }
@media (min-width: 1024px) {
  .klg-main { padding-left: 32px; padding-right: 32px; }
}

/* ---------- Hero / category chips ---------- */
.klg-hero { text-align: center; margin-bottom: 20px; }
.klg-hero h1 { font-size: 22px; margin-bottom: 6px; }
.klg-search { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.klg-search .input { flex: 1; min-width: 180px; }

/* ---------- Landing (branch picker) hero ---------- */
.klg-landing-hero {
  display: flex; align-items: center; gap: 36px; background: var(--teal-tint);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 36px;
  overflow: hidden; position: relative;
}
.klg-landing-hero__decor {
  position: absolute; top: 0; left: 0; width: 0; height: 0;
  border-style: solid; border-width: 70px 70px 0 0; border-color: var(--teal) transparent transparent transparent;
}
.klg-landing-hero__text { flex: 1 1 320px; text-align: left; }
.klg-landing-hero__text h1 { font-size: 30px; line-height: 1.25; }
.klg-landing-hero__text h1 .accent { color: var(--teal); }
.klg-landing-hero__stats { display: flex; gap: 28px; padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--border); }
.klg-landing-hero__stats b { display: block; font-size: 20px; color: var(--navy); }
.klg-landing-hero__stats span { font-size: 11px; color: var(--slate); text-transform: uppercase; letter-spacing: .3px; }
.klg-landing-hero__art { flex: 1 1 260px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.klg-landing-hero__card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 20px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 96px;
}
.klg-landing-hero__card .emoji { font-size: 32px; }
.klg-landing-hero__card span:last-child { font-size: 12px; font-weight: 700; color: var(--navy); }
@media (max-width: 720px) {
  .klg-landing-hero { flex-direction: column; text-align: center; padding: 24px; }
  .klg-landing-hero__text { text-align: center; }
  .klg-landing-hero__stats { justify-content: center; }
}

/* ---------- Product grid ---------- */
.klg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
/* Tablet tiers: explicit column counts so the grid feels intentional at in-between
   widths instead of whatever auto-fill happens to compute from a narrower container. */
@media (min-width: 481px) and (max-width: 767px) {
  .klg-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .klg-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}
@media (min-width: 1024px) {
  .klg-grid { gap: 20px; }
}
.klg-product { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.klg-product__quickadd {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
}
.klg-product__quickadd.is-disabled { cursor: not-allowed; opacity: .6; }
.klg-product__photo { aspect-ratio: 4/3; border-radius: var(--radius) var(--radius) 0 0; background: var(--border-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.klg-product__photo img { width: 100%; height: 100%; object-fit: cover; }
.klg-product__body { padding: 12px; }
.klg-product__name { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.klg-price-original { text-decoration: line-through; color: var(--slate-400); font-size: 11px; margin-right: 6px; }
.klg-empty { text-align: center; padding: 60px 0; color: var(--slate); }

/* ---------- AJAX results: skeleton loader & transitions ---------- */
.klg-results.is-loading { pointer-events: none; }
.klg-fade-in { animation: klgFadeIn .26s ease-out; }
@keyframes klgFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.klg-skel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.klg-skel-photo { aspect-ratio: 4/3; background: var(--border-soft); }
.klg-skel-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.klg-skel-line { height: 10px; border-radius: 6px; background: var(--border-soft); }
.klg-skel-btn { height: 30px !important; border-radius: 8px; margin-top: 4px; }

.klg-shimmer {
  position: relative;
  overflow: hidden;
  background: var(--border-soft);
}
.klg-shimmer::after {
  content: '';
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--teal-tint) 45%, rgba(255,255,255,.9) 50%, var(--teal-tint) 55%, transparent);
  animation: klgShimmer 1.3s ease-in-out infinite;
}
@keyframes klgShimmer { 100% { transform: translateX(100%); } }

/* Top loading bar (theme gold), appended to <body> by the AJAX catalog script */
#klgTopProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--teal-600));
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--teal) 60%, transparent);
  z-index: 99999; opacity: 0; transition: width .25s ease-out, opacity .2s ease-out;
}
#klgTopProgress.is-loading { opacity: 1; width: 78%; transition: width 8s cubic-bezier(.1,.6,.2,1), opacity .2s ease-out; }
#klgTopProgress.is-done { opacity: 0; width: 100%; transition: width .2s ease-out, opacity .3s ease-out .1s; }

@media (prefers-reduced-motion: reduce) {
  .klg-shimmer::after { animation: none; }
  .klg-fade-in { animation: none; }
}

/* ---------- Section headings (Produk Terlaris / Semua Produk) ---------- */
.klg-section-head { margin: 32px 0 16px; }
.klg-section-head:first-of-type { margin-top: 8px; }
.klg-section-head__title { font-size: 18px; font-weight: 800; color: var(--navy); }
.klg-section-head__title .accent { color: var(--teal); }
.klg-section-head p { margin-top: 2px; font-size: 12px; }

/* ---------- Best-seller ribbon ---------- */
.klg-bestseller { position: relative; }
.klg-bestseller-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: #DC2626; color: #fff; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 6px; line-height: 1.4;
}

/* ---------- Floating cart bar ---------- */
.klg-cartbar {
  position: fixed; bottom: 16px; left: 50%; width: calc(100% - 32px); max-width: 480px; background: var(--teal); color: #fff;
  border: none; border-radius: 12px; padding: 14px 16px; align-items: center; justify-content: space-between;
  box-shadow: 0 8px 20px rgba(13,148,136,.35); cursor: pointer; text-decoration: none; z-index: 50;
  font-family: inherit; font-size: 14px; text-align: left;
  animation: klgCartbarIn var(--dur-slow) var(--ease-spring) both;
}
@keyframes klgCartbarIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.klg-cartbar:active { transform: translate(-50%, 0) scale(.98); }

/* ---------- Selectable option cards (checkout: metode pengambilan, ongkir) ---------- */
.klg-option-cards { display: flex; flex-direction: column; gap: 8px; }
.klg-option-card {
  display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.klg-option-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.klg-option-card__check {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; margin-top: 1px;
}
.klg-option-card.is-active { border-color: var(--teal); background: var(--teal-tint); }
.klg-option-card.is-active .klg-option-card__check { border-color: var(--teal); background: var(--teal); box-shadow: inset 0 0 0 3px #fff; }
.klg-option-card__title { font-size: 13px; font-weight: 700; color: var(--navy); }
.klg-option-card__sub { font-size: 12px; color: var(--slate); margin-top: 2px; }

/* ---------- Detail ---------- */
.klg-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 720px) { .klg-detail { grid-template-columns: 1fr; } }
.klg-detail__photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 1/1; background: var(--border-soft); }
.klg-detail__photo img { width: 100%; height: 100%; object-fit: cover; }
.klg-stepper { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.klg-stepper button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-weight: 800; cursor: pointer; }
.klg-stepper input { width: 50px; text-align: center; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }

/* ---------- Cart ---------- */
.klg-cart-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.klg-cart-line__photo { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--border-soft); flex-shrink: 0; }
.klg-cart-line__info { flex: 1; }
.klg-qty-mini { display: flex; align-items: center; gap: 6px; }
.klg-qty-mini button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 700; }

/* ---------- Cart drawer — slides in from the right instead of navigating away ---------- */
.klg-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 150;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--dur-base) var(--ease-out);
}
.klg-drawer-backdrop.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.klg-cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw; background: #fff;
  z-index: 160; box-shadow: -8px 0 32px rgba(0,0,0,.15); transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out); display: flex; flex-direction: column;
}
.klg-cart-drawer.is-open { transform: translateX(0); }
.klg-cart-drawer__head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.klg-cart-drawer__head h3 { font-size: 16px; font-weight: 800; margin: 0; }
.klg-cart-drawer__count { background: var(--border-soft); color: var(--navy); font-weight: 700; font-size: 12px; border-radius: 12px; padding: 2px 9px; }
.klg-cart-drawer__close { margin-left: auto; background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--slate); padding: 4px; }
.klg-cart-drawer__close:hover { color: var(--navy); }
.klg-cart-drawer__body { flex: 1; overflow-y: auto; padding: 6px 20px; }
.klg-cart-drawer__body .klg-cart-line:last-child { border-bottom: none; }
.klg-cart-drawer__footer { border-top: 1px solid var(--border); padding: 16px 20px 20px; }

/* ---------- Timeline (order status) ---------- */
.klg-timeline { display: flex; flex-direction: column; gap: 0; }
.klg-timeline__step { display: flex; gap: 12px; position: relative; padding-bottom: 26px; }
.klg-timeline__step:last-child { padding-bottom: 0; }
.klg-timeline__dot { width: 22px; height: 22px; border-radius: 50%; background: var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; }
.klg-timeline__step.is-done .klg-timeline__dot { background: var(--teal); }
.klg-timeline__step.is-current .klg-timeline__dot { background: var(--navy); }
.klg-timeline__line { position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.klg-timeline__step.is-done .klg-timeline__line { background: var(--teal); }
.klg-timeline__label { font-weight: 700; font-size: 13px; }

/* ---------- Upload dropzone ---------- */
.klg-dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; cursor: pointer; background: #fff; }
.klg-dropzone input { display: none; }
.klg-dropzone__preview { max-width: 100%; max-height: 220px; border-radius: 8px; margin-top: 10px; }

/* ---------- Centered Checkout Container & Popups ---------- */
.klg-checkout-container {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}
.klg-checkout-container .card {
  margin-left: auto;
  margin-right: auto;
}
.klg-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  backdrop-filter: blur(3px);
}
.klg-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  text-align: center;
}
.klg-modal__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy, #16233F);
  margin-bottom: 8px;
}

@media (max-width: 480px) {
  .klg-main { padding: 16px 12px 40px; }
  .klg-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ---------- Catalog Hero Banner (Modern Sumba Cake & Bakery Theme) ---------- */
/* ---------- Catalog Hero Banner (Modern Sumba Cake & Bakery Theme) ---------- */
.klg-catalog-hero {
  position: relative;
  max-width: 1200px;
  background: #FFFBF7;
  border: 1px solid #F3E8DA;
  border-radius: 20px;
  padding: 36px 40px;
  margin: 0 auto 32px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}
.klg-catalog-hero__decor-tl {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 85px 85px 0 0;
  border-color: #C58B2B transparent transparent transparent;
  pointer-events: none;
}
.klg-catalog-hero__decor-br {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 85px 85px;
  border-color: transparent transparent #C58B2B transparent;
  pointer-events: none;
}
.klg-catalog-hero__content {
  flex: 1 1 420px;
  z-index: 2;
}
.klg-catalog-hero__title {
  font-size: 32px;
  font-weight: 800;
  color: #2B1810;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.klg-catalog-hero__accent {
  color: #C58B2B;
  display: block;
}
.klg-catalog-hero__desc {
  font-size: 14px;
  color: #6E5F55;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 460px;
}
.klg-catalog-hero__buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.klg-catalog-hero__btn-primary {
  background: #C58B2B;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(197, 139, 43, 0.3);
  transition: all 0.2s ease;
}
.klg-catalog-hero__btn-primary:hover {
  background: #A3701E;
  transform: translateY(-1px);
}
.klg-catalog-hero__btn-dark {
  background: #2B1810;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.klg-catalog-hero__btn-dark:hover {
  background: #1B0E09;
  transform: translateY(-1px);
}
.klg-catalog-hero__stats {
  display: flex;
  gap: 32px;
  padding-top: 20px;
  border-top: 1px solid #E8DFD5;
}
.klg-catalog-hero__stat-num {
  font-size: 22px;
  font-weight: 800;
  color: #2B1810;
  line-height: 1.2;
}
.klg-catalog-hero__stat-label {
  font-size: 10px;
  font-weight: 800;
  color: #8C7A6B;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Right side graphic card */
.klg-catalog-hero__graphic {
  flex: 0 1 420px;
  z-index: 2;
}
.klg-catalog-hero__card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(43, 24, 16, 0.08);
  border: 1px solid #F3E8DA;
}
.klg-catalog-hero__badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.klg-catalog-hero__badge {
  background: #FFFBF7;
  border: 1px solid #F3E8DA;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}
.klg-catalog-hero__badge-icon {
  font-size: 24px;
  margin-bottom: 4px;
}
.klg-catalog-hero__badge-title {
  font-size: 11px;
  font-weight: 800;
  color: #2B1810;
}
.klg-catalog-hero__badge-sub {
  font-size: 9px;
  color: #8C7A6B;
  margin-top: 2px;
}
.klg-catalog-hero__img-box {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #FFFBF7;
  border: 1px solid #F3E8DA;
}
.klg-catalog-hero__img-box img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  display: block;
}

@media (max-width: 900px) {
  .klg-catalog-hero {
    flex-direction: column;
    padding: 24px;
    gap: 24px;
  }
  .klg-catalog-hero__content, .klg-catalog-hero__graphic {
    flex: 1 1 100%;
    width: 100%;
  }
  .klg-catalog-hero__stats {
    justify-content: flex-start;
  }
}



/* ---------- Storefront catalogue redesign ---------- */
.klg-main { max-width: 1440px; }
.klg-catalog-hero {
  max-width: none;
  margin: 0 0 36px;
  padding: clamp(24px, 4vw, 52px);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  align-items: stretch;
  gap: clamp(28px, 5vw, 72px);
}
.klg-catalog-hero__decor-tl, .klg-catalog-hero__decor-br { display: none; }
.klg-catalog-hero__content { display: flex; flex-direction: column; justify-content: center; }
.klg-catalog-hero__eyebrow, .klg-catalog-hero__guide-kicker {
  margin: 0 0 10px; color: var(--teal-600); font-size: 12px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.klg-catalog-hero__title { color: var(--navy); font-size: clamp(30px, 3.4vw, 48px); max-width: 15ch; margin: 0 0 14px; }
.klg-catalog-hero__accent { display: none; }
.klg-catalog-hero__desc { max-width: 53ch; margin-bottom: 26px; color: var(--slate); font-size: 15px; }
.klg-catalog-hero__buttons { margin-bottom: 30px; }
.klg-catalog-hero__btn-primary, .klg-catalog-hero__btn-dark {
  min-height: 44px; padding: 11px 18px; border-radius: var(--radius-sm); box-shadow: none;
}
/* White text is only placed on navy; the gold token remains an accent to keep AA text contrast. */
.klg-catalog-hero__btn-primary { background: var(--navy); }
.klg-catalog-hero__btn-primary:hover { background: var(--navy-700); }
.klg-catalog-hero__btn-dark { background: var(--surface); color: var(--navy) !important; border: 1px solid var(--border); }
.klg-catalog-hero__btn-dark:hover { background: var(--border-soft); }
.klg-catalog-hero__stats { gap: 0; padding-top: 18px; border-color: var(--border); }
.klg-catalog-hero__stats > div { min-width: 128px; padding-right: 24px; }
.klg-catalog-hero__stats > div + div { padding-left: 24px; border-left: 1px solid var(--border); }
.klg-catalog-hero__stat-label { color: var(--slate); font-size: 11px; letter-spacing: .06em; order: 0; }
.klg-catalog-hero__stat-num { color: var(--navy); font-size: 26px; margin: 2px 0 0; }
.klg-catalog-hero__guide {
  flex: 0 1 410px; background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 24px;
}
.klg-catalog-hero__guide h2 { font-size: 20px; line-height: 1.3; margin: 0 0 20px; }
.klg-catalog-hero__steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.klg-catalog-hero__steps li { display: flex; gap: 12px; align-items: flex-start; }
.klg-icon-wrap { width: 40px; height: 40px; display: inline-flex; flex: 0 0 40px; align-items: center; justify-content: center; color: var(--teal-600); background: var(--teal-tint); border-radius: var(--radius-sm); }
.klg-icon-wrap svg { width: 20px; height: 20px; }
.klg-catalog-hero__steps strong { display: block; color: var(--navy); font-size: 14px; }
.klg-catalog-hero__steps small { display: block; color: var(--slate); font-size: 12px; line-height: 1.45; margin-top: 2px; }

/* ---------- Branch picker: same storefront system as the selected catalog ---------- */
.klg-branch-hero { margin-bottom: 38px; }
.klg-branch-section { scroll-margin-top: 92px; }
.klg-branch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.klg-branch-card {
  min-height: 126px; display: flex; align-items: center; gap: 14px; padding: 20px;
  color: var(--navy); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.klg-branch-card:hover { color: var(--navy); border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.klg-branch-card:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.klg-branch-card__icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; color: var(--teal-600); background: var(--teal-tint); border-radius: var(--radius-sm); }
.klg-branch-card__icon svg { width: 22px; height: 22px; }
.klg-branch-card__content { display: grid; gap: 5px; min-width: 0; flex: 1; }
.klg-branch-card__content strong { font-size: 15px; line-height: 1.3; }
.klg-branch-card__content small { color: var(--slate); font-size: 12px; line-height: 1.45; }
.klg-branch-card__arrow { color: var(--teal-600); font-size: 28px; font-weight: 400; line-height: 1; }

.klg-section-head { margin: 38px 0 14px; }
.klg-section-head__title { display: flex; align-items: center; gap: 9px; font-size: 20px; }
.klg-section-head__title svg { width: 20px; height: 20px; color: var(--teal-600); }
.klg-featured { margin-bottom: 38px; }
.klg-catalog-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.klg-category-sidebar { position: sticky; top: 90px; padding: 18px 0; border-top: 2px solid var(--teal); }
.klg-category-sidebar__label { margin: 0 0 10px; color: var(--slate); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.klg-category-sidebar__nav { display: grid; gap: 2px; }
.klg-category-sidebar__nav a { min-height: 44px; display: flex; align-items: center; padding: 8px 12px; color: var(--navy); border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; }
.klg-category-sidebar__nav a:hover { background: var(--border-soft); }
.klg-category-sidebar__nav a.is-active { color: var(--surface); background: var(--navy); }
.klg-category-chips { display: none; }
.klg-product-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.klg-product-toolbar p { color: var(--slate); font-size: 13px; margin: 0; }
.klg-product-toolbar p strong { color: var(--navy); }
.klg-product-toolbar .klg-search { margin: 0; }
.klg-product-toolbar .select { min-height: 44px; min-width: 180px; }
.klg-pagination { margin-top: 24px; }

.klg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.klg-product { min-width: 0; overflow: hidden; transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.klg-product:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.klg-product__quickadd:focus-visible, .klg-product__body a:focus-visible, .klg-category-sidebar__nav a:focus-visible, .chip:focus-visible, .klg-catalog-hero a:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.klg-product__photo { aspect-ratio: 1 / .78; background: var(--border-soft); }
.klg-product__body { padding: 13px; }
.klg-product__name { min-height: 34px; color: var(--navy); font-size: 14px; line-height: 1.25; margin-bottom: 7px; }
.klg-product__stock, .klg-product__category { margin-top: 5px; }
.klg-product__category { text-transform: uppercase; font-weight: 800; letter-spacing: .04em; }
.klg-product__fallback { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: var(--navy); background: linear-gradient(135deg, var(--teal-tint), var(--border-soft)); }
.klg-product__fallback-mark { width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--teal); border-radius: 50%; background: var(--surface); color: var(--navy); font-size: 23px; font-weight: 800; }
.klg-product__fallback-label { max-width: 85%; color: var(--slate); font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.klg-bestseller-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--navy); color: var(--surface); padding: 5px 8px; }
.klg-bestseller-badge svg { width: 12px; height: 12px; color: var(--teal); }

@media (min-width: 768px) and (max-width: 1023px) {
  .klg-catalog-layout { display: block; }
  .klg-category-sidebar { display: none; }
  .klg-category-chips { display: flex; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; margin: 0 0 18px; }
  .klg-category-chips .chip { min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
  .klg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1024px) and (max-width: 1279px) { .klg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1280px) { .klg-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; } .klg-grid--featured { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1040px; } }
@media (max-width: 1023px) { .klg-catalog-hero { flex-direction: column; } .klg-catalog-hero__guide { width: 100%; flex-basis: auto; } }
@media (max-width: 767px) {
  .klg-main { padding: 16px 12px 76px; }
  .klg-catalog-hero { padding: 24px 20px; margin-bottom: 28px; }
  .klg-catalog-hero__title { max-width: none; font-size: 30px; }
  .klg-catalog-hero__buttons { display: grid; grid-template-columns: 1fr; }
  .klg-catalog-hero__buttons a { justify-content: center; }
  .klg-catalog-hero__stats > div { min-width: 0; flex: 1; padding-right: 12px; }
  .klg-catalog-hero__stats > div + div { padding-left: 12px; }
  .klg-catalog-hero__guide { padding: 20px; }
  .klg-catalog-layout { display: block; }
  .klg-branch-grid { grid-template-columns: 1fr; gap: 12px; }
  .klg-branch-card { min-height: 96px; padding: 16px; }
  .klg-category-sidebar { display: none; }
  .klg-category-chips { display: flex; overflow-x: auto; flex-wrap: nowrap; margin: 0 0 16px; padding-bottom: 4px; }
  .klg-category-chips .chip { min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
  .klg-product-toolbar { align-items: stretch; flex-direction: column; }
  .klg-product-toolbar .select { width: 100%; }
}
@media (max-width: 480px) { .klg-grid { gap: 10px; } .klg-product__body { padding: 10px; } .klg-product__name { font-size: 13px; } .klg-catalog-hero__guide h2 { font-size: 18px; } }

/* Final accessibility and touch-target guardrails for storefront controls. */
.klg-body { overflow-x: hidden; }
.klg-header__search input { min-height: 44px; padding-right: 58px; }
.klg-header__search button { width: 44px; height: 44px; right: 0; }
.klg-cart-btn, .klg-staff-link { min-width: 44px; min-height: 44px; justify-content: center; }
.klg-product__body .btn { min-height: 44px; }
.klg-cartbar { min-height: 44px; }
.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; }
.klg-catalog-hero__eyebrow, .klg-catalog-hero__guide-kicker { color: var(--navy); }
.klg-product .price { color: var(--navy); }
/* Keep text-bearing controls at AA contrast; gold remains a brand accent, not a text background. */
.klg-header__search button, .klg-cartbar, .klg-product__body .btn--primary, .klg-cart-badge { background: var(--navy); }
.klg-header__search button:hover, .klg-product__body .btn--primary:hover:not(:disabled) { background: var(--navy-700); }
.klg-product__quickadd:focus-visible, .klg-product__body a:focus-visible, .klg-category-sidebar__nav a:focus-visible, .chip:focus-visible, .klg-catalog-hero a:focus-visible { outline-color: var(--navy); }
.klg-product__fallback-mark { border-color: var(--navy); }
