/* Namcovi Naturals — the cart (option D, picked Oct 10 2026): slide-out drawer on every page + the /cart/ page.
   Theme tokens from main.css only (red / white / black / green). cart.js draws the lines. */

/* ---------- shared pieces ---------- */
.ct-lines { list-style: none; margin: 0; padding: 0; }
.ct-line { display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; align-items: start; padding: 16px 0; border-bottom: var(--rule) dashed rgba(0, 0, 0, 0.25); }
.ct-thumb { --panel: #F7ECEC; display: grid; place-items: center; width: 88px; aspect-ratio: 1; border-radius: 12px; background: var(--panel); overflow: hidden; }
.ct-thumb img { width: 58%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.18)); }
.ct-thumb--photo img { width: 100%; height: 100%; object-fit: cover; filter: none; }
.ct-line__main { min-width: 0; }
.ct-line__plant { margin: 0 0 2px; color: var(--red); font-family: var(--font-body); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.ct-line__name { margin: 0 0 10px; font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: 1.35rem; line-height: 1.1; color: var(--red); }
.ct-line__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ct-line__price { margin: 0; font-family: var(--font-text); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.ct-qty { display: inline-flex; align-items: center; border: var(--rule) solid var(--ink); border-radius: var(--radius-pill); overflow: hidden; }
.ct-qty button { width: 34px; height: 34px; border: 0; background: transparent; font: 700 1.05rem/1 var(--font-body); cursor: pointer; color: inherit; }
.ct-qty button:hover { background: var(--ink); color: var(--card); }
.ct-qty input { width: 2.2em; border: 0; background: transparent; text-align: center; font: 700 0.95rem var(--font-body); color: inherit; }
.ct-remove { padding: 0; border: 0; background: none; color: inherit; font: 0.78rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; opacity: 0.75; }
.ct-remove:hover { opacity: 1; }
.ct-at { font-family: var(--font-body); font-size: 0.82rem; opacity: 0.8; }

.ct-ship { padding: 12px 0 4px; }
.ct-ship__msg { margin: 0 0 8px; font-family: var(--font-text); font-size: 0.95rem; }
.ct-ship__bar { display: block; height: 8px; border-radius: 99px; background: rgba(30, 70, 33, 0.15); overflow: hidden; }
.ct-ship__bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width 0.3s ease; }

.ct-sum { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; font-family: var(--font-text); font-size: 1.05rem; }
.ct-sum b { font-weight: 800; }
.ct-sum--muted { font-size: 0.95rem; opacity: 0.75; }
.ct-sum--total { margin-top: 12px; padding-top: 12px; border-top: var(--rule) solid currentColor; font-size: 1.2rem; }
.ct-note { margin: 0 0 14px; font-family: var(--font-text); font-size: 0.88rem; opacity: 0.75; }
.ct-viewcart { display: block; margin-top: 12px; text-align: center; font-family: var(--font-body); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: inherit; }
.ct-empty { padding: 40px 0; text-align: center; font-family: var(--font-text); }
.ct-empty__title { margin: 0 0 6px; font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: 1.8rem; font-weight: 760; color: var(--head); }
.ct-empty .btn { margin-top: 14px; }

/* ---------- the drawer ---------- */
.ct-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.ct-drawer { position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--card); color: var(--ink); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.2); transform: translateX(100%); transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1); }
body.cart-open .ct-scrim { opacity: 1; pointer-events: auto; }
body.cart-open .ct-drawer { transform: none; }
body.cart-open { overflow: hidden; }
.ct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: var(--rule) solid var(--ink); }
.ct-head__title { margin: 0; font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 760; font-size: 1.9rem; line-height: 1; color: var(--head); }
.ct-head__n { font-family: var(--font-body); font-size: 0.5em; font-weight: 700; vertical-align: middle; }
.ct-drawer > .ct-ship { padding: 14px 22px 12px; border-bottom: var(--rule) dashed rgba(0, 0, 0, 0.25); }
.ct-body { flex: 1; overflow-y: auto; padding: 0 22px; overscroll-behavior: contain; }
.ct-body .ct-line:last-child { border-bottom: 0; }
.ct-foot { padding: 16px 22px 20px; border-top: var(--rule) solid var(--ink); }

