/* ------------------------------------------------------------------
   Change these colors and fonts to restyle the whole shop.
   ------------------------------------------------------------------ */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #6d6860;
  --border: #e4e0d9;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --success-bg: #e5f2ea;
  --notice-bg: #fdf3dc;
  --chart: #23805f;
  --grid: #ebe8e2;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; padding-top: 24px; padding-bottom: 48px; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.muted { color: var(--muted); font-size: 0.92em; font-weight: normal; }
.right { text-align: right; }
.inline { display: inline; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.cart-count { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 0.8em; text-align: center; }
.cart-count[hidden] { display: none; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; padding: 20px 0; }

/* Buttons */
.button {
  display: inline-block; border: 0; border-radius: var(--radius); cursor: pointer;
  background: var(--accent); color: var(--accent-text); padding: 10px 18px;
  font: inherit; font-weight: 600; text-decoration: none;
}
.button:hover { filter: brightness(1.1); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button-big { padding: 14px 26px; font-size: 1.05rem; }
.button-small { padding: 6px 12px; font-size: 0.9rem; }
.button-light { background: transparent; color: var(--accent); border: 1px dashed var(--accent); }
.button-danger { background: var(--danger); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }

/* Messages */
.error, .success, .notice { padding: 12px 16px; border-radius: var(--radius); }
.error { background: #fbe9e7; color: var(--danger); }
.success { background: var(--success-bg); }
.notice { background: var(--notice-bg); }
.error[hidden], .notice[hidden] { display: none; }
.empty { text-align: center; padding: 48px 16px; }

/* Home page */
.hero { text-align: center; padding: 24px 0 32px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0 0 8px; }
.tagline { color: var(--muted); font-size: 1.15rem; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow 0.15s; }
.card:hover { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08); }
.card-image { aspect-ratio: 1 / 1; background: #f0ede8; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px 16px; }
.card-body h2 { font-size: 1.05rem; margin: 0 0 4px; }
.price { font-weight: 700; color: var(--accent); margin: 0; }
.no-image { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 200px; color: var(--muted); background: #f0ede8; }
.about { max-width: 700px; margin: 56px auto 0; text-align: center; }

/* Product page */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.gallery-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.thumb.active { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { margin-top: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.product-info .price { font-size: 1.5rem; }
.summary { color: var(--muted); }
.product-info form { display: flex; flex-direction: column; gap: 8px; max-width: 360px; margin: 20px 0; }
.product-info label { font-weight: 600; font-size: 0.95rem; }
.added { margin: 4px 0 0; }
.added[hidden] { display: none; }
.description { max-width: 760px; margin: 48px auto 0; }
.description img { border-radius: var(--radius); margin: 16px auto; height: auto; }

/* Forms */
input, select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
input:focus, select:focus, textarea:focus, .editor-area:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"] { width: auto; }
.form { display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.form > label { font-weight: 600; margin-top: 16px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); margin-top: 20px; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
legend { font-weight: 700; padding: 0 6px; }
fieldset label { font-weight: 600; margin-top: 8px; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: normal; }
.form-actions { margin-top: 24px; }
.login-box { max-width: 380px; margin: 40px auto; }
.login-box form { display: flex; flex-direction: column; gap: 10px; }

/* Admin */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-list, .cart-list { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-direction: column; gap: 10px; }
.admin-list li, .cart-row { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.admin-thumb { width: 56px; height: 56px; flex: none; border-radius: 8px; overflow: hidden; background: #f0ede8; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-list-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-actions { display: flex; align-items: center; gap: 14px; }
.delete-form { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); max-width: 760px; }

.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px 16px; text-align: center;
  background: var(--surface); cursor: pointer; color: var(--muted); transition: all 0.15s;
}
.dropzone p { margin: 0; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--success-bg); color: var(--text); }
.gallery-edit { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gallery-edit li { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; border: 2px solid var(--border); cursor: grab; background: #f0ede8; }
.gallery-edit li.dragging { opacity: 0.4; }
.gallery-edit li.drop-target { border-color: var(--accent); }
.gallery-edit img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.badge { position: absolute; top: 6px; left: 6px; background: var(--accent); color: var(--accent-text); font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; }
.gallery-controls { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; background: rgba(0, 0, 0, 0.55); }
.gallery-controls button { flex: 1; background: none; border: 0; color: #fff; font-size: 1.1rem; padding: 4px 0; cursor: pointer; }
.gallery-controls button:hover { background: rgba(255, 255, 255, 0.15); }

.variant-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.variant-row { display: flex; gap: 8px; align-items: center; }
.variant-row .v-name { flex: 2; }
.price-input { flex: 1; display: flex; align-items: center; gap: 4px; }
.price-input span { color: var(--muted); }

.editor { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--border); background: #f6f4f0; }
.toolbar button { font: inherit; font-size: 0.9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.toolbar button:hover { border-color: var(--accent); }
.editor-area { min-height: 240px; padding: 14px 16px; }
.editor-area:empty::before { content: "Describe your product… drag photos right into this box."; color: var(--muted); }
.editor-area.over { background: var(--success-bg); }
.editor-area img { max-width: 100%; height: auto; border-radius: 8px; margin: 10px 0; }
.editor-area img.uploading { opacity: 0.5; }
.upload-status { margin: 12px 0 0; color: var(--muted); }
.upload-status[hidden] { display: none; }

/* Cart */
.cart-info { flex: 1; min-width: 0; }
.qty-input { width: 72px; }
.cart-line { width: 90px; text-align: right; font-weight: 600; }
.cart-total { display: flex; justify-content: flex-end; gap: 24px; font-size: 1.2rem; }

/* Admin nav */
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* Reports */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 20px 0; }
.stat { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: inherit; text-decoration: none; }
.stat strong { font-size: 1.6rem; line-height: 1.2; }
.stat-label { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-link:hover { border-color: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 16px 0; min-width: 0; }
.panel h2 { font-size: 1.15rem; margin: 0 0 8px; }
.panel h3 { font-size: 1rem; margin: 16px 0 4px; }
.panel-sub { margin: -4px 0 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col > .panel { margin: 0; }
.two-col + .panel, .two-col + form { margin-top: 16px; }

.chart { position: relative; padding-left: 44px; }
.chart-grid { position: absolute; left: 0; right: 0; top: 0; height: 220px; }
.chart-gridline { position: absolute; left: 44px; right: 0; border-top: 1px solid var(--grid); }
.chart-gridline span { position: absolute; left: -44px; width: 38px; top: -0.6em; text-align: right; font-size: 0.75rem; color: var(--muted); }
.chart-cols { position: relative; height: 220px; display: flex; align-items: flex-end; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.chart-col.active, .chart-col:focus-visible { background: rgba(0, 0, 0, 0.04); }
.chart-bar { width: 60%; max-width: 24px; background: var(--chart); border-radius: 4px 4px 0 0; }
.chart-labels { display: flex; margin-top: 6px; }
.chart-labels span { flex: 1; text-align: center; font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: visible; }
.chart-tip { position: absolute; top: -8px; background: var(--text); color: #fff; font-size: 0.85rem; padding: 6px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; z-index: 2; }
.chart-tip[hidden] { display: none; }
.table-view { margin-top: 12px; }
.table-view summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.table tfoot td { border-bottom: 0; padding-top: 6px; padding-bottom: 6px; }
.table tr.strong td { font-weight: 700; border-top: 1px solid var(--border); }
.table .num { text-align: right; white-space: nowrap; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f6f4f0; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 12px; }
.address { line-height: 1.5; }

.pill { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: #f6f4f0; color: var(--text); white-space: nowrap; }
.pill-unfulfilled { background: var(--notice-bg); border-color: #efd9a6; }
.pill-shipped, .pill-delivered { background: var(--success-bg); border-color: #bcdcc8; }
.pill-muted, .pill-cancelled { color: var(--muted); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.filters a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-size: 0.9rem; }
.filters a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* Phones */
@media (max-width: 720px) {
  .product { grid-template-columns: 1fr; gap: 24px; }
  .product-info form { max-width: none; }
  .variant-row { flex-wrap: wrap; }
  .variant-row .v-name { flex-basis: 100%; }
  .cart-row { flex-wrap: wrap; }
  .cart-info { flex-basis: calc(100% - 70px); }
  .admin-list li { flex-wrap: wrap; }
  .admin-actions { width: 100%; justify-content: flex-end; }
  .two-col { grid-template-columns: 1fr; }
  .chart-labels span:nth-child(even) { visibility: hidden; }
}
