/* Reusable components: product card, badges, price, stepper, category card, trust card, drawer, floating bar, toast, pagination. */

/* product grid & card */
.kc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.kc-card {
  background: var(--kc-surface); border: 1px solid var(--kc-line); border-radius: var(--kc-radius-lg);
  overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: transform .25s var(--kc-ease), box-shadow .25s;
}
.kc-card:hover { transform: translateY(-5px); box-shadow: var(--kc-shadow); }
.kc-card__media { aspect-ratio: 1 / .86; overflow: hidden; background: var(--kc-sun); display: block; }
.kc-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--kc-ease); }
.kc-card:hover .kc-card__media img { transform: scale(1.06); }
.kc-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.kc-card__title { font-size: 19px; }
.kc-card__title a:hover { color: var(--kc-green); }
.kc-card__meta { font-size: 13px; color: var(--kc-mute); margin-top: 2px; }
.kc-card__meta a { color: var(--kc-green); font-weight: 600; }
.kc-card__desc {
  font-size: 14px; line-height: 1.45; margin: 6px 0 12px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kc-card__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1.5px dashed var(--kc-line); padding-top: 12px; margin-top: auto; }
.kc-card .kc-wish { position: absolute; top: 12px; right: 12px; }

/* ribbon / badges */
.kc-ribbon { position: absolute; top: 14px; left: 0; z-index: 1; background: var(--kc-leaf-ink); color: #fff; font-weight: 700; font-size: 12px; padding: 3px 14px 3px 12px; border-radius: 0 999px 999px 0; }
.kc-ribbon--conventional { background: var(--kc-gold); color: var(--kc-green-deep); }
.kc-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--kc-sun); color: var(--kc-green-deep); }
.kc-badge--organic { background: #e3f3e6; color: var(--kc-green); }
.kc-badge--out { background: #fde4df; color: var(--kc-chilli); }
.kc-badge--sale { background: var(--kc-chilli); color: #fff; }

/* price */
.kc-price { font-weight: 800; color: var(--kc-green); font-size: 17px; line-height: 1.2; }
.kc-price s { color: var(--kc-mute); font-weight: 500; font-size: 13px; margin-right: 6px; }
.kc-price small { display: block; color: var(--kc-mute); font-weight: 500; font-size: 12.5px; }

/* add button + qty stepper */
.kc-add { height: 42px; padding: 0 20px; border-radius: 12px; background: var(--kc-green); color: #fff; font-weight: 700; transition: background .2s; }
.kc-add:hover { background: var(--kc-green-deep); }
.kc-add:disabled { background: var(--kc-line); color: var(--kc-mute); cursor: not-allowed; }
.kc-stepper { display: inline-flex; align-items: center; border: 2px solid var(--kc-green); border-radius: 12px; height: 42px; overflow: hidden; background: var(--kc-surface); }
.kc-stepper button { width: 36px; height: 100%; font-size: 20px; font-weight: 700; color: var(--kc-green); }
.kc-stepper button:hover { background: var(--kc-green); color: #fff; }
.kc-stepper button:disabled { opacity: .35; pointer-events: none; }
.kc-stepper output { min-width: 62px; text-align: center; font-weight: 700; font-size: 14px; }
.kc-stepper.is-busy { opacity: .6; pointer-events: none; }

/* wishlist heart */
.kc-wish { width: 38px; height: 38px; border-radius: 50%; background: var(--kc-surface); display: grid; place-items: center; box-shadow: var(--kc-shadow-sm); color: var(--kc-mute); }
.kc-wish svg { width: 18px; height: 18px; }
.kc-wish[aria-pressed="true"] { color: var(--kc-chilli); }
.kc-wish[aria-pressed="true"] svg { fill: currentColor; }

/* category card */
.kc-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kc-cat {
  background: var(--kc-surface); border: 1px solid var(--kc-line); border-radius: var(--kc-radius-lg);
  padding: 14px 14px 18px; text-align: center; font-weight: 700; font-size: 18px; color: var(--kc-green-deep);
  transition: transform .25s var(--kc-ease), box-shadow .25s, border-color .25s;
}
.kc-cat:hover { transform: translateY(-5px); box-shadow: var(--kc-shadow); border-color: var(--kc-gold); }
.kc-cat img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--kc-radius); margin-bottom: 12px; background: var(--kc-sun); }
.kc-cat small { display: block; font-weight: 500; font-size: 13.5px; color: var(--kc-mute); }

/* trust card */
.kc-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kc-trust__item { background: var(--kc-surface); border: 1px solid var(--kc-line); border-radius: 18px; padding: 18px 20px; display: flex; gap: 16px; align-items: center; box-shadow: var(--kc-shadow-sm); }
.kc-trust__item img { width: 52px; height: 52px; border-radius: 50%; background: var(--kc-sun); padding: 10px; flex: none; }
.kc-trust__item b { font-size: 17px; color: var(--kc-green-deep); display: block; line-height: 1.25; }
.kc-trust__item span { font-size: 14px; color: var(--kc-mute); line-height: 1.4; display: block; }

/* search input with icon */
.kc-search { position: relative; }
.kc-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--kc-mute); pointer-events: none; }
.kc-search .kc-input { padding-left: 42px; }

/* image + text side by side (home about/farmers, about story) */
.kc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.kc-split--reverse .kc-split__media { order: 2; }
.kc-split__media img { width: 100%; border-radius: var(--kc-radius-xl); }
.kc-split__text p { margin-bottom: 14px; }
.kc-split__text .kc-sh { margin-bottom: 18px; }
.kc-split__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.kc-center { text-align: center; margin-top: 34px; }

/* white content panel */
.kc-panel { background: var(--kc-surface); border: 1px solid var(--kc-line); border-radius: var(--kc-radius-lg); padding: 24px; box-shadow: var(--kc-shadow-sm); }

/* filter chips / tabs */
.kc-chips { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.kc-chip { height: 40px; padding: 0 18px; border: 1.5px solid var(--kc-line); background: var(--kc-surface); border-radius: 999px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; }
.kc-chip[aria-pressed="true"], .kc-chip.is-active { background: var(--kc-green); border-color: var(--kc-green); color: #fff; }

/* cart drawer */
.kc-shade { position: fixed; inset: 0; background: rgba(18, 59, 35, .55); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .25s; }
.kc-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100%); background: var(--kc-surface); z-index: 60; transform: translateX(100%); transition: transform .3s var(--kc-ease); display: flex; flex-direction: column; visibility: hidden; }
body.kc-cart-open .kc-shade { opacity: 1; pointer-events: auto; }
body.kc-cart-open .kc-drawer { transform: none; visibility: visible; }
.kc-drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; background: var(--kc-sun); }
.kc-drawer__head h2 { font-size: 24px; }
.kc-drawer__close { width: 40px; height: 40px; border-radius: 50%; background: var(--kc-surface); display: grid; place-items: center; }
.kc-drawer__list { flex: 1; overflow: auto; padding: 0 20px; }
.kc-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--kc-line); }
.kc-line img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.kc-line__name { font-weight: 700; color: var(--kc-green-deep); line-height: 1.25; }
.kc-line__sub { font-size: 13px; color: var(--kc-mute); }
.kc-line__right { display: grid; justify-items: end; gap: 6px; }
.kc-line__total { font-weight: 700; color: var(--kc-green); font-size: 14px; }
.kc-line .kc-stepper { height: 36px; }
.kc-line .kc-stepper button { width: 30px; }
.kc-line .kc-stepper output { min-width: 58px; font-size: 13px; }
.kc-line__warn { grid-column: 1 / -1; font-size: 12.5px; color: var(--kc-chilli); }
.kc-drawer__foot { padding: 18px 20px; display: grid; gap: 10px; border-top: 1px solid var(--kc-line); }
.kc-drawer__total { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; color: var(--kc-green-deep); }
.kc-drawer__foot small { color: var(--kc-mute); text-align: center; }

