/* ==========================================================================
   Organic Journey — Cart & Checkout styles
   Loaded AFTER style.css / responsive.css. Fully self-contained; every class
   is prefixed "oj-" so it cannot clash with existing site styles.
   ========================================================================== */

.oj-cart-layer,
.oj-cart-fab,
.oj-toast,
.oj-buy {
  --oj-green: #1F4D36;
  --oj-green-dark: #163a29;
  --oj-gold: #DFAF2B;
  --oj-gold-dark: #c99a1c;
  --oj-cream: #FBF8F0;
  --oj-sand: #F1EAD8;
  --oj-ink: #1d2a22;
  --oj-muted: #5d6b62;
  --oj-line: #e4dcc7;
  --oj-danger: #b3261e;
  --oj-wa: #1fa855;
  --oj-wa-dark: #178a45;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Never let a display rule beat the [hidden] attribute */
.oj-cart-layer [hidden],
.oj-cart-fab[hidden],
.oj-cart-count[hidden],
.oj-buy [hidden] { display: none !important; }

/* Page behind: no scroll while the drawer is open */
html.oj-cart-open,
html.oj-cart-open body { overflow: hidden; }

/* Native cursor inside the drawer (the site's custom cursor is for the page) */
.oj-cart-layer,
.oj-cart-fab,
.oj-toast { cursor: auto; }
.oj-cart-layer button,
.oj-cart-layer a,
.oj-cart-layer summary,
.oj-cart-layer select,
.oj-cart-fab,
.oj-toast button,
.oj-buy button { cursor: pointer; }
.oj-cart-layer input[type="text"],
.oj-cart-layer input[type="tel"],
.oj-cart-layer input[type="email"],
.oj-cart-layer textarea,
.oj-buy input { cursor: text; }

/* ---------- Product-card controls ---------- */
.oj-buy {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.oj-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--oj-line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.oj-qty-btn {
  width: 36px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--oj-green);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s ease;
}
.oj-qty-btn:hover { background: var(--oj-sand); }
.oj-qty-input {
  width: 38px;
  height: 40px;
  border: 0;
  background: transparent;
  text-align: center;
  font: 600 0.95rem/1 'Poppins', system-ui, sans-serif;
  color: var(--oj-ink);
  padding: 0;
  -moz-appearance: textfield;
}
.oj-qty-input:focus { outline: none; background: var(--oj-sand); }

.oj-add-btn {
  flex: 1 1 150px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--oj-green);
  color: #fff;
  font: 600 0.9rem/1 'Poppins', system-ui, sans-serif;
  letter-spacing: .01em;
  transition: background-color .25s ease, color .25s ease, transform .2s ease;
}
.oj-add-btn:hover { background: var(--oj-gold); color: var(--oj-green-dark); }
.oj-add-btn:active { transform: scale(.97); }
.oj-add-btn.is-added { background: var(--oj-gold); color: var(--oj-green-dark); }

/* Keyboard focus, visible everywhere in the cart UI */
.oj-cart-layer :focus-visible,
.oj-buy :focus-visible,
.oj-cart-fab:focus-visible,
.oj-toast :focus-visible,
[data-oj-header-cart]:focus-visible {
  outline: 3px solid var(--oj-gold);
  outline-offset: 2px;
}

/* ---------- Header cart button ---------- */
[data-oj-header-cart] {
  position: relative;
  overflow: visible;
}
.oj-cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--oj-gold);
  color: #163a29;
  font: 700 0.7rem/20px 'Poppins', system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(31, 77, 54, .9);
  pointer-events: none;
}
[data-oj-header-cart].oj-bump { animation: oj-bump .45s ease; }
@keyframes oj-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ---------- Floating "View Cart" bar ---------- */
.oj-cart-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 12px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--oj-green);
  color: #fff;
  font: 600 0.88rem/1 'Poppins', system-ui, sans-serif;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(15, 40, 28, .35);
  animation: oj-pop .4s cubic-bezier(.2, .9, .3, 1.2);
}
.oj-cart-fab i { color: var(--oj-gold); font-size: 1.05rem; }
.oj-fab-total { padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .3); color: var(--oj-gold); }
.oj-cart-fab:hover { background: var(--oj-green-dark); }
@keyframes oj-pop { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Toast ---------- */
.oj-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 2100;
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 14px 12px 18px;
  border-radius: 14px;
  background: var(--oj-green-dark);
  color: #fff;
  font: 500 0.88rem/1.35 'Poppins', system-ui, sans-serif;
  box-shadow: 0 14px 36px rgba(10, 30, 20, .4);
  transition: opacity .3s ease, transform .3s ease;
}
.oj-toast.is-show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.oj-toast i { color: var(--oj-gold); }
.oj-toast-link {
  margin-left: 6px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--oj-gold);
  color: var(--oj-green-dark);
  font: 700 0.8rem/1 'Poppins', system-ui, sans-serif;
  white-space: nowrap;
}

