/* ============================================================
   Kaietur Kitchen — Cart Widget + Item Picker + Checkout
   ============================================================ */

/* Ensure hidden attribute always hides — some themes override the browser default */
#kk-picker-modal[hidden],
#kk-cart-panel[hidden],
#kk-checkout-modal[hidden],
#kk-co-layout[hidden],
#kk-co-empty-notice[hidden],
#kk-co-confirmation[hidden] {
  display: none !important;
}

:root {
  --kk-primary:   #c9a53a;   /* rich gold */
  --kk-primary-d: #a88520;   /* dark gold hover */
  --kk-accent:    #c9a53a;   /* gold accent */
  --kk-dark:      #0d0d0d;   /* near black */
  --kk-mid:       #666;
  --kk-light:     #f5f2ed;
  --kk-border:    #e0dbd4;
  --kk-white:     #ffffff;
  --kk-shadow:    0 4px 32px rgba(0,0,0,.28);
  --kk-radius:    4px;
  --kk-radius-sm: 3px;
  --kk-font:      inherit;
  --kk-z-widget:  9000;
  --kk-z-modal:   9100;
}

/* ── Cart Widget — fixed bottom-right, flex column so panel stacks above buttons ─── */

.kk-cart-widget {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: var(--kk-z-widget);
  font-family: var(--kk-font);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 240px;
  max-width: calc(100vw - 32px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hidden via class — used for home-page-pre-scroll hide */
.kk-cart-widget--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

/* Site brand gold (Astra global-color-0) */
:root {
  --kk-gold:      #c9a53a;
  --kk-gold-d:    #a88520;
  --kk-navy:      #0d0d0d;
}

/* ── Widget box — dark card container (matches old kk-order-float style) ── */
.kk-widget-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;                         /* --space-3 */
  padding: 1rem;                         /* --space-4 */
  background: #1a1a1a;                   /* --kk-dark */
  border: 1px solid rgba(201,150,42,0.2);/* --kk-border */
  border-radius: 8px;                    /* --radius-md */
  box-shadow: 0 8px 40px rgba(0,0,0,.18);/* --shadow-lg */
}

/* Pop-in animation */
@keyframes kk-btn-pop-in {
  0%   { opacity: 0; transform: translateY(20px) scale(0.9); }
  70%  { transform: translateY(-3px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Shared pill button base ─────────────────────────────────────────────── */
.kk-widget-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 2rem;                 /* --space-3 --space-8 */
  border: none;
  border-radius: 9999px;                 /* --radius-pill */
  cursor: pointer;
  font-family: var(--kk-font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  animation: kk-btn-pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.kk-widget-btn:nth-child(1) { animation-delay: 0.08s; }
.kk-widget-btn:nth-child(2) { animation-delay: 0.18s; }
.kk-widget-btn:nth-child(3) { animation-delay: 0.26s; }

/* ── Order Now — gold fill, black text, gold glow ──────────────────────── */
.kk-order-now-btn {
  background: #c9a53a;                   /* --kk-gold */
  color: #080808 !important;             /* --kk-black */
  box-shadow: 0 4px 20px rgba(201,150,42,0.35); /* --shadow-gold */
}
.kk-order-now-btn:hover {
  background: #e4af50;                   /* --kk-gold-light */
  box-shadow: 0 6px 28px rgba(201,150,42,0.5);
  transform: translateY(-2px);
}

/* ── View Order — dark fill, gold border + text ─────────────────────────── */
.kk-checkout-btn {
  background: #1a1a1a;
  color: #c9a53a !important;
  border: 2px solid #c9a53a;
  padding: calc(0.75rem - 2px) 2rem;
}
.kk-checkout-btn:hover {
  background: #c9a53a;
  color: #080808 !important;
  box-shadow: 0 4px 20px rgba(201,150,42,0.35);
  transform: translateY(-2px);
}

/* ── Our Menu — small uppercase text link with separator ────────────────── */
.kk-our-menu-btn {
  background: transparent !important;
  border: none !important;
  padding: 0.5rem 0 0 !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.1em;
  color: #ffffff !important;
  border-top: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.kk-our-menu-btn:hover {
  color: #e4af50 !important;
  transform: none;
  box-shadow: none !important;
}

/* ── Badge (item count on View Order button) ────────────────────────────── */
.kk-cart-badge[hidden] { display: none !important; }
.kk-cart-badge {
  display: inline-block;
  background: #c9a53a;
  color: #080808;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
  min-width: 18px;
  text-align: center;
  vertical-align: middle;
}

/* Cart Panel — absolutely positioned above the widget-box, anchored to right edge */

.kk-cart-panel {
  position: absolute;
  bottom: calc(100% + 10px); /* 10px above the 3-button stack */
  right: 0;
  width: 340px;
  background: var(--kk-white);
  border-radius: var(--kk-radius);
  border-top: 3px solid var(--kk-gold);
  box-shadow: var(--kk-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 60vh;
}

.kk-cart-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--kk-dark);
  color: var(--kk-white);
  border-bottom: 1px solid rgba(201,165,58,.3);
}

.kk-cart-panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.kk-cart-panel-close {
  background: none;
  border: none;
  color: var(--kk-white);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  padding: 0;
}

.kk-cart-panel-close:hover { opacity: 1; }

.kk-cart-body {
  overflow-y: auto;
  flex: 1;
  padding: 12px 0;
}

/* Empty state */
.kk-cart-empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--kk-mid);
}
.kk-cart-empty-state svg { opacity: 0.25; margin-bottom: 12px; }
.kk-cart-empty-state p   { margin: 4px 0; font-size: 14px; }

/* Cart item list */
.kk-cart-item-list {
  list-style: none;
  margin: 0;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kk-cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.kk-cart-item-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.kk-cart-item-info {
  flex: 1;
  min-width: 0;
}

.kk-cart-item-name {
  display: block;
  font-weight: 600;
  color: var(--kk-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kk-cart-item-price {
  display: block;
  color: var(--kk-mid);
  font-size: 12px;
}

.kk-cart-item-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kk-qty-btn {
  background: var(--kk-light);
  border: 1px solid var(--kk-border);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--kk-dark);
}

.kk-qty-btn:hover { background: var(--kk-border); }

.kk-qty-val {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}

.kk-remove-btn {
  background: none;
  border: none;
  color: #bbb;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

.kk-remove-btn:hover { color: #e33; }

.kk-cart-item-total {
  font-weight: 700;
  color: var(--kk-dark);
  font-size: 14px;
  flex-shrink: 0;
}

/* Cart footer */
.kk-cart-footer {
  border-top: 1px solid var(--kk-border);
  padding: 16px 20px;
  background: var(--kk-white);
}

.kk-cart-pickup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--kk-mid);
}

.kk-cart-pickup-date {
  color: var(--kk-accent);
  font-weight: 600;
}

.kk-cart-totals {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.kk-cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--kk-mid);
}

.kk-cart-grand-total {
  font-weight: 700;
  font-size: 16px;
  color: var(--kk-dark);
  padding-top: 8px;
  border-top: 1px solid var(--kk-border);
  margin-top: 4px;
}

.kk-cart-checkout-btn {
  display: block;
  width: 100%;
  padding: 13px 20px;
  background: var(--kk-primary);
  color: var(--kk-white) !important;
  text-align: center;
  border-radius: var(--kk-radius-sm);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none !important;
  transition: background 0.2s;
}

.kk-cart-checkout-btn:hover {
  background: var(--kk-primary-d);
}

/* ── Item Picker Modal ───────────────────────────────────── */

.kk-picker-modal {
  position: fixed;
  inset: 0;
  z-index: var(--kk-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.kk-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.40);
}

.kk-picker-content {
  position: relative;
  background: var(--kk-white);
  border-radius: var(--kk-radius);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--kk-shadow);
}

.kk-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--kk-dark);
  color: var(--kk-white);
  border-bottom: 2px solid var(--kk-gold);
}

.kk-picker-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.kk-picker-close {
  background: none;
  border: none;
  color: var(--kk-white);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  padding: 0;
}

.kk-picker-close:hover { opacity: 1; }

.kk-picker-search-wrap {
  padding: 14px 24px;
  border-bottom: 1px solid var(--kk-border);
}

.kk-picker-search-wrap input {
  width: 100%;
  padding: 10px 16px;
  border: 1.5px solid var(--kk-border);
  border-radius: var(--kk-radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.kk-picker-search-wrap input:focus {
  border-color: var(--kk-primary);
}

/* ── Picker: category breadcrumb bar ─────────────────────── */

.kk-picker-categories {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--kk-border);
  min-height: 46px;
  overflow-x: auto;
  scrollbar-width: none;
}

.kk-picker-categories::-webkit-scrollbar { display: none; }
.kk-picker-categories:empty { display: none; min-height: 0; padding: 0; border: none; }

.kk-cat-back {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--kk-light);
  border: 1.5px solid var(--kk-border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--kk-dark);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.kk-cat-back:hover { background: var(--kk-border); }

.kk-cat-breadcrumb {
  font-size: 14px;
  font-weight: 700;
  color: var(--kk-primary);
  white-space: nowrap;
}

/* ── Category tile grid (browse mode) ───────────────────── */

.kk-picker-grid {
  overflow-y: auto;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-auto-rows: minmax(300px, auto);
  gap: 14px;
  flex: 1;
}

/* Slim portrait tiles for category browse */
.kk-picker-grid.kk-cat-view {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: minmax(180px, auto);
  gap: 12px;
}

.kk-cat-tile {
  position: relative;
  height: 180px;
  border-radius: var(--kk-radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
  transition: transform 0.2s, box-shadow 0.2s;
  outline: none;
}

.kk-cat-tile:hover,
.kk-cat-tile:focus-visible {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  border-color: rgba(255,255,255,0.45);
}

.kk-cat-tile-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
  display: block;
  transition: transform 0.35s;
}

.kk-cat-tile:hover .kk-cat-tile-img {
  transform: scale(1.06);
}

.kk-cat-tile-placeholder {
  background: linear-gradient(135deg, #3a3a3a 0%, #222 100%);
}

/* Gradient + text overlay */
.kk-cat-tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 12px;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    rgba(20,15,10,0.55) 65%,
    rgba(15,10,5,0.82) 100%
  );
}

/* Transparent grey border frame inside each tile */
.kk-cat-tile-overlay::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 5px;
  pointer-events: none;
}

