:root {
  --bg: #fff; --text: #1a1a1a; --muted: #6b6b6b; --line: #e6e6e6;
  --header: #000; --green: #25a244; --price: #0a7d1f; --warn-bg: #e8f4fd; --warn-text: #1c4e7a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; }

header { background: var(--header); color: #fff; }
.header-in { max-width: 1100px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 700; font-size: 1.15rem; }
.brand img { width: 44px; height: 44px; border-radius: 10px; }
.search { margin-left: auto; display: flex; gap: 6px; flex: 1 1 260px; max-width: 420px; }
.search input { flex: 1; padding: 10px 12px; border: 0; border-radius: 4px; font-size: 1rem; min-width: 0; }
.search button { padding: 10px 14px; border: 0; border-radius: 4px; background: #fff; font-weight: 700; cursor: pointer; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { margin: 0 0 16px; font-size: 1.4rem; }

.btn-wa { display: block; text-align: center; background: var(--green); color: #fff; text-decoration: none; font-weight: 700; padding: 12px; border-radius: 4px; }
.btn-wa:hover { filter: brightness(1.08); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; background: #fff; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.card .thumb { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #fafafa; }
.card .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card .info { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.card .t { font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.price { color: var(--price); font-weight: 700; font-size: 1.25rem; }
.old { color: var(--muted); text-decoration: line-through; font-size: .85rem; margin-right: 6px; font-weight: 400; }
.off { background: #d93025; color: #fff; font-size: .75rem; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.empty { color: var(--muted); padding: 32px 0; }

.product { display: grid; grid-template-columns: 1fr 1fr 340px; gap: 28px; align-items: start; }
.product .pic img { width: 100%; height: auto; border-radius: 6px; }
.product h1 { font-size: 1.6rem; line-height: 1.2; }
.product .price { font-size: 2rem; margin: 12px 0; }
.warn { background: var(--warn-bg); color: var(--warn-text); padding: 10px 12px; border-radius: 4px; font-size: .9rem; }
.buy { display: inline-block; margin: 16px 0; background: #000; color: #fff; text-decoration: none; padding: 14px 30px; font-size: 1.2rem; border-radius: 4px; }
.buy:hover { background: #222; }
.desc { white-space: pre-line; line-height: 1.6; font-size: .95rem; }
.side h2 { margin: 0 0 8px; font-weight: 400; font-size: 1.4rem; padding-bottom: 8px; border-bottom: 2px solid #f1d400; }
.side .btn-wa { margin-top: 14px; }
@media (max-width: 900px) { .product { grid-template-columns: 1fr; } }

/* admin */
.panel { max-width: 720px; margin: 0 auto; }
form.box, .box { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 20px; }
label { display: block; font-size: .85rem; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=url], input[type=number], textarea { width: 100%; padding: 9px 10px; border: 1px solid #ccc; border-radius: 4px; font: inherit; }
textarea { min-height: 110px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { padding: 10px 18px; border: 0; border-radius: 4px; background: #000; color: #fff; font-weight: 700; cursor: pointer; margin-top: 14px; }
.btn.sec { background: #eee; color: #000; }
.btn.del { background: #d93025; }
.msg { margin-top: 10px; font-size: .9rem; }
.msg.err { color: #d93025; } .msg.ok { color: var(--price); }
.item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.item img { width: 56px; height: 56px; object-fit: contain; background: #fafafa; border-radius: 4px; }
.item .meta { flex: 1; min-width: 0; font-size: .9rem; }
.item .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta span { color: var(--muted); font-size: .8rem; }
.item button { margin: 0; padding: 7px 12px; }
