/* KandiByLouLou 💜 — calm pastel purple & white, easy on the eyes */

:root {
  --ink: #2e1f47;         /* deep purple, main text */
  --ink-soft: #5b4a7d;    /* softer purple, helper text */
  --purple: #7c5cd6;      /* main accent */
  --purple-strong: #6244c9;
  --lav-100: #efe9fa;     /* pale lavender fill */
  --lav-50: #f8f5fd;      /* barely-there lavender */
  --line: #e3d9f6;        /* decorative borders (cards, dividers) */
  --line-strong: #8f7cc0; /* form field borders — clearly visible (3.6:1 on white) */
  --white: #ffffff;
  --danger: #b3324b;
  --ok-bg: #e9f7ef;
  --ok-ink: #1f6b43;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(102, 73, 180, 0.08);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #fcfbff; /* whisper of lavender so the white panels stand out */
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: var(--purple-strong); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--purple); color: #fff;
  padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 50;
}
.skip-link:focus { left: 0; }

/* ---------- pinned top banner: socials left, name centre, shrinks on scroll ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--white);
  box-shadow: 0 2px 14px rgba(102, 73, 180, 0.08);
}
.topbar::after {
  content: ''; display: block; height: 3px;
  background: linear-gradient(90deg, var(--lav-100), var(--purple), var(--lav-100));
}
.topbar-inner {
  max-width: 1160px; margin: 0 auto; padding: 12px 20px 10px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
}
.socials {
  display: flex; flex-wrap: wrap; gap: 2px 10px;
  justify-self: start; align-items: center;
  font-size: 0.92rem;
}
.socials a {
  font-weight: 700; text-decoration: none;
  padding: 2px 6px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 6px;
}
.socials a:hover { background: var(--lav-50); text-decoration: underline; }
.icon { width: 15px; height: 15px; flex: none; }
.contact {
  justify-self: end;
  font-size: 0.92rem; color: var(--ink-soft);
  white-space: nowrap;
}
.contact a { font-weight: 700; }
.footer-links a { display: inline-flex; align-items: center; gap: 6px; }
.brand { text-align: center; }
.site-name { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: 0.5px; transition: font-size 0.2s ease; }
.site-name a { color: var(--ink); text-decoration: none; }
.tagline { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }
.topbar.shrunk .site-name { font-size: 1.3rem; }
.topbar.shrunk .tagline { display: none; }
.topbar.shrunk .topbar-inner { padding: 7px 20px 5px; }

/* ---------- page shell: pinned side panel + scrolling shop ---------- */
.shell {
  max-width: 1160px; margin: 0 auto; padding: 26px 20px 60px;
  display: grid; grid-template-columns: 264px 1fr; gap: 26px; align-items: start;
}

/* the side panel is anchored: the page scrolls, it doesn't. It only scrolls
   itself when your mouse is over it, and never drags the page along. */
.sidebar {
  position: sticky; top: 96px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  display: grid; gap: 16px; align-content: start;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: #cbb9f0 transparent;
}
/* panels must squeeze to fit the column — nothing gets chopped off */
.sidebar > * { min-width: 0; }
.search input[type="search"] { width: 0; }