.kk-cat-tile-name {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}

.kk-cat-tile-count {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  margin-top: 3px;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ── Item cards (item view + search results) ─────────────── */

.kk-picker-item {
  border: 1.5px solid var(--kk-border);
  border-radius: var(--kk-radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--kk-white);
  transition: box-shadow 0.15s, border-color 0.15s;
  min-height: 300px;
}

.kk-picker-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  border-color: #ccc;
}

.kk-picker-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--kk-light);
  display: block;
  flex-shrink: 0;
}

.kk-picker-img-placeholder {
  width: 100%;
  height: 160px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e8e0d8 0%, #d5c9bc 100%);
}

.kk-picker-item-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.kk-picker-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--kk-dark);
}

.kk-picker-item-desc {
  font-size: 13px;
  color: var(--kk-mid);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kk-picker-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
}

.kk-picker-item-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--kk-dark);
}

.kk-picker-add-btn {
  background: var(--kk-primary);
  color: var(--kk-white);
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.kk-picker-add-btn:hover    { background: var(--kk-primary-d); }
.kk-picker-add-btn:disabled { opacity: 0.6; cursor: default; }

.kk-picker-no-results {
  padding: 40px;
  text-align: center;
  color: var(--kk-mid);
}

/* ── Picker cart bar (sticky at bottom, visible while browsing) ──────────── */

.kk-picker-cart-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--kk-dark);
  color: var(--kk-white);
  border-top: 2px solid var(--kk-primary);
  flex-shrink: 0;
}

