/* ================================================================
   KateKarl Ajax Cart  —  Drawer Styles
   Reference: Shopping Bag design — clean serif, minimal, gold accent
   ================================================================ */

:root {
  --kkc-black:  #1a1a1a;
  --kkc-white:  #ffffff;
  --kkc-bg:     #faf9f7;
  --kkc-gold:   #c8a96e;
  --kkc-g5:     #555555;
  --kkc-g8:     #888888;
  --kkc-ga:     #aaaaaa;
  --kkc-ge:     #e5e5e5;
  --kkc-ok:     #27ae60;
  --kkc-err:    #c0392b;
  --kkc-w:      480px;
  --kkc-ease:   cubic-bezier(.4, 0, .2, 1);
  --kkc-t:      .3s;
  --kkc-dark:   #3a3a2e;
}

.kkc-drawer *, .kkc-drawer *::before, .kkc-drawer *::after { box-sizing: border-box; }

/* ── Overlay ───────────────────────────────────────────────────── */
.kkc-overlay {
  position: fixed; inset: 0; z-index: 99994;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--kkc-t) var(--kkc-ease);
}
.kkc-overlay.is-open { opacity: 1; pointer-events: auto; }

/* ── Drawer ────────────────────────────────────────────────────── */
.kkc-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 99995;
  width: min(var(--kkc-w), 100vw);
  background: var(--kkc-bg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--kkc-t) var(--kkc-ease);
}
.kkc-drawer.is-open {
  transform: translateX(0);
  box-shadow: -4px 0 40px rgba(0, 0, 0, .1);
}

/* ── Header ────────────────────────────────────────────────────── */
.kkc-head {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 20px;
  background: var(--kkc-white);
}
.kkc-title {
  font-size: 20px; font-weight: 400; letter-spacing: .01em;
  color: var(--kkc-black); margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
}
.kkc-close {
  width: 32px; height: 32px; padding: 0;
  background: none !important; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--kkc-g8); transition: color .2s;
}
.kkc-close:hover { color: var(--kkc-black); }
.kkc-close svg { width: 20px; height: 20px; }

/* ── Body ──────────────────────────────────────────────────────── */
.kkc-body {
  flex: 1; overflow-y: auto; background: var(--kkc-white);
  scrollbar-width: thin; scrollbar-color: var(--kkc-ge) transparent;
}
.kkc-body::-webkit-scrollbar { width: 3px; }
.kkc-body::-webkit-scrollbar-thumb { background: var(--kkc-ge); }

/* ── Toast ─────────────────────────────────────────────────────── */
.kkc-toast {
  margin: 0 28px 12px; padding: 10px 14px;
  font-size: 13px; border: 1px solid transparent; line-height: 1.5;
}
.kkc-toast.ok  { background: #f4fff8; border-color: #c3e6cb; color: var(--kkc-ok); }
.kkc-toast.err { background: #fff5f5; border-color: #f5c6cb; color: var(--kkc-err); }

/* ── Delivery notice ───────────────────────────────────────────── */
.kkc-delivery-notice {
  padding: 10px 28px 12px;
  border-bottom: 1px solid var(--kkc-ge);
  background: var(--kkc-white);
}
.kkc-delivery-notice:empty { display: none; }
.kkc-delivery-notice__text {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--kkc-g5); letter-spacing: .01em;
}
.kkc-delivery-notice__text svg { width: 14px; height: 14px; color: var(--kkc-gold); flex-shrink: 0; }

/* ── Items list ────────────────────────────────────────────────── */
.kkc-list { padding: 0 28px; }

/* ── Item ──────────────────────────────────────────────────────── */
.kkc-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--kkc-ge);
  animation: kkc-in .22s var(--kkc-ease);
}
.kkc-item:last-child { border-bottom: none; }
@keyframes kkc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Product image with border radius */
.kkc-item-img {
  flex-shrink: 0; width: 96px; height: 96px;
  display: block; overflow: hidden;
  background: var(--kkc-bg);
  border-radius: 8px;
}
.kkc-item-img img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 8px;
  transition: transform .35s var(--kkc-ease);
}
.kkc-item-img:hover img { transform: scale(1.04); }

/* Info */
.kkc-item-info { flex: 1; min-width: 0; padding-top: 2px; }

.kkc-item-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px;
  margin-bottom: 4px;
}
.kkc-item-name {
  font-size: 13.5px; font-weight: 500; color: var(--kkc-black);
  text-decoration: none; line-height: 1.4; flex: 1;
  transition: color .2s;
}
.kkc-item-name:hover { color: var(--kkc-gold); }

.kkc-item-variation {
  font-size: 12px; color: var(--kkc-g8);
  margin-bottom: 10px; letter-spacing: .01em;
}

.kkc-item-bottom {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
  margin-top: 8px;
}
.kkc-item-price { font-size: 14px; color: var(--kkc-black); font-weight: 400; }

/* Remove button (bin) */
.kkc-remove-btn {
  flex-shrink: 0; width: 26px; height: 26px; padding: 0;
  background: none !important; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--kkc-ga); transition: color .2s; margin-top: 1px;
}
.kkc-remove-btn:hover { color: var(--kkc-black); }
.kkc-remove-btn svg { width: 14px; height: 14px; }