/* tidy panels so each bit of the page is clearly its own thing */
.search, .cats {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

/* one-line search: the button lives at the end of the box */
.search { display: flex; }
.search input[type="search"] {
  flex: 1; min-width: 0;
  padding: 10px 14px;
  border: 2px solid var(--line-strong);
  border-right: none;
  border-radius: 999px 0 0 999px;
  font: inherit;
  background: var(--white);
}
.search input[type="search"]:focus { border-color: var(--purple); outline: none; }
.search button {
  border: 2px solid var(--purple);
  background: var(--purple); color: #fff;
  border-radius: 0 999px 999px 0;
  padding: 0 16px; font-size: 1rem; font-weight: 800;
  cursor: pointer;
}
.search button:hover { background: var(--purple-strong); border-color: var(--purple-strong); }

.cats h2 { font-size: 0.95rem; margin: 2px 0 10px 6px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1px; }
.cats ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cats a {
  display: block; padding: 10px 14px;
  border-radius: 12px; text-decoration: none;
  color: var(--ink); font-weight: 700;
  border: 1px solid transparent;
}
.cats a:hover { background: var(--lav-50); border-color: var(--line); }
.cats a.active { background: var(--lav-100); border-color: var(--line); }

/* the categories open/close switch (phones only) works with NO JavaScript */
.menu-checkbox {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
}
.menu-checkbox:focus-visible + .menu-toggle { outline: 3px solid var(--purple); outline-offset: 2px; }
.sidebar .menu-toggle { display: none; cursor: pointer; }

/* ---------- intro card ---------- */
/* ---------- full-width bio band: collapses fast behind the header on scroll ---------- */
.bio-band {
  background: var(--lav-50);
  border-bottom: 1px solid var(--line);
  transition: opacity 0.2s ease;
}
.bio-clip {
  overflow: hidden;
  max-height: 400px;
  transition: max-height 0.28s ease;
}
.bio-band.collapsed { opacity: 0; border-bottom-width: 0; }
.bio-band.collapsed .bio-clip { max-height: 0; }
.bio-inner { max-width: 1160px; margin: 0 auto; padding: 16px 20px 18px; }
.bio-title { margin: 0 0 8px; font-size: 1.45rem; }
.bio-inner p { margin: 0; }

.intro {
  background: var(--lav-50);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 20px;
}
.intro p { margin: 0; }
.intro-how { color: var(--ink-soft); }

/* ---------- sort + filter bars ---------- */
.sortbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap; margin: 0 0 16px;
}
.sortbar h1, .sortbar h2 { margin: 0; font-size: 1.4rem; }
.count { color: var(--ink-soft); font-weight: 400; font-size: 1rem; }
.sortform { display: flex; align-items: center; gap: 8px; }
.filters {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: end;
  background: var(--lav-50); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px;
}
.filters .field { display: grid; gap: 4px; }
.filters label { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
select, .filters select {
  font: inherit; padding: 9px 12px;
  border: 2px solid var(--line-strong); border-radius: 10px; background: var(--white); color: var(--ink);
}

/* ---------- product grid: 2 across on desktop, 1 on phones ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.card {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow);
}
.card:hover { border-color: var(--purple); }
.card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--lav-50); }
.card-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.card-title { font-weight: 800; font-size: 1.1rem; }
.price { color: var(--purple-strong); font-weight: 800; font-size: 1.15rem; }
.chip {
  justify-self: start; display: inline-block;
  background: var(--lav-100); border: 1px solid var(--line);
  color: var(--ink-soft); border-radius: 999px;
  padding: 2px 10px; font-size: 0.85rem; font-weight: 700;
  text-decoration: none;
}
.empty {
  text-align: center; padding: 50px 20px; color: var(--ink-soft);
  background: var(--lav-50); border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ---------- product page ---------- */
.backlink { display: inline-block; margin-bottom: 14px; font-weight: 700; text-decoration: none; }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.gallery { display: grid; gap: 12px; }
.gallery img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--lav-50); }
.gallery .thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.product-info h1 { margin: 0 0 6px; font-size: 1.6rem; }
.product-info .price { font-size: 1.5rem; }
.details { margin: 14px 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--ink-soft); }
.details strong { color: var(--ink); }
.buy {
  background: var(--lav-50); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; display: grid; gap: 10px;
}
.buy label { font-weight: 700; }
.buy .note { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
.sold { display: inline-block; background: var(--lav-100); border-radius: 999px; padding: 6px 16px; font-weight: 800; }

/* ---------- buttons ---------- */
.btn, .btn-secondary {
  display: inline-block; cursor: pointer;
  font: inherit; font-weight: 800;
  border-radius: 999px; padding: 12px 22px;
  text-decoration: none; text-align: center;
  border: 2px solid var(--purple);
}
.btn { background: var(--purple); color: #fff; }
.btn:hover { background: var(--purple-strong); border-color: var(--purple-strong); }
.btn-secondary { background: var(--white); color: var(--purple-strong); }
.btn-secondary:hover { background: var(--lav-50); }
.btn-danger { border-color: var(--danger); color: var(--danger); background: var(--white); }
.btn-small { padding: 7px 14px; font-size: 0.92rem; }

/* ---------- quote box + forms ---------- */
.quote, .panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin: 24px 0; background: var(--white);
}
.quote h2 { margin-top: 0; }
form.stack { display: grid; gap: 6px; max-width: 480px; }
form.stack label { font-weight: 700; margin-top: 8px; }
form.stack input, form.stack textarea, form.stack select {
  font: inherit; padding: 11px 14px;
  border: 2px solid var(--line-strong); border-radius: 10px; width: 100%;
  background: var(--white); color: var(--ink);
}
form.stack input:focus, form.stack textarea:focus { border-color: var(--purple); }
form.stack textarea { min-height: 110px; resize: vertical; }
form.stack .btn { margin-top: 14px; justify-self: start; }
.help { color: var(--ink-soft); font-size: 0.88rem; margin: 0; }
.hp { position: absolute !important; left: -9999px; }
.flash { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-weight: 700; }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.err { background: #fbe9ed; color: var(--danger); }

/* ---------- footer ---------- */
.footer { background: var(--lav-50); margin-top: 40px; }
.footer::before {
  content: ''; display: block; height: 3px;
  background: linear-gradient(90deg, var(--lav-100), var(--purple), var(--lav-100));
}
.footer > div, .footer > p { max-width: 1100px; margin: 0 auto; padding: 14px 20px; }
.safety {
  border-bottom: 1px solid var(--line);
  color: var(--ink); font-size: 0.97rem;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-weight: 700; }
.copyright { color: var(--ink-soft); padding-bottom: 26px !important; }

/* ---------- admin ---------- */
.admin-shell { max-width: 980px; margin: 0 auto; padding: 0 20px 60px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 22px 0 10px; }
.admin-head h1 { margin: 0; font-size: 1.6rem; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 12px; margin-bottom: 22px; }
.admin-nav a, .admin-nav button {
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  color: var(--ink); background: none; border: 1px solid transparent;
  padding: 8px 14px; border-radius: 10px;
}
.admin-nav a:hover, .admin-nav button:hover { background: var(--lav-50); border-color: var(--line); }
.admin-nav a.active { background: var(--lav-100); border-color: var(--line); }
.badge { background: var(--purple); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 0.8rem; margin-left: 4px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.admin-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.msg-card.unread { background: var(--lav-50); border-color: var(--purple); }
.msg-meta { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 8px; }
.msg-text { white-space: pre-wrap; margin: 0 0 10px; }
.login-card {
  max-width: 420px; margin: 60px auto; padding: 28px;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  text-align: center;
}
.login-card h1 { margin-top: 0; }
.login-card form { display: grid; gap: 12px; text-align: left; }
.photo-manage { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin: 10px 0; }
.photo-manage figure { margin: 0; }
.photo-manage img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.photo-manage label { font-size: 0.85rem; font-weight: 700; color: var(--danger); display: block; margin-top: 4px; }

/* ---------- phones & small screens ---------- */
@media (max-width: 820px) {
  .topbar-inner { grid-template-columns: 1fr; padding: 8px 14px 6px; gap: 2px; }
  .socials { justify-self: center; justify-content: center; }
  .contact { justify-self: center; }
  .site-name { font-size: 1.5rem; }
  .tagline { display: none; }
  .bio-inner { padding: 12px 16px 14px; }
  .bio-title { font-size: 1.25rem; }
  .shell { grid-template-columns: 1fr; gap: 14px; padding-top: 16px; }
  .sidebar { position: static; max-height: none; overflow: visible; gap: 12px; }
  .sidebar .menu-toggle { display: inline-block; justify-self: start; }
  .cats { display: none; }
  .menu-checkbox:checked ~ .cats { display: block; }
  .grid { grid-template-columns: 1fr; }
  .product { grid-template-columns: 1fr; }
}

/* keep things calm for people who prefer less motion (we barely animate anyway) */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