.kc-drawer__count { font-size: 15px; font-weight: 600; color: var(--kc-mute); }
.kc-drawer__warn { font-size: 13.5px; color: var(--kc-chilli); text-align: center; }
.kc-drawer__empty { padding: 48px 0; text-align: center; display: grid; gap: 14px; justify-items: center; color: var(--kc-mute); }
.kc-drawer__empty svg { width: 54px; height: 54px; color: var(--kc-leaf); }
.kc-drawer [data-cart-checkout][aria-disabled="true"] { opacity: .5; pointer-events: none; }
.kc-line__name a:hover { color: var(--kc-green); text-decoration: underline; }
.kc-line__remove { font-size: 12.5px; color: var(--kc-mute); text-decoration: underline; padding: 2px 0; }
.kc-line__remove:hover { color: var(--kc-chilli); }
.kc-line.is-busy { opacity: .6; }

/* floating cart bar (hidden until the cart has items) */
.kc-fab { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 160%); z-index: 40; background: var(--kc-green-deep); color: #fff; border-radius: 14px; padding: 9px 9px 9px 22px; display: flex; gap: 18px; align-items: center; font-weight: 600; transition: transform .35s var(--kc-ease), visibility .35s; box-shadow: 0 12px 28px rgba(0,0,0,.3); visibility: hidden; }
.kc-fab.is-visible { transform: translate(-50%, 0); visibility: visible; }
.kc-fab i { font-style: normal; background: var(--kc-gold); color: var(--kc-green-deep); border-radius: 10px; padding: 10px 18px; font-weight: 700; }
body.kc-cart-open .kc-fab { transform: translate(-50%, 160%); }

/* toast */
.kc-toasts { position: fixed; top: 16px; right: 16px; z-index: 80; display: grid; gap: 10px; max-width: min(360px, calc(100% - 32px)); }
.kc-toast { background: var(--kc-green-deep); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--kc-shadow); font-weight: 600; font-size: 14.5px; border-left: 5px solid var(--kc-gold); }
.kc-toast--error { border-left-color: var(--kc-chilli); }

/* pagination */
.kc-pager { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.kc-pager a, .kc-pager span { min-width: 42px; height: 42px; padding: 0 12px; display: grid; place-items: center; border-radius: 12px; border: 1.5px solid var(--kc-line); background: var(--kc-surface); font-weight: 700; }
.kc-pager a:hover { border-color: var(--kc-green); color: var(--kc-green); }
.kc-pager [aria-current="page"] { background: var(--kc-green); border-color: var(--kc-green); color: #fff; }
.kc-pager .is-disabled { opacity: .45; }

@media (max-width: 980px) {
  .kc-grid, .kc-cats { grid-template-columns: repeat(2, 1fr); }
  .kc-trust { grid-template-columns: 1fr; }
  .kc-split { grid-template-columns: 1fr; gap: 32px; }
  .kc-split--reverse .kc-split__media { order: 0; }
  .kc-split__media { max-width: 560px; }
}
@media (max-width: 560px) {
  .kc-grid, .kc-cats { gap: 12px; }
  .kc-card__body { padding: 12px; }
  .kc-card__title { font-size: 16px; }
  .kc-card__desc { display: none; }
  .kc-card__foot { flex-direction: column; align-items: stretch; }
  .kc-add, .kc-card .kc-stepper { width: 100%; justify-content: space-between; }
  .kc-card .kc-stepper output { flex: 1; }
  .kc-fab { width: calc(100% - 32px); justify-content: space-between; }
}