.kk-pcb-info {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

#kk-pcb-count {
  font-size: 13px;
  color: rgba(255,255,255,0.70);
  font-weight: 500;
}

#kk-pcb-total {
  font-size: 20px;
  font-weight: 800;
  color: var(--kk-white);
}

.kk-pcb-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.kk-pcb-view-btn {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.28);
  color: var(--kk-white);
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--kk-font);
  transition: background 0.18s;
  white-space: nowrap;
}

.kk-pcb-view-btn:hover {
  background: rgba(255,255,255,0.22);
}

.kk-pcb-checkout-btn {
  background: var(--kk-primary);
  color: var(--kk-white) !important;
  border: none;
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
  font-family: var(--kk-font);
  transition: background 0.18s;
  white-space: nowrap;
}

.kk-pcb-checkout-btn:hover {
  background: var(--kk-primary-d);
}

@media (max-width: 480px) {
  .kk-picker-cart-bar { flex-wrap: wrap; }
  .kk-pcb-actions { width: 100%; justify-content: stretch; }
  .kk-pcb-view-btn, .kk-pcb-checkout-btn { flex: 1; text-align: center; }
}

/* ── Checkout Page ───────────────────────────────────────── */

.kk-checkout-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  font-family: var(--kk-font);
}

.kk-co-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 768px) {
  .kk-co-layout { grid-template-columns: 1fr; }
}

