/* Chelsea Gets Crafty - storefront + admin styles */
:root {
  --bg: #fbf7f2;
  --paper: #ffffff;
  --ink: #3f2e22;
  --kraft: #6b4f3a;
  --kraft-light: #a98b74;
  --line: #eadfd3;
  --accent: #c96f86;
  --accent-ink: #ffffff;
  --sage: #9db39a;
  --sage-dark: #5e7f5a;
  --danger: #c0392b;
  --shadow: 0 6px 20px rgba(107, 79, 58, 0.10);
  --radius: 16px;
  --display: "Caveat", "Segoe Script", cursive;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; width: 100%; }
img { max-width: 100%; display: block; }
a { color: var(--kraft); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); color: var(--kraft); font-weight: 700; line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: 2.6rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.6rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--kraft-light); }
.small { font-size: .875rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { justify-content: space-between; }

/* announcement + header */
.announce {
  background: var(--accent); color: var(--accent-ink);
  text-align: center; padding: 8px 16px; font-size: .9rem; font-weight: 600;
}
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { font-family: var(--display); font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.brand:hover { color: var(--kraft); }
.brand-sm { font-size: 1.6rem; }
.nav-toggle { display: none; }
.nav-burger { display: flex; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer; }
.nav-burger span { width: 24px; height: 3px; background: var(--kraft); border-radius: 2px; }
.site-nav { display: none; width: 100%; flex-direction: column; padding: 10px 0 4px; border-top: 1px solid var(--line); margin-top: 10px; }
.nav-toggle:checked ~ .site-nav { display: flex; }
.site-nav a { padding: 10px 4px; font-weight: 700; border-bottom: 1px solid var(--line); }
.site-nav a:last-child { border-bottom: 0; }
.cart-badge {
  display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: .8rem; text-align: center;
}
@media (min-width: 760px) {
  .nav-burger { display: none; }
  .site-nav { display: flex !important; flex-direction: row; gap: 4px; width: auto; border: 0; margin: 0; padding: 0; align-items: center; }
  .site-nav a { border: 0; padding: 8px 12px; border-radius: 999px; }
  .site-nav a:hover { background: var(--bg); }
}

/* flashes */
.flashes { margin-top: 14px; }
.flash { padding: 10px 14px; border-radius: 12px; margin-bottom: 8px; font-weight: 600; }
.flash-ok { background: #eef4ec; color: var(--sage-dark); border: 1px solid #d3e2d0; }
.flash-error { background: #fbe9e7; color: var(--danger); border: 1px solid #f3cfca; }

/* buttons */
.btn {
  display: inline-block; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: 11px 22px; border-radius: 999px; font-family: var(--body); font-weight: 800; font-size: 1rem;
  cursor: pointer; text-align: center; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-lg { padding: 14px 30px; font-size: 1.1rem; }
.btn-sm { padding: 7px 14px; font-size: .875rem; }
.btn-block { display: block; width: 100%; }
.btn-ghost { background: transparent; color: var(--kraft); border-color: var(--line); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn-danger { color: var(--danger); border-color: #f3cfca; background: transparent; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* hero */
.hero { text-align: center; padding: 56px 12px 40px; }
.hero-title { font-size: 3.6rem; color: var(--accent); margin-bottom: .2em; }
.hero-tag { font-size: 1.15rem; color: var(--kraft); max-width: 560px; margin: 0 auto 24px; }
@media (min-width: 760px) { .hero { padding: 80px 12px 56px; } .hero-title { font-size: 5rem; } }

/* sections + grid */
.section { padding: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h1, .section-head h2 { margin: 0; }
.see-all { font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 22px; } }

.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.product-card { display: flex; flex-direction: column; overflow: hidden; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(107, 79, 58, 0.16); color: var(--ink); }
.card-img { aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.product-card:hover .card-img img { transform: scale(1.04); }
.img-placeholder { width: 100%; height: 100%; min-height: 120px; display: flex; align-items: center; justify-content: center; color: var(--kraft-light); background: var(--line); font-size: .9rem; }
.card-body { padding: 12px 14px 14px; }
.card-title { font-weight: 700; margin: 2px 0 6px; line-height: 1.3; }
.price { font-weight: 800; color: var(--kraft); }
.price-lg { font-size: 1.7rem; }
.compare { text-decoration: line-through; color: var(--kraft-light); margin-left: 10px; }
.sale-badge { display: inline-block; margin-left: 10px; padding: 2px 8px; border-radius: 999px; background: var(--accent, #c96f86); color: #fff; font-size: 0.75rem; font-weight: 600; vertical-align: middle; }
.etsy-line { margin-top: 10px; }

.empty { text-align: center; padding: 40px 12px; }
.empty p { font-size: 1.1rem; margin-bottom: 18px; }
.about-teaser { padding: 28px; text-align: center; }
.about-teaser p { max-width: 640px; margin: 0 auto 18px; }

/* search */
.search { display: flex; gap: 6px; }
.search input { width: 180px; }

/* product page */
.crumbs { padding: 14px 0 0; }
.product { display: grid; gap: 24px; padding: 18px 0 10px; }
@media (min-width: 820px) { .product { grid-template-columns: 1.1fr 1fr; gap: 40px; } }
.gallery .main-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--line); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; opacity: .8; }
.thumb:hover, .thumb.active { border-color: var(--accent); opacity: 1; }
.product-title { font-size: 2.3rem; }
.price-row { display: flex; align-items: baseline; margin-bottom: 14px; }
.buy-form { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); }
.ship-line { margin-top: 12px; }
.desc { margin-top: 18px; }
.desc p { margin-bottom: .8em; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.field span { font-size: .95rem; }
.field em { font-weight: 400; font-style: normal; }
input[type="text"], input[type="search"], input[type="number"], input[type="email"], input[type="password"],
input[type="url"], input[type="color"], select, textarea {
  font-family: var(--body); font-size: 1rem; color: var(--ink);
  padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; width: 100%;
  min-height: 44px;
}
input[type="color"] { padding: 4px; width: 64px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201, 111, 134, 0.18); }
.field-qty input { max-width: 120px; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }

/* cart */
.cart-layout { display: grid; gap: 20px; }
@media (min-width: 880px) { .cart-layout { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.cart-line { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 14px; margin-bottom: 12px; }
.cart-thumb img, .cart-thumb .img-placeholder { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }
.cart-title { font-weight: 800; font-size: 1.05rem; }
.opt-list { list-style: none; padding: 0; margin: 4px 0; }
.cart-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cart-actions input[type="number"] { width: 76px; min-height: 38px; padding: 6px 10px; }
@media (min-width: 640px) {
  .cart-line { grid-template-columns: 96px 1fr auto; }
  .cart-thumb img, .cart-thumb .img-placeholder { width: 96px; height: 96px; }
  .cart-actions { grid-column: auto; flex-direction: column; align-items: flex-end; }
}
.totals { padding: 20px; position: sticky; top: 90px; }
.tot-row { display: flex; justify-content: space-between; padding: 6px 0; }
.tot-grand { border-top: 2px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: 1.2rem; }
.totals form { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.trust { text-align: center; margin: 12px 0 0; }

/* success + prose */
.success-card { max-width: 620px; margin: 20px auto; padding: 32px; text-align: center; }
.order-items { list-style: none; padding: 0; margin: 16px 0; text-align: left; }
.order-items li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.success-card .btn { margin-top: 18px; }
.prose { max-width: 720px; }
.prose p { font-size: 1.05rem; }
.contact-list { list-style: none; padding: 0; }
.contact-list li { padding: 4px 0; }

/* footer */
.site-footer { background: var(--paper); border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 0 18px; }
.footer-inner { display: grid; gap: 20px; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { font-weight: 600; }
.footer-bottom { margin-top: 22px; font-size: .85rem; }
.footer-bottom a { color: var(--kraft-light); }

/* ---------------- admin ---------------- */
.admin { padding: 18px 0 40px; }
.admin h1 { font-size: 2.2rem; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 22px; border-bottom: 2px solid var(--line); padding-bottom: 10px; }
.admin-nav a { padding: 8px 14px; border-radius: 999px; font-weight: 700; background: var(--paper); border: 1px solid var(--line); font-size: .92rem; }
.admin-nav a.active, .admin-nav a:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.admin .card { padding: 18px; margin-bottom: 18px; }
.admin table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); overflow: hidden; font-size: .92rem; }
.admin th, .admin td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin th { background: var(--bg); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--kraft-light); }
.admin tbody tr:nth-child(even) { background: #fdfaf6; }
.admin tbody tr:hover { background: #fbf1ec; }
.admin td input[type="text"], .admin td input[type="number"] { min-height: 36px; padding: 6px 8px; font-size: .92rem; }
.admin td input.w-s { width: 90px; }
.admin td input.w-m { width: 150px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.thumb-sm { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 180px 1fr; align-items: start; } .form-grid > label.field { display: contents; } }
.form-grid .field span:first-child { padding-top: 10px; }
.form-grid .full { grid-column: 1 / -1; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--kraft-light); }
.stat .value { font-size: 1.8rem; font-weight: 800; color: var(--kraft); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; text-transform: capitalize; background: #eee; color: #666; }
.badge-pending { background: #eeeae5; color: #7a6a5c; }
.badge-paid { background: #e3edf7; color: #2e5f8f; }
.badge-shipped { background: #e6f0e4; color: var(--sage-dark); }
.badge-cancelled, .badge-failed, .badge-refunded { background: #fbe9e7; color: var(--danger); }
.login-card { max-width: 380px; margin: 60px auto; padding: 28px; text-align: center; }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.img-admin-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.img-admin-grid figure { margin: 0; width: 110px; text-align: center; font-size: .8rem; }
.img-admin-grid img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.help { font-size: .85rem; color: var(--kraft-light); font-weight: 400; }
pre.plain { white-space: pre-wrap; font-family: var(--body); background: var(--bg); padding: 12px; border-radius: 12px; }
