/* ============================================================
   Kindling Threads — app.css
   Shared interactive UI: cart drawer, badge, toast,
   account modal, wishlist filled state, shop count.
   ============================================================ */

:root {
  --kt-green-deep: #1d2e22;
  --kt-cream: #ede5d3;
  --kt-cream-light: #f1ead9;
}

/* ───────── Cart icon badge ───────── */
.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: #c4574a;
  color: #fff;
  font-family: var(--sans, sans-serif);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--kt-cream);
}
.header-icons .icon-btn { position: relative; }

/* ───────── Wishlist filled state ───────── */
.pcard-wishlist.on,
.pcard-wishlist.on:hover {
  background: #c4574a;
  color: #fff;
}
.pcard-wishlist.on svg {
  fill: currentColor;
  stroke: currentColor;
}

/* ───────── Cart drawer ───────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(29, 46, 34, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.cart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100dvh;
  background: var(--kt-cream);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.22);
}
.cart-drawer.is-open { transform: translateX(0); }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px 16px;
  border-bottom: 1px solid rgba(29, 46, 34, 0.1);
}
.cart-head h3 {
  font-family: var(--serif, serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--kt-green-deep);
  margin: 0;
  letter-spacing: -0.2px;
}
.cart-close {
  background: none;
  border: none;
  color: var(--kt-green-deep);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}
.cart-close:hover { opacity: 0.65; }

.cart-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 22px;
}

.cart-empty {
  padding: 60px 0;
  text-align: center;
  font-family: var(--sans, sans-serif);
}
.cart-empty p {
  color: rgba(74, 85, 74, 0.85);
  margin: 0 0 18px;
  font-size: 15px;
}
.cart-empty .btn-link {
  display: inline-block;
  padding: 10px 24px;
  background: var(--kt-green-deep);
  color: var(--kt-cream);
  text-decoration: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.2s ease;
}
.cart-empty .btn-link:hover { background: #2a3f30; }

.cart-item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(29, 46, 34, 0.08);
  align-items: start;
}
.cart-item-img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--kt-cream-light);
}
.cart-item-info {
  font-family: var(--sans, sans-serif);
  min-width: 0;
}
.cart-item-info h4 {
  font-family: var(--serif, serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--kt-green-deep);
  margin: 0 0 4px;
  letter-spacing: -0.1px;
}
.cart-item-info p {
  font-size: 12px;
  color: rgba(74, 85, 74, 0.75);
  margin: 0 0 10px;
}
.cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(29, 46, 34, 0.18);
  border-radius: 3px;
  overflow: hidden;
}
.cart-qty button {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  font-size: 16px;
  color: var(--kt-green-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease;
  font-family: var(--sans, sans-serif);
  line-height: 1;
}
.cart-qty button:hover { background: rgba(29, 46, 34, 0.06); }
.cart-qty .qty-num {
  font-size: 13px;
  font-weight: 500;
  padding: 0 10px;
  min-width: 24px;
  text-align: center;
  color: var(--kt-green-deep);
}
.cart-item-side {
  text-align: right;
  font-family: var(--sans, sans-serif);
}
.cart-item-price {
  font-size: 14px;
  font-weight: 500;
  color: var(--kt-green-deep);
  margin-bottom: 8px;
}
.cart-item-remove {
  background: none;
  border: none;
  color: rgba(74, 85, 74, 0.6);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--sans, sans-serif);
  transition: color 0.2s ease;
}
.cart-item-remove:hover { color: #c4574a; }

.cart-foot {
  padding: 18px 26px 26px;
  border-top: 1px solid rgba(29, 46, 34, 0.1);
  background: var(--kt-cream);
  font-family: var(--sans, sans-serif);
}
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--kt-green-deep);
  margin-bottom: 4px;
}
.cart-subtotal-row strong {
  font-size: 18px;
  font-weight: 600;
}
.cart-foot-note {
  font-size: 11px;
  color: rgba(74, 85, 74, 0.7);
  margin: 0 0 14px;
}
.cart-checkout {
  width: 100%;
  background: var(--kt-green-deep);
  color: var(--kt-cream);
  border: none;
  padding: 15px;
  font-family: var(--sans, sans-serif);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s ease;
}
.cart-checkout:hover:not(:disabled) { background: #2a3f30; }
.cart-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ───────── Toast ───────── */
.kt-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--kt-green-deep);
  color: var(--kt-cream);
  padding: 14px 24px;
  border-radius: 4px;
  font-family: var(--sans, sans-serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1100;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  max-width: 90vw;
  text-align: center;
}
.kt-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ───────── Account modal ───────── */
.account-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(29, 46, 34, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1050;
  padding: 24px;
}
.account-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.account-modal {
  background: var(--kt-cream);
  width: 100%;
  max-width: 380px;
  padding: 36px 32px 28px;
  border-radius: 6px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
  font-family: var(--sans, sans-serif);
  color: var(--kt-green-deep);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}