.kk-co-card {
  background: var(--kk-white);
  border: 1.5px solid var(--kk-border);
  border-radius: var(--kk-radius);
  padding: 28px;
  margin-bottom: 20px;
}

.kk-co-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--kk-dark);
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--kk-primary);
}

/* Order items */
.kk-co-item-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kk-co-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kk-co-item-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.kk-co-item-info {
  flex: 1;
}

.kk-co-item-name {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--kk-dark);
}

.kk-co-item-qty {
  display: block;
  font-size: 13px;
  color: var(--kk-mid);
}

.kk-co-item-price {
  font-weight: 700;
  font-size: 15px;
  color: var(--kk-dark);
}

/* Totals */
.kk-co-totals {
  border-top: 1px solid var(--kk-border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kk-co-totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--kk-mid);
}

.kk-co-grand-total {
  font-weight: 700;
  font-size: 18px;
  color: var(--kk-dark);
  padding-top: 10px;
  border-top: 2px solid var(--kk-border);
  margin-top: 4px;
}

/* Pickup card */
.kk-co-pickup-card { background: var(--kk-light); }

.kk-co-pickup-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.kk-co-pickup-row:last-child { margin-bottom: 0; }

.kk-co-pickup-icon {
  width: 36px;
  height: 36px;
  background: var(--kk-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--kk-primary);
}

.kk-co-pickup-row div { display: flex; flex-direction: column; gap: 2px; }
.kk-co-pickup-row strong { font-size: 13px; font-weight: 700; color: var(--kk-dark); }
.kk-co-pickup-row span  { font-size: 14px; color: var(--kk-mid); }

.kk-co-pickup-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--kk-accent);
}

/* Contact form */
.kk-co-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 500px) {
  .kk-co-field-row { grid-template-columns: 1fr; }
}

.kk-co-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.kk-co-field-row .kk-co-field { margin-bottom: 0; }

.kk-co-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--kk-dark);
}

.kk-co-required {
  color: var(--kk-primary);
}

.kk-co-field input,
.kk-co-field textarea {
  border: 1.5px solid var(--kk-border);
  border-radius: var(--kk-radius-sm);
  padding: 11px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--kk-font);
  width: 100%;
  box-sizing: border-box;
}

.kk-co-field input:focus,
.kk-co-field textarea:focus {
  border-color: var(--kk-primary);
  box-shadow: 0 0 0 3px rgba(201,165,58,.15);
}

.kk-co-field textarea { resize: vertical; min-height: 90px; }

.kk-co-policy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--kk-mid);
  background: var(--kk-light);
  border-radius: var(--kk-radius-sm);
  padding: 12px 14px;
  margin-bottom: 20px;
}

/* Messages */
.kk-co-message {
  padding: 12px 16px;
  border-radius: var(--kk-radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

.kk-co-error {
  background: #fff0ee;
  border: 1px solid #f5bfb0;
  color: #b94a37;
}

.kk-co-success {
  background: #eef9f3;
  border: 1px solid #a8d9bc;
  color: #276749;
}

/* Submit button */
.kk-co-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: var(--kk-primary);
  color: var(--kk-white);
  border: none;
  border-radius: var(--kk-radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  font-family: var(--kk-font);
}

.kk-co-submit-btn:hover:not(:disabled) {
  background: var(--kk-primary-d);
  transform: translateY(-1px);
}

.kk-co-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Spinner */
.kk-spinner {
  width: 18px;
  height: 18px;
  animation: kk-spin 0.8s linear infinite;
}

@keyframes kk-spin {
  to { transform: rotate(360deg); }
}

/* Confirmation screen */
.kk-co-confirmation {
  text-align: center;
  padding: 60px 20px;
}

.kk-co-confirm-icon {
  color: var(--kk-accent);
  margin-bottom: 16px;
}

.kk-co-confirmation h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--kk-dark);
  margin: 0 0 12px;
}