/* ---------- Drawer ---------- */
.oj-cart-layer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  visibility: hidden;
  pointer-events: none;
  color: var(--oj-ink);
}
.oj-cart-layer.is-open { visibility: visible; pointer-events: auto; }

.oj-cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 28, 20, .6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .3s ease;
}
.oj-cart-layer.is-open .oj-cart-backdrop { opacity: 1; }

.oj-cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(480px, 100%);
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--oj-cream);
  box-shadow: -18px 0 50px rgba(10, 30, 20, .35);
  transform: translateX(100%);
  transition: transform .38s cubic-bezier(.22, .8, .24, 1);
  outline: none;
}
.oj-cart-layer.is-open .oj-cart-panel { transform: translateX(0); }

.oj-cart-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  padding-top: max(16px, env(safe-area-inset-top));
  background: var(--oj-green);
  color: #fff;
  flex: 0 0 auto;
}
.oj-cart-head h2 {
  flex: 1;
  margin: 0;
  font: 600 1.35rem/1.2 'Playfair Display', Georgia, serif;
  color: #fff;
  letter-spacing: 0;
}
.oj-icon-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background-color .2s ease, color .2s ease;
}
.oj-icon-btn:hover { background: var(--oj-gold); color: var(--oj-green-dark); border-color: var(--oj-gold); }

.oj-cart-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
}

.oj-cart-foot {
  flex: 0 0 auto;
  padding: 16px 18px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--oj-line);
  box-shadow: 0 -8px 24px rgba(31, 77, 54, .06);
}

/* ---------- Buttons ---------- */
.oj-btn {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font: 600 0.98rem/1 'Poppins', system-ui, sans-serif;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease, transform .2s ease, opacity .2s ease;
}
.oj-btn:active { transform: scale(.98); }
.oj-btn:disabled { opacity: .5; cursor: not-allowed; }
.oj-btn-gold { background: var(--oj-gold); color: var(--oj-green-dark); }
.oj-btn-gold:hover:not(:disabled) { background: var(--oj-gold-dark); }
.oj-btn-wa { background: var(--oj-wa); color: #fff; }
.oj-btn-wa:hover { background: var(--oj-wa-dark); }
.oj-btn-wa i { font-size: 1.2rem; }
.oj-btn-ghost {
  margin-top: 10px;
  min-height: 44px;
  background: transparent;
  color: var(--oj-green);
  border: 1.5px solid var(--oj-line);
}
.oj-btn-ghost:hover { background: var(--oj-sand); }

/* ---------- Cart items ---------- */
.oj-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.oj-item {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--oj-line);
  border-radius: 16px;
}
.oj-item-img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--oj-sand);
}
.oj-item-name {
  margin: 0;
  font: 600 1rem/1.3 'Playfair Display', Georgia, serif;
  color: var(--oj-green);
}
.oj-item-meta { margin: 2px 0 0; font-size: 0.78rem; color: var(--oj-muted); }
.oj-item-total { margin: 0; font-weight: 700; font-size: 0.98rem; color: var(--oj-ink); white-space: nowrap; }
.oj-item-ctrl { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.oj-item .oj-qty-btn { width: 32px; height: 34px; }
.oj-item .oj-qty-input { width: 34px; height: 34px; font-size: 0.9rem; }
.oj-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--oj-danger);
  font: 500 0.78rem/1 'Poppins', system-ui, sans-serif;
}
.oj-remove:hover { text-decoration: underline; }

.oj-empty { text-align: center; padding: 48px 12px; }
.oj-empty-icon {
  width: 84px; height: 84px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--oj-sand); color: var(--oj-green); font-size: 2rem;
}
.oj-empty h3 { margin: 0 0 6px; font: 600 1.3rem/1.3 'Playfair Display', Georgia, serif; color: var(--oj-green); }
.oj-empty p { margin: 0 0 22px; color: var(--oj-muted); font-size: 0.92rem; }
.oj-empty .oj-btn { width: auto; display: inline-flex; }