.account-modal-overlay.is-open .account-modal {
  transform: scale(1);
}
.account-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--kt-green-deep);
  cursor: pointer;
  padding: 6px;
  transition: opacity 0.2s ease;
}
.account-modal-close:hover { opacity: 0.6; }
.account-modal h3 {
  font-family: var(--serif, serif);
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 6px;
  letter-spacing: -0.2px;
}
.account-modal-sub {
  font-size: 13px;
  color: rgba(74, 85, 74, 0.85);
  margin: 0 0 22px;
  line-height: 1.5;
}
.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
.account-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.account-form input {
  font-family: var(--sans, sans-serif);
  font-size: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(29, 46, 34, 0.18);
  background: #faf6ec;
  border-radius: 3px;
  color: var(--kt-green-deep);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.account-form input:focus {
  outline: none;
  border-color: var(--kt-green-deep);
  background: #fff;
}
.account-submit {
  background: var(--kt-green-deep);
  color: var(--kt-cream);
  border: none;
  padding: 13px;
  font-family: var(--sans, sans-serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  margin-top: 6px;
  transition: background 0.2s ease;
}
.account-submit:hover { background: #2a3f30; }
.account-stub-note {
  font-size: 11.5px;
  color: rgba(74, 85, 74, 0.7);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}
.account-stub-note a {
  color: var(--kt-green-deep);
  text-decoration: underline;
}

/* ───────── Shop product count ───────── */
.shop-count {
  font-family: var(--sans, sans-serif);
  font-size: 13px;
  color: rgba(74, 85, 74, 0.85);
  margin: 0 0 18px;
}

/* ───────── Filter color chip active state ───────── */
.color-chip.active {
  outline: 2px solid var(--kt-green-deep);
  outline-offset: 2px;
}
.size-chip.active {
  background: var(--kt-green-deep);
  color: var(--kt-cream);
  border-color: var(--kt-green-deep);
}


/* ───────── Logged-in indicator on Account icon (v2.21) ───────── */
.icon-btn[aria-label="Account"] { position: relative; }
.icon-btn[aria-label="Account"].is-logged-in::after {
  content: "";
  position: absolute;
  top: -2px; right: -2px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #6b9b73;
  box-shadow: 0 0 0 2px var(--kt-cream);
  pointer-events: none;
}
/* On bottom nav (dark bg), the ring color should match the bnav bg */
.bnav-item[aria-label="Account"].is-logged-in::after {
  top: 2px; right: calc(50% - 16px);
  box-shadow: 0 0 0 2px var(--kt-green-deep);
}

/* ───────── View full cart link in drawer (v2.22) ───────── */
.cart-view-full {
  display: block;
  text-align: center;
  font-family: var(--kt-sans, 'Outfit', sans-serif);
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--kt-cream);
  text-decoration: none;
  padding: 8px 0;
  margin-bottom: 12px;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}
.cart-view-full:hover {
  opacity: 1;
  text-decoration: underline;
}


/* ════════════════════════════════════════════════════════════════ */
/* FAVORITES (v2.30)                                                 */
/* ════════════════════════════════════════════════════════════════ */

/* Header heart count badge — reuses .cart-badge styles via shared class.
   The badge gets a sage-green tint to differentiate from the cart's
   accent color. */
.icon-btn-fav { position: relative; }
.fav-badge {
  position: absolute;
  top: -4px; right: -6px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #6b9b73;
  color: #f9f4ee;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--kt-sans, 'Outfit', sans-serif);
  line-height: 1;
}

/* Drawer overlay + drawer itself — mirror cart pattern */
.fav-overlay {
  position: fixed; inset: 0;
  background: rgba(29, 46, 34, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998;
}
.fav-overlay.is-open { opacity: 1; pointer-events: auto; }

.fav-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(440px, 92vw);
  height: 100vh;
  background: #f9f4ee;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.5, 0, 0.2, 1);
  display: flex; flex-direction: column;
  z-index: 999;
  box-shadow: -10px 0 30px rgba(29, 46, 34, 0.1);
}
.fav-drawer.is-open { transform: translateX(0); }

.fav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid #d6cfc0;
}
.fav-head h3 {
  margin: 0;
  font-family: var(--kt-serif, 'Cormorant Garamond', Georgia, serif);
  font-size: 24px;
  font-weight: 500;
  color: #1d2e22;
}
.fav-close {
  background: transparent; border: 0; cursor: pointer;
  padding: 4px;
  color: #1d2e22;
  border-radius: 4px;
  transition: background 0.2s ease;
}
.fav-close:hover { background: rgba(29, 46, 34, 0.08); }

.fav-body {
  flex: 1; overflow-y: auto;
  padding: 16px 22px;
}
.fav-foot {
  border-top: 1px solid #d6cfc0;
  padding: 18px 22px;
  text-align: center;
}
.fav-view-full {
  font-family: var(--kt-sans, 'Outfit', sans-serif);
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #1d2e22;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
  display: inline-block;
  padding: 6px 0;
}
.fav-view-full:hover { opacity: 0.7; text-decoration: underline; }

/* Drawer row (compact) */
.fav-list-compact { display: flex; flex-direction: column; gap: 14px; }
.fav-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #ede5d8;
}
.fav-row:last-child { border-bottom: 0; }
.fav-row-img {
  width: 64px; height: 80px;
  background: #ede5d8;
  border-radius: 4px;
  overflow: hidden;
  display: block;
}
.fav-row-img img, .fav-row-img svg {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.fav-row-body { min-width: 0; }
.fav-row-title {
  display: block;
  font-family: var(--kt-serif, 'Cormorant Garamond', Georgia, serif);
  font-size: 18px;
  color: #1d2e22;
  font-weight: 500;
  text-decoration: none;
  margin: 0 0 4px;
  line-height: 1.2;
}
.fav-row-title:hover { text-decoration: underline; }
.fav-row-price {
  margin: 0;
  font-family: var(--kt-serif, 'Cormorant Garamond', Georgia, serif);
  font-size: 15px;
  color: #4a554a;
}
.fav-remove {
  background: transparent; border: 0; cursor: pointer;
  padding: 8px;
  color: #6b7768;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}
.fav-remove:hover { color: #8a3722; background: rgba(138, 55, 34, 0.06); }

/* Full grid (favorites.html + account tab) */
.fav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.fav-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fav-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(29, 46, 34, 0.08); }
.fav-card-img {
  display: block;
  position: relative;
  aspect-ratio: 4/5;
  background: #ede5d8;
  overflow: hidden;
}
.fav-card-img img, .fav-card-img svg {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.fav-card-heart {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  background: rgba(249, 244, 238, 0.95);
  border: 0;
  border-radius: 50%;
  color: #1d2e22;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.fav-card-heart:hover { background: white; color: #8a3722; }
.fav-card-info { display: block; text-decoration: none; padding: 16px 18px 18px; }
.fav-card-eyebrow {
  font-family: var(--kt-sans, 'Outfit', sans-serif);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9c8651;
  margin: 0 0 4px;
  font-weight: 500;
}
.fav-card-title {
  font-family: var(--kt-serif, 'Cormorant Garamond', Georgia, serif);
  font-size: 22px;
  font-weight: 500;
  color: #1d2e22;
  margin: 0 0 8px;
  line-height: 1.2;
}
.fav-card-price {
  font-family: var(--kt-sans, 'Outfit', sans-serif);
  font-size: 14px;
  font-weight: 500;
  color: #1d2e22;
  margin: 0;
  letter-spacing: 0.5px;
}

.fav-loading {
  color: #6b7768;
  font-style: italic;
  text-align: center;
  padding: 32px 0;
}
.fav-empty {
  background: #ede5d8;
  border-radius: 8px;
  padding: 48px 28px;
  text-align: center;
  color: #6b7768;
}
.fav-empty p { margin: 0 0 12px; }
.fav-empty .btn-shop {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 28px;
  background: #1d2e22;
  color: #f9f4ee;
  text-decoration: none;
  border-radius: 4px;
  font-family: var(--kt-sans, 'Outfit', sans-serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .fav-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .fav-card-title { font-size: 19px; }
}
@media (max-width: 480px) {
  .fav-grid { grid-template-columns: 1fr; }
}