.kk-co-confirmation p {
  font-size: 16px;
  color: var(--kk-mid);
  margin: 0 0 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.kk-co-back-link {
  display: inline-block;
  padding: 12px 28px;
  background: var(--kk-primary);
  color: var(--kk-white) !important;
  border-radius: var(--kk-radius-sm);
  font-weight: 700;
  text-decoration: none !important;
  transition: background 0.2s;
}

.kk-co-back-link:hover { background: var(--kk-primary-d); }

/* Empty cart notice on checkout */
.kk-co-empty-notice {
  text-align: center;
  padding: 60px 20px;
  color: var(--kk-mid);
}

.kk-co-empty-notice a {
  color: var(--kk-primary);
  font-weight: 600;
}

/* ── SMS opt-in checkbox ──────────────────────────────────── */

.kk-co-sms-field { margin-top: 4px; }

.kk-co-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--kk-mid);
}

.kk-co-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--kk-primary);
  cursor: pointer;
}

.kk-co-checkbox-label span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.kk-co-checkbox-label svg { color: var(--kk-primary); flex-shrink: 0; }

/* ── Payment card section ─────────────────────────────────── */

.kk-co-payment-card { margin-top: 0; }

.kk-co-card-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.kk-co-card-input-wrap input {
  padding-right: 72px !important;
}

.kk-co-card-icons {
  position: absolute;
  right: 10px;
  display: flex;
  gap: 4px;
  pointer-events: none;
}

.kk-ci-visa,
.kk-ci-mc {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid var(--kk-border);
  background: var(--kk-white);
  color: var(--kk-mid);
}

.kk-ci-visa { color: #1a1f71; }
.kk-ci-mc   { color: #eb001b; }

/* Card inputs — disabled state (payment coming soon) */
.kk-co-payment-card input:disabled {
  background: #f8f8f6;
  color: #aaa;
  cursor: not-allowed;
  border-color: var(--kk-border);
}

/* Payment status notices */
.kk-co-payment-secure,
.kk-co-payment-pending {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: var(--kk-radius-sm);
}

.kk-co-payment-secure {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.kk-co-payment-pending {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* ── Stripe Elements card field ───────────────────────────── */

.kk-stripe-element-wrap {
  background: #fff;
  border: 1px solid var(--kk-border, #d1d5db);
  border-radius: var(--kk-radius-sm, 6px);
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kk-stripe-element-wrap.StripeElement--focus {
  border-color: var(--kk-gold, #C9962A);
  box-shadow: 0 0 0 2px rgba(201,150,42,0.18);
  outline: none;
}

.kk-stripe-element-wrap.StripeElement--invalid {
  border-color: #dc2626;
}

.kk-stripe-card-errors {
  color: #dc2626;
  font-size: 0.83rem;
  margin-top: 6px;
  min-height: 1.2em;
}

/* ── Checkout Modal (full-page overlay) ─────────────────── */

.kk-checkout-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--kk-z-modal) + 10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: var(--kk-font);
}

.kk-cmo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
}

.kk-cmo-content {
  position: relative;
  background: var(--kk-white);
  border-radius: var(--kk-radius);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--kk-shadow);
  display: flex;
  flex-direction: column;
}

.kk-cmo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: var(--kk-dark);
  color: var(--kk-white);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.kk-cmo-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--kk-white);
}

.kk-cmo-close {
  background: none;
  border: none;
  color: var(--kk-white);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  padding: 0;
}

.kk-cmo-close:hover { opacity: 1; }

.kk-cmo-body { padding: 28px; }

.kk-cmo-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 28px;
}

@media (max-width: 640px) {
  .kk-cmo-layout { grid-template-columns: 1fr; }
  .kk-cmo-body   { padding: 20px; }
  .kk-cmo-header { padding: 14px 20px; }
}