/* suggestions + order note */
.ct-extras { margin: 6px 0 4px; padding: 16px 0 6px; border-top: var(--rule) solid var(--ink); }
.ct-extras__title { margin: 0 0 12px; font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.ct-extras__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ct-extra .ct-thumb { width: 100%; margin-bottom: 8px; }
.ct-extra .ct-line__plant { font-size: 0.64rem; }
.ct-extra__name { margin: 0 0 8px; font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: 1.05rem; line-height: 1.1; color: var(--red); }
.ct-extra__add { padding: 0.4em 0.7em; font-family: var(--font-body); font-size: 0.68rem; white-space: nowrap; }
.ct-notefield { margin: 10px 0 18px; font-family: var(--font-text); }
.ct-notefield summary { cursor: pointer; font-family: var(--font-body); font-size: 0.82rem; font-weight: 700; }
.ct-notefield textarea { display: block; width: 100%; margin-top: 10px; padding: 10px 12px; border: var(--rule) solid var(--ink); border-radius: 12px; font: inherit; resize: vertical; }

/* ---------- cart pages ---------- */
.cp { padding-block: clamp(28px, 4vw, 56px) clamp(56px, 7vw, 100px); }
.cp__title { margin: 0 0 6px; font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 760; font-size: clamp(2.6rem, 2rem + 3vw, 4.6rem); line-height: 0.95; letter-spacing: var(--display-tracking); color: var(--head); }
.cp > .ct-ship { max-width: 520px; margin-bottom: 18px; }
.cp__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: clamp(24px, 4vw, 64px); align-items: start; }
.cp-lines .ct-line { grid-template-columns: 120px 1fr auto; gap: 20px; padding: 22px 0; }
.cp-lines .ct-thumb { width: 120px; }
.cp-lines .ct-line__name { font-size: 1.7rem; }
.cp-sum { position: sticky; top: 100px; padding: 24px; border: var(--rule) solid var(--ink); border-radius: var(--radius); box-shadow: var(--stamp); background: var(--card); }
.cp-sum__title { margin: 0 0 16px; font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 760; font-size: 1.8rem; color: var(--head); }
.cp-sum .btn { margin-top: 18px; }
.cp-sum__safe { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0; font-family: var(--font-body); font-size: 0.75rem; opacity: 0.75; }
.cp-sum__safe svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cp-back { display: block; margin-top: 14px; text-align: center; font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; color: inherit; }
.ct-promo { margin: 12px 0 4px; font-family: var(--font-text); }
.ct-promo summary { cursor: pointer; font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; }
.ct-promo form { display: flex; gap: 8px; margin-top: 10px; }
.ct-promo input { flex: 1; min-width: 0; padding: 0.5em 0.9em; border: var(--rule) solid var(--ink); border-radius: var(--radius-pill); font: inherit; }

/* other plants row under the cart */
.namcovi-cart .shelf--others { padding-top: 0; }

/* ---------- phones ---------- */
@media (max-width: 900px) {
  .cp__cols { grid-template-columns: 1fr; }
  .cp-sum { position: static; }
}
@media (max-width: 560px) {
  .ct-drawer { width: 100vw; }
  .ct-head { padding: 14px 16px; }
  .ct-head__title { font-size: 1.6rem; }
  .ct-body, .ct-foot, .ct-drawer > .ct-ship { padding-inline: 16px; }
  .ct-line, .cp-lines .ct-line { grid-template-columns: 72px 1fr; gap: 12px; }
  .ct-thumb, .cp-lines .ct-thumb { width: 72px; }
  .ct-line__price { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
  .ct-line__main { grid-column: 2; grid-row: 1; padding-right: 76px; }
  .cp-lines .ct-line__name { font-size: 1.35rem; }
  .ct-extras__list { gap: 8px; }
  .ct-extra__add { font-size: 0.6rem; padding: 0.4em 0.5em; }
}
@media (prefers-reduced-motion: reduce) {
  .ct-drawer, .ct-scrim, .ct-ship__bar span { transition: none; }
}


/* ---------- theme additions ---------- */
.ct-drawer [hidden], .cp [hidden], .ct-empty[hidden], .shelf--others[hidden], .jar[hidden] { display: none !important; }
.ct-thumb { text-decoration: none; }
.ct-line__name a, .ct-extra__name a { color: inherit; text-decoration: none; }
.ct-line__name a:hover, .ct-extra__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ct-qty button:disabled { opacity: 0.3; cursor: default; background: transparent; color: inherit; }
.ct-soon { margin: 10px 0 0; font-family: var(--font-text); font-size: 0.86rem; text-align: center; }
.ct-close { color: var(--ink); }
.ct-drawer:focus-visible, .ct-qty input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.ct-empty .ct-viewcart { margin-top: 18px; }
.cp > .crumb { margin-bottom: 0.6em; }
/* cart page: with only one or two plants left to suggest, keep the cards their usual size and centred */
@media (min-width: 621px) {
  .namcovi-cart .shelf__grid--1, .namcovi-cart .shelf__grid--2 { grid-template-columns: repeat(auto-fit, minmax(0, 340px)); justify-content: center; }
}