.oj-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
  font-weight: 600;
}
.oj-total-row strong { font-size: 1.3rem; color: var(--oj-green); }
.oj-fine { margin: 0 0 14px; font-size: 0.76rem; line-height: 1.5; color: var(--oj-muted); }

/* ---------- Checkout form ---------- */
.oj-mini {
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid var(--oj-line);
  border-radius: 14px;
}
.oj-mini summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--oj-green);
  list-style: none;
}
.oj-mini summary::-webkit-details-marker { display: none; }
.oj-mini summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.7rem;
  margin-left: auto;
  align-self: center;
  transition: transform .2s ease;
}
.oj-mini[open] summary::after { transform: rotate(180deg); }
.oj-mini ul { list-style: none; margin: 0; padding: 0 16px 12px; border-top: 1px dashed var(--oj-line); }
.oj-mini li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 0.84rem; }
.oj-mini-amt { font-weight: 600; white-space: nowrap; }

.oj-form { display: grid; gap: 14px; }
.oj-form-intro { margin: 0 0 2px; font-size: 0.88rem; color: var(--oj-muted); line-height: 1.55; }
.oj-legend {
  margin: 6px 0 -4px;
  font: 600 1.05rem/1.3 'Playfair Display', Georgia, serif;
  color: var(--oj-green);
}
.oj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.oj-field { display: grid; gap: 5px; }
.oj-field > span { font-size: 0.8rem; font-weight: 600; color: var(--oj-ink); }
.oj-field > span em { font-style: normal; font-weight: 400; color: var(--oj-muted); }
.oj-field input,
.oj-field select,
.oj-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid var(--oj-line);
  border-radius: 12px;
  background: #fff;
  color: var(--oj-ink);
  font: 400 16px/1.4 'Poppins', system-ui, sans-serif;   /* 16px stops iOS zoom-on-focus */
  box-sizing: border-box;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.oj-field textarea { resize: vertical; min-height: 72px; }
.oj-field input:focus,
.oj-field select:focus,
.oj-field textarea:focus {
  outline: none;
  border-color: var(--oj-green);
  box-shadow: 0 0 0 3px rgba(223, 175, 43, .35);
}
.oj-field [aria-invalid="true"] { border-color: var(--oj-danger); background: #fff8f7; }
.oj-err { min-height: 0; font-size: 0.76rem; color: var(--oj-danger); }
.oj-err:empty { display: none; }

/* ---------- Done view ---------- */
.oj-done { text-align: center; padding: 28px 6px; }
.oj-done-icon {
  width: 82px; height: 82px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--oj-wa); color: #fff; font-size: 2.3rem;
}
.oj-done h3 { margin: 0 0 10px; font: 600 1.45rem/1.3 'Playfair Display', Georgia, serif; color: var(--oj-green); }
.oj-done p { margin: 0 auto 12px; max-width: 34ch; font-size: 0.92rem; line-height: 1.6; color: var(--oj-muted); }
.oj-done-steps {
  margin: 20px 0 0; padding: 14px 16px; text-align: left;
  background: #fff; border: 1px solid var(--oj-line); border-radius: 14px;
  font-size: 0.86rem; line-height: 1.6; color: var(--oj-ink);
}
.oj-done-steps ol { margin: 0; padding-left: 20px; }
.oj-popup-note {
  margin-top: 16px; padding: 10px 14px; border-radius: 12px;
  background: #fff6dd; border: 1px solid var(--oj-gold); color: #6b4f00; font-size: 0.84rem;
}

/* ---------- Small screens ---------- */
@media (max-width: 520px) {
  .oj-cart-panel { width: 100%; }
  .oj-row { grid-template-columns: 1fr; }
  .oj-item { grid-template-columns: 60px 1fr; }
  .oj-item-img { width: 60px; height: 60px; }
  .oj-item-total { grid-column: 2; margin-top: -4px; }
  .oj-cart-fab { left: 12px; padding: 11px 16px 11px 14px; font-size: .82rem; }
  .oj-toast { bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .oj-cart-panel, .oj-cart-backdrop, .oj-toast, .oj-add-btn, .oj-btn { transition: none; }
  .oj-cart-fab, [data-oj-header-cart].oj-bump { animation: none; }
}