.kk-cmo-section-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--kk-dark);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--kk-primary);
}

.kk-cmo-item-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kk-cmo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.kk-cmo-totals {
  border-top: 1px solid var(--kk-border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.kk-cmo-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--kk-mid);
}

.kk-cmo-grand {
  font-weight: 700;
  font-size: 16px;
  color: var(--kk-dark);
  border-top: 1px solid var(--kk-border);
  padding-top: 8px;
  margin-top: 4px;
}

.kk-cmo-pickup-info {
  background: var(--kk-light);
  border-radius: var(--kk-radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--kk-mid);
}

.kk-cmo-pickup-val {
  font-weight: 600;
  color: var(--kk-accent);
  margin-left: 6px;
}

.kk-cmo-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .kk-cmo-field-row { grid-template-columns: 1fr; }
}

.kk-cmo-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.kk-cmo-field-row .kk-cmo-field { margin-bottom: 0; }

.kk-cmo-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--kk-dark);
}

.kk-req { color: var(--kk-primary); }

.kk-cmo-field input,
.kk-cmo-field textarea {
  border: 1.5px solid var(--kk-border);
  border-radius: var(--kk-radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  font-family: var(--kk-font);
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.kk-cmo-field input:focus,
.kk-cmo-field textarea:focus {
  border-color: var(--kk-primary);
  box-shadow: 0 0 0 3px rgba(201,165,58,.15);
}

.kk-cmo-field textarea { resize: vertical; min-height: 80px; }

.kk-cmo-policy {
  font-size: 12px;
  color: var(--kk-mid);
  margin-bottom: 16px;
  padding: 8px 10px;
  background: var(--kk-light);
  border-radius: 6px;
}

.kk-cmo-confirm {
  text-align: center;
  padding: 40px 20px;
}

.kk-cmo-done-btn {
  display: inline-block;
  margin-top: 16px;
  font-size: 15px;
}

/* ── Hidden View Order button when cart is empty ─────────── */

#kk-cart-toggle[hidden] { display: none !important; }
#kk-order-btn[hidden],
#kk-menu-btn[hidden]    { display: none !important; }

/* ── Kill Astra's built-in scroll-to-top pill (replaced by our cart widget) ── */
#ast-scroll-top { display: none !important; }


/* ── Add-to-cart confirm popup ─────────────────────────────── */

.kk-add-confirm {
  position: fixed;
  inset: 0;
  z-index: calc(var(--kk-z-modal) + 20);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.kk-add-confirm[hidden] { display: none !important; }

.kk-ac-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

.kk-ac-box {
  position: relative;
  background: var(--kk-white);
  border-radius: var(--kk-radius);
  border-top: 3px solid var(--kk-gold);
  padding: 28px 32px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--kk-shadow);
  text-align: center;
}

.kk-ac-msg {
  font-size: 17px;
  color: var(--kk-dark);
  margin: 0 0 22px;
  line-height: 1.4;
}

.kk-ac-actions {
  display: flex;
  gap: 12px;
}

.kk-ac-btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--kk-radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--kk-font);
  transition: background 0.18s;
}

.kk-ac-btn--yes {
  background: var(--kk-primary);
  color: var(--kk-white);
}

.kk-ac-btn--yes:hover { background: var(--kk-primary-d); }

.kk-ac-btn--no {
  background: var(--kk-light);
  color: var(--kk-dark);
  border: 1.5px solid var(--kk-border);
}

.kk-ac-btn--no:hover { background: var(--kk-border); }

/* ── Responsive tweaks ───────────────────────────────────── */


