/* =====================================================================
   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: 1100px; margin: 0 auto; padding: 24px 20px 60px; }

/* ---------- 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; }
.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); }

/* ---------- 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;
  background: #FFFBF7;
  border: 1px solid #F3E8DA;
  border-radius: 20px;
  padding: 36px 40px;
  margin-bottom: 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;
  }
}


