/* =====================================================
   SITE-WIDE UI LAYER (light theme, matches main.css tokens)
   transitions · page flow · icons · cart badge · prices · toasts · forms
   ===================================================== */
:root {
  --nd-ink: var(--color-secondary, #1a1a1c);
  --nd-muted: rgba(26, 26, 28, .6);
  --nd-faint: rgba(26, 26, 28, .42);
  --nd-line: var(--color-stroke-1, #dfe4eb);
  --nd-line-2: var(--color-stroke-3, #d7dde5);
  --nd-soft: var(--color-background-13, #f2f5fa);
  --nd-soft-2: var(--color-background-3, #f4f5f8);
  --nd-violet: var(--color-primary-500, #864ffe);
  --nd-violet-soft: #f3eeff;
  --nd-grad: linear-gradient(135deg, #8b5cf6, #e248aa 70%, #ff9c40);
  --nd-grad-cool: var(--color-gradient-14, linear-gradient(180deg, #c1b1f9 0%, #7d51f4 100%));
  --nd-grad-soft: linear-gradient(135deg, #60c4ff, #8b5cf6 45%, #e248aa 75%, #ff9c40);
  --nd-ease: cubic-bezier(.22, 1, .36, 1);
  --nd-spring: cubic-bezier(.2, .9, .3, 1.25);
  --nd-r-sm: 12px; --nd-r: 18px; --nd-r-lg: 24px;
  --nd-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -18px rgba(60, 30, 140, .28);
  --nd-shadow-lg: 0 2px 6px rgba(16, 24, 40, .04), 0 28px 60px -28px rgba(60, 30, 140, .38);
  --nd-font: var(--font-inter-tight, 'Inter Tight', sans-serif);
}

/* ---------- smooth page flow ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: nd-vt-out .22s var(--nd-ease) both; }
::view-transition-new(root) { animation: nd-vt-in .38s var(--nd-ease) both; }
@keyframes nd-vt-out { to { opacity: 0; } }
@keyframes nd-vt-in { from { opacity: 0; } }
html.nd-leaving main { opacity: 0; transition: opacity .2s ease; }
/* The site scrolls with Lenis (assets/main.js). Native smooth scrolling must stay OFF or the two fight and the page lags / shakes. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- smooth interactive elements everywhere ---------- */
/* colours only on generic buttons: GSAP animates their transform, a CSS transform transition would make them lag */
button:not([data-ns-animate]), input, select, textarea {
  transition: color .25s var(--nd-ease), background-color .25s var(--nd-ease), border-color .25s var(--nd-ease), box-shadow .3s var(--nd-ease);
}
.nd-btn, .nd-chip, .nd-ic-btn {
  transition: color .25s var(--nd-ease), background-color .25s var(--nd-ease), border-color .25s var(--nd-ease),
              box-shadow .3s var(--nd-ease), transform .3s var(--nd-ease), opacity .25s var(--nd-ease);
}
:focus-visible { outline: 2px solid var(--nd-violet); outline-offset: 2px; border-radius: 8px; }
::selection { background: rgba(134, 79, 254, .18); }

/* ---------- icons (same line style as the header / footer) ---------- */
.nd-ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nd-ic--sm { width: 16px; height: 16px; }
.nd-ic--lg { width: 24px; height: 24px; }
.nd-ic-box { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--nd-line-2); background: #fff; color: var(--nd-ink); }
.nd-ic-box--grad { border: 0; background: var(--nd-grad-cool); color: #fff; }
.nd-ic-box--soft { border: 0; background: var(--nd-violet-soft); color: var(--nd-violet); }

/* ---------- buttons ---------- */
.nd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--nd-line); background: #fff; color: var(--nd-ink) !important; font: 500 15px/1 var(--nd-font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.nd-btn:hover { border-color: #c1b1f9; transform: translateY(-1px); box-shadow: 0 10px 22px -16px rgba(60, 30, 140, .5); }
.nd-btn:active { transform: translateY(0) scale(.98); }
.nd-btn--dark { background: var(--nd-ink); border-color: var(--nd-ink); color: #fff !important; }
.nd-btn--dark:hover { background: #2c2c30; border-color: #2c2c30; }
.nd-btn--grad { border: 0; background: var(--nd-grad); color: #fff !important; box-shadow: 0 14px 28px -16px rgba(226, 72, 170, .9); }
.nd-btn--sm { height: 40px; padding: 0 16px; font-size: 14px; }
.nd-btn--block { width: 100%; }
.nd-btn[disabled], .nd-btn.is-busy { opacity: .6; pointer-events: none; }
.nd-btn.is-busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: nd-spin .7s linear infinite; }
@keyframes nd-spin { to { transform: rotate(360deg); } }

/* "Get started" design reused for Buy now (dark pill + gradient icon chip) */
.nd-cta { display: inline-flex; align-items: center; height: 52px; padding: 4px; gap: 0; border-radius: 999px; background: var(--nd-ink); color: #fff !important; text-decoration: none; font: 400 16px/1 var(--nd-font); border: 0; cursor: pointer; white-space: nowrap; box-shadow: 0 16px 30px -18px rgba(26, 26, 28, .7); }
.nd-cta__icon { position: relative; display: grid; place-items: center; width: 56px; height: 44px; border-radius: 999px; background: var(--nd-grad-cool); overflow: hidden; transition: width .45s var(--nd-ease); }
.nd-cta__icon svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s var(--nd-ease); }
.nd-cta__text { padding: 0 20px 0 16px; }
/* sliding hover: icon travels to the right end, text moves left (nd-ui.js measures the distance) */
.nd-cta__icon, .nd-cta__text, .button-icon, .button-text { transition: transform .6s cubic-bezier(.4, 0, .2, 1); }
.nd-cta { overflow: hidden; }
@media (hover: none) { .nd-cta__icon, .nd-cta__text { transform: none !important; } }
.nd-cta:hover { color: #fff !important; }
.nd-cta:hover .nd-cta__icon svg { transform: rotate(-8deg); }
.nd-cta--light { background: #fff; color: var(--nd-ink) !important; border: 1px solid var(--nd-line); box-shadow: none; }
.nd-cta--light:hover { color: var(--nd-ink) !important; border-color: #c1b1f9; }
.nd-cta--light .nd-cta__icon { background: var(--nd-soft); }
.nd-cta--light .nd-cta__icon svg { stroke: var(--nd-ink); }
.nd-cta.is-added .nd-cta__icon { background: linear-gradient(135deg, #34d399, #16a34a); }
.nd-cta.is-added .nd-cta__icon svg { stroke: #fff; }

/* ---------- chips / pills (never wrap, always centred) ---------- */
.nd-pill, .db-pill { display: inline-flex !important; align-items: center; gap: 6px; height: 28px; padding: 0 12px !important; border-radius: 999px; font: 600 12.5px/1 var(--nd-font); white-space: nowrap; background: var(--nd-soft); color: var(--nd-ink); }
.nd-pill--green, .db-pill--green { background: #dcfce7; color: #15803d; }
.nd-pill--amber, .db-pill--amber { background: #fef3c7; color: #b45309; }
.nd-pill--violet, .db-pill--violet { background: #ede9fe; color: #6d28d9; }
.nd-pill--red, .db-pill--red { background: #fee2e2; color: #b91c1c; }
.nd-pill--pink { background: #fce7f3; color: #be185d; }
.nd-pill .nd-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.nd-pill--amber .nd-dot, .nd-pill--violet .nd-dot { animation: nd-blink 1.6s ease-in-out infinite; }
@keyframes nd-blink { 50% { opacity: .3; } }

/* ---------- help / info strip (no shadow bleed, clean border) ---------- */
.nd-help { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: var(--nd-r); background: #fff; border: 1px solid var(--nd-line); font: 400 14px/1.5 var(--nd-font); color: var(--nd-ink); box-shadow: none; }
.nd-help a { color: var(--nd-violet); font-weight: 600; text-decoration: none; }
.nd-help a:hover { text-decoration: underline; }

/* ---------- header cart button ---------- */
.nd-hcart { position: relative; display: inline-grid; place-items: center; width: 48px; height: 48px; margin-right: 10px; border-radius: 50%; background: var(--color-background-4, #f0f2f6); color: var(--nd-ink); text-decoration: none; transition: background .25s, transform .3s var(--nd-ease); }
.nd-hcart:hover { background: #e6e9f0; transform: translateY(-1px); color: var(--nd-ink); }
.nd-hcart[hidden] { display: none; }
.nd-hcart__n { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--nd-grad); color: #fff; font: 600 11px/20px var(--nd-font); text-align: center; box-shadow: 0 0 0 2px #fff; }
.nd-hcart.is-bump { animation: nd-bump .5s var(--nd-spring); }
@keyframes nd-bump { 40% { transform: scale(1.18); } }
.nd-hcart--mobile { margin: 0 8px 0 0; }

/* ---------- local prices ---------- */
.nd-price { display: inline-flex; flex-direction: column; gap: 2px; }
.nd-price__alt { font-size: .62em; font-weight: 500; color: var(--nd-muted); letter-spacing: 0; }
.nd-price.is-local .nd-price__main { order: 2; font-size: .5em; font-weight: 500; color: var(--nd-muted); }
.nd-price.is-local .nd-price__alt { order: 1; font-size: 1em; font-weight: inherit; color: inherit; }
.nd-cur { display: inline-flex; align-items: center; gap: 6px; font: 400 12.5px/1 var(--nd-font); color: var(--nd-muted); }
.nd-cur select { height: 30px; padding: 0 26px 0 10px; border-radius: 999px; border: 1px solid var(--nd-line); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%231a1a1c' stroke-width='1.5'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center; -webkit-appearance: none; appearance: none; font: 500 12.5px/1 var(--nd-font); color: var(--nd-ink); cursor: pointer; }

/* ---------- toast ---------- */
.nd-toast { position: fixed; left: 50%; bottom: 28px; z-index: 10050; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 12px 18px 12px 12px; border-radius: 999px; background: var(--nd-ink); color: #fff; font: 500 14px/1.3 var(--nd-font); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .5); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform .45s var(--nd-spring), opacity .3s; }
.nd-toast.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.nd-toast__ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--nd-grad-cool); }
.nd-toast__ic .nd-ic { width: 16px; height: 16px; stroke: #fff; }
.nd-toast a { color: #c1b1f9; font-weight: 600; text-decoration: none; margin-left: 4px; }

/* ---------- modal (shared) ---------- */
.nd-modal { position: fixed; inset: 0; z-index: 10040; display: grid; place-items: center; padding: 16px; }
.nd-modal[hidden] { display: none; }
.nd-modal__bg { position: absolute; inset: 0; background: rgba(26, 26, 28, .32); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .3s; }
.nd-modal__card { position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px; border-radius: var(--nd-r-lg); background: #fff; box-shadow: var(--nd-shadow-lg); font-family: var(--nd-font); color: var(--nd-ink); transform: translateY(18px) scale(.98); opacity: 0; transition: transform .45s var(--nd-spring), opacity .3s; }
.nd-modal.is-in .nd-modal__bg { opacity: 1; }
.nd-modal.is-in .nd-modal__card { transform: none; opacity: 1; }
.nd-modal__x { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--nd-soft); color: var(--nd-ink); cursor: pointer; }
.nd-modal__x:hover { background: #e6e9f0; transform: rotate(90deg); }
.nd-modal h3 { margin: 0 0 6px; font-size: 1.25rem; font-weight: 600; }
.nd-modal p { margin: 0 0 18px; color: var(--nd-muted); font-size: 14.5px; line-height: 1.55; }

/* ---------- smooth expand / collapse ---------- */
.nd-collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .45s var(--nd-ease), opacity .35s; }
.nd-collapse > * { overflow: hidden; min-height: 0; }
.nd-collapse.is-closed { grid-template-rows: 0fr; opacity: 0; }

/* ---------- tab panels (dashboard / account) ---------- */
.nd-tabpanel { animation: nd-tab-in .45s var(--nd-ease) both; }
@keyframes nd-tab-in { from { opacity: 0; transform: translateY(10px); } }
.nd-stagger > * { animation: nd-tab-in .5s var(--nd-ease) both; }
.nd-stagger > *:nth-child(2) { animation-delay: .04s; } .nd-stagger > *:nth-child(3) { animation-delay: .08s; }
.nd-stagger > *:nth-child(4) { animation-delay: .12s; } .nd-stagger > *:nth-child(5) { animation-delay: .16s; }
.nd-stagger > *:nth-child(6) { animation-delay: .2s; } .nd-stagger > *:nth-child(n+7) { animation-delay: .24s; }

/* ---------- form fields ---------- */
.nd-field { display: block; }
.nd-field > span { display: block; margin-bottom: 6px; font: 500 13px/1.3 var(--nd-font); color: var(--nd-muted); }
.nd-input { width: 100%; height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--nd-line); background: #fff; font: 400 15px/1 var(--nd-font); color: var(--nd-ink); }
textarea.nd-input { height: auto; min-height: 96px; padding: 12px 16px; line-height: 1.55; resize: vertical; }
.nd-input:hover { border-color: var(--nd-line-2); }
.nd-input:focus { outline: none; border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(134, 79, 254, .12); }
.nd-grid2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .nd-grid2 { grid-template-columns: 1fr 1fr; } .nd-span2 { grid-column: span 2; } }

/* ---------- switch ---------- */
.nd-switch { position: relative; display: inline-block; flex: none; width: 48px; height: 28px; }
.nd-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.nd-switch span { position: absolute; inset: 0; border-radius: 999px; background: #d7dde5; transition: background .3s var(--nd-ease); }
.nd-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); transition: transform .4s var(--nd-spring); }
.nd-switch input:checked + span { background: var(--nd-violet); }
.nd-switch input:checked + span::after { transform: translateX(20px); }
.nd-switch input:focus-visible + span { box-shadow: 0 0 0 4px rgba(134, 79, 254, .2); }

/* ---------- hide Google translate chrome (language preference) ---------- */
.goog-te-banner-frame, .skiptranslate > iframe, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* ---------- responsive helpers ---------- */
@media (max-width: 640px) {
  .nd-btn { height: 46px; }
  .nd-cta { height: 50px; }
  .nd-modal__card { padding: 22px 18px; }
  .nd-toast { bottom: 18px; }
}

/* ---------- header avatar ---------- */
.nd-hdr-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin-right: 4px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #c1b1f9; }
.nd-hdr-avatar--txt { display: inline-grid; place-items: center; background: var(--nd-grad-cool); color: #fff; font: 600 11px/1 var(--nd-font); }

/* ---------- "keep me signed in" (dark login card) ---------- */
.nd-remember { display: inline-flex; align-items: center; gap: 10px; font: 400 14px/1.3 var(--nd-font); color: rgba(255, 255, 255, .85); cursor: pointer; user-select: none; }
.nd-remember input { position: absolute; opacity: 0; }
.nd-remember span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid rgba(255, 255, 255, .35); transition: all .25s var(--nd-ease); }
.nd-remember input:checked + span { background: var(--nd-violet); border-color: var(--nd-violet); }
.nd-remember input:checked + span::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.nd-remember input:focus-visible + span { box-shadow: 0 0 0 4px rgba(134, 79, 254, .3); }

/* ---------- small text buttons (used on project, cart, account pages) ---------- */
.pj-link { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 0; border-radius: 999px; background: none; font: 500 12.5px/1 var(--nd-font); color: var(--nd-muted); text-decoration: none; cursor: pointer; transition: background .25s, color .25s; }
.pj-link:hover { background: var(--nd-soft); color: var(--nd-ink); }
.pj-link .nd-ic { width: 15px; height: 15px; }
.pj-link--accent { color: var(--nd-violet); }
.pj-link--danger:hover { color: #dc2626; background: #fef2f2; }
.nd-cta.is-busy { opacity: .75; pointer-events: none; }