@media (max-width: 600px) {
  /* Picker: bottom sheet, not full-screen */
  .kk-picker-modal {
    padding: 0;
    align-items: flex-end;
  }
  .kk-picker-content {
    max-width: 100%;
    height: auto;
    max-height: 80vh;
    max-height: 80svh; /* svh = safe viewport height, excludes iOS browser chrome */
    border-radius: 20px 20px 0 0;
  }
  .kk-picker-search-wrap { display: none; }
  .kk-picker-header { padding: 13px 18px; }
  .kk-picker-header h3 { font-size: 16px; }
  .kk-picker-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: max-content;
    padding: 12px 14px 24px;
    gap: 10px;
    align-content: start;
    min-height: 0;                       /* lets flex child shrink so overflow-y: auto activates */
    -webkit-overflow-scrolling: touch;   /* iOS momentum scroll */
  }
  .kk-picker-grid.kk-cat-view {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(120px, auto);
    padding-bottom: 28px;
  }

  /* Reduced tile height so 3 rows + padding fit on small phones */
  .kk-picker-grid.kk-cat-view .kk-cat-tile {
    height: 120px;
  }
  .kk-picker-cart-bar { padding: 10px 16px; }
  #kk-pcb-total { font-size: 16px; }

  /* Picker item: CSS Grid stretches all cards in a row to the same height.
     flex:1 on the body fills the space; margin-top:auto on the footer pins the
     button to the bottom of every card regardless of description length. */
  .kk-picker-item {
    overflow: hidden;
  }
  .kk-picker-item-body {
    flex: 1;
  }
  /* Clamp description to 2 lines on mobile — keeps card heights predictable */
  .kk-picker-item-desc {
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
  }
  .kk-picker-img,
  .kk-picker-img-placeholder {
    height: 110px;
  }

  /* Footer: pinned to bottom, stacked vertically for easy tap */
  .kk-picker-item-footer {
    margin-top: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .kk-picker-add-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border-radius: 8px;
  }

  /* Larger touch targets for qty controls in cart panel */
  .kk-qty-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
    touch-action: manipulation;
  }
  .kk-remove-btn {
    font-size: 24px;
    padding: 0 8px;
    touch-action: manipulation;
  }

  /* Cart panel: full-width bottom sheet on mobile (overrides desktop flex layout) */
  #kk-cart-panel:not([hidden]) {
    z-index: calc(var(--kk-z-modal) + 5);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 75vh;
  }
}

/* ── Menu text-card Add button (sides / desserts / beverages) ──────────────── */

.kk-menu__text-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.kk-menu__text-card__price {
  margin: 0;
}

.kk-menu__text-card__add {
  background: var(--kk-primary);
  color: var(--kk-white);
  border: none;
  border-radius: var(--kk-radius-sm);
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.18s;
  flex-shrink: 0;
}

.kk-menu__text-card__add:hover    { background: var(--kk-primary-d); }
.kk-menu__text-card__add:disabled { opacity: 0.6; cursor: default; }

/* ── Loading placeholder ─────────────────────────────────── */

.kk-loading {
  color: var(--kk-mid);
  font-style: italic;
  padding: 8px 0;
}

/* ── Item detail popup (tap image or text in picker) ────────── */

@keyframes kk-dp-zoom-in {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

#kk-desc-popup {
  position: fixed;
  inset: 0;
  z-index: calc(var(--kk-z-modal) + 30);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#kk-desc-popup[hidden] { display: none !important; }

.kk-dp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}

.kk-dp-box {
  position: relative;
  background: var(--kk-white);
  border-radius: 12px;
  border-top: 3px solid var(--kk-gold);
  width: 100%;
  max-width: 440px;
  max-height: 82vh;
  max-height: 82svh;
  overflow-y: auto;
  box-shadow: 0 8px 48px rgba(0,0,0,.32);
  animation: kk-dp-zoom-in 0.18s ease-out both;
}

/* Image at top of popup */
.kk-dp-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 9px 9px 0 0;
  background: var(--kk-light);
  flex-shrink: 0;
}

.kk-dp-img-wrap[hidden] { display: none !important; }

.kk-dp-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Text content below image */
.kk-dp-text {
  padding: 20px 20px 28px;
}

.kk-dp-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0,0,0,.45);
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 1;
}

.kk-dp-close:hover { background: rgba(0,0,0,.7); }

/* When there's no image, move close button to standard position */
#kk-desc-popup.kk-dp--no-img .kk-dp-close {
  background: none;
  color: var(--kk-mid);
  top: 14px;
  right: 14px;
  padding: 0;
  font-size: 26px;
}

#kk-desc-popup.kk-dp--no-img .kk-dp-close:hover { color: var(--kk-dark); }

.kk-dp-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--kk-dark);
  margin: 0 0 10px;
  line-height: 1.25;
}

.kk-dp-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--kk-mid);
  margin: 0;
}