/* Quantity controls */
.kkc-qty-wrap {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--kkc-ge); height: 32px;
}
.kkc-qty-btn {
  width: 30px; height: 30px; padding: 0;
  background: none !important; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--kkc-g8); line-height: 1;
  transition: color .2s, background .2s;
}
.kkc-qty-btn:hover { color: var(--kkc-black); background: var(--kkc-ge) !important; }
.kkc-qty-num {
  min-width: 28px; text-align: center;
  font-size: 13px; font-weight: 500; color: var(--kkc-black);
  border-left: 1px solid var(--kkc-ge); border-right: 1px solid var(--kkc-ge);
  line-height: 30px;
}

/* ── Empty state ───────────────────────────────────────────────── */
.kkc-empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 64px 28px 48px;
}
.kkc-empty svg   { width: 48px; height: 48px; margin-bottom: 20px; color: var(--kkc-ge); }
.kkc-empty p     { font-size: 15px; font-weight: 500; color: var(--kkc-black); margin: 0 0 8px; }
.kkc-empty span  { font-size: 13px; color: var(--kkc-g8); line-height: 1.6; }

/* ── Coupon section ────────────────────────────────────────────── */
.kkc-coupon-wrap {
  border-top: 1px solid var(--kkc-ge);
  padding: 0 28px;
}
.kkc-coupon-toggle {
  width: 100%; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; font-family: inherit;
  font-size: 13px; font-weight: 500; color: var(--kkc-black);
  letter-spacing: .01em; text-align: left;
  transition: color .2s;
}
.kkc-coupon-toggle:hover { color: var(--kkc-gold); }
.kkc-chevron {
  width: 16px; height: 16px; flex-shrink: 0; color: var(--kkc-g8);
  transition: transform .25s var(--kkc-ease);
}
.kkc-coupon-toggle.is-open .kkc-chevron { transform: rotate(180deg); }

.kkc-coupon-body { padding-bottom: 16px; }

.kkc-coupon-label {
  display: block; font-size: 12px; color: var(--kkc-g8);
  letter-spacing: .04em; margin-bottom: 6px;
}
.kkc-coupon-row {
  display: flex; gap: 0; border: 1px solid var(--kkc-ge);
  background: var(--kkc-white);
}
.kkc-coupon-input {
  flex: 1; height: 44px; padding: 0 12px;
  border: none; background: transparent; font-family: inherit;
  font-size: 13.5px; color: var(--kkc-black); outline: none;
}
.kkc-coupon-apply {
  height: 44px; padding: 0 20px;
  background: none; border: none; border-left: 1px solid var(--kkc-ge);
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--kkc-black); cursor: pointer; letter-spacing: .04em;
  transition: background .2s, color .2s;
}
.kkc-coupon-apply:hover { background: var(--kkc-black); color: var(--kkc-white); }
.kkc-coupon-err {
  display: block; margin-top: 6px; font-size: 12px; color: var(--kkc-err);
}
.kkc-applied-coupons { display: flex; flex-direction: column; gap: 8px; }
.kkc-applied-coupon {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--kkc-bg); border: 1px solid var(--kkc-ge);
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em; color: var(--kkc-black);
}
.kkc-remove-coupon {
  background: none; border: none; cursor: pointer; font-size: 18px;
  color: var(--kkc-ga); line-height: 1; padding: 0 4px;
  transition: color .2s;
}
.kkc-remove-coupon:hover { color: var(--kkc-err); }

/* ── Footer ────────────────────────────────────────────────────── */
.kkc-foot {
  flex-shrink: 0; background: var(--kkc-white);
  border-top: 1px solid var(--kkc-ge);
  padding: 16px 28px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.kkc-totals {
  display: flex; align-items: center; justify-content: space-between;
}
.kkc-totals-label { font-size: 13px; color: var(--kkc-g8); letter-spacing: .04em; }
.kkc-totals-val   { font-size: 15px; font-weight: 600; color: var(--kkc-black); }

/* CHECKOUT SECURELY button — dark olive/charcoal like reference */
.kkc-checkout-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 54px; padding: 0 20px;
  background: var(--kkc-dark); color: var(--kkc-white);
  text-decoration: none; border: none; cursor: pointer;
  transition: background .25s var(--kkc-ease);
}
.kkc-checkout-btn:hover:not(.is-disabled) { background: var(--kkc-gold); }
.kkc-checkout-btn.is-disabled {
  opacity: .45; pointer-events: none; cursor: not-allowed;
}
.kkc-checkout-label {
  font-size: 11px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: inherit;
}
.kkc-checkout-total {
  font-size: 14px; font-weight: 600; color: inherit;
}

/* ── Header cart badge ─────────────────────────────────────────── */
.trigger-cart-drawer { position: relative; cursor: pointer; }
.kkc-badge {
  position: absolute; top: -6px; right: -6px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--kkc-black); color: var(--kkc-white);
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; letter-spacing: 0;
  transition: transform .2s var(--kkc-ease);
}
.kkc-badge.bump { animation: kkc-bump .3s var(--kkc-ease); }
@keyframes kkc-bump { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }

/* ── Add-to-cart button loading state ──────────────────────────── */
.tt-add-to-bag-btn.kkc-loading { opacity: .5; pointer-events: none; cursor: wait; }
.tt-add-to-bag-btn.kkc-added   { color: var(--kkc-gold) !important; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  :root { --kkc-w: 100vw; }
  .kkc-head, .kkc-list, .kkc-foot,
  .kkc-coupon-wrap, .kkc-delivery-notice { padding-left: 18px; padding-right: 18px; }
  .kkc-item-img { width: 80px; height: 80px; }
}
@media (min-width: 481px) and (max-width: 768px) { :root { --kkc-w: 400px; } }
@media (prefers-reduced-motion: reduce) {
  .kkc-overlay, .kkc-drawer, .kkc-item { transition: none; animation: none; }
}
