:root { --brand: #0f6f5f; --ink: #251f21; --ink2: #585254; --hairline: #eae9ea; --page: #ffffff; --sand: #f4efec; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--sand); }
h2.sect { font-size: 16px; margin: 22px 0 10px; }
a { color: var(--brand); }

/* badges, buttons, forms */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; background: #efe9e6; font-size: 12px; font-weight: 600; color: var(--ink2); }
.badge.ok { background: #e2f2ec; color: #0f6f5f; }
.badge.bad, .bad { background: #fbe9e7; color: #b3261e; }
.badge.info { background: #e7eefc; color: #2a4d9b; }
button.action, .linkbtn { padding: 10px 16px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; transition: filter .15s, transform .1s; }
button.action:hover, .linkbtn:hover { filter: brightness(1.08); }
button.action:active, .linkbtn:active { transform: scale(.98); }
button.action:disabled, .linkbtn:disabled { opacity: .5; cursor: default; filter: none; transform: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 1px; }
button.action.big { width: 100%; padding: 14px; font-size: 16px; margin-top: 10px; }
button.linkbtn.muted, .linkbtn.muted { background: #efe9e6; color: var(--ink); }
.linkbtn.danger { background: #b3261e; color: #fff; }
input, textarea, select { padding: 10px; border: 1px solid var(--hairline); border-radius: 8px; font-size: 14px; flex: 1; min-width: 110px; font-family: inherit; }
input[type=color] { flex: 0 0 52px; padding: 4px; height: 42px; }
label { display: block; margin: 8px 0; font-size: 14px; }
label input { width: 100%; margin-top: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; align-items: center; }
.panel { background: var(--page); border-radius: 12px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(37,31,33,.06); }
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.notice { background: #fdf6e3; border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #6b5d1a; margin-bottom: 12px; }
.hint { color: var(--ink2); font-size: 12.5px; margin: 6px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--page); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
tbody tr:hover { background: #faf7f5; }
th { color: var(--ink2); font-weight: 600; font-size: 12px; }
td.r, th.r, .r { text-align: right; float: none; }
tr.total td { font-weight: 700; }
.thumb { width: 44px; height: 44px; object-fit: contain; background: #faf7f5; border-radius: 6px; }
.stat { display: inline-block; background: var(--page); border-radius: 10px; padding: 12px 16px; margin: 0 8px 8px 0; }
.stat b { display: block; font-size: 20px; }
.stat span { color: var(--ink2); font-size: 12px; }
.statgrid { margin-bottom: 6px; }

/* auth */
body.auth { display: grid; place-items: center; min-height: 100vh; }
.authbox { background: var(--page); padding: 28px; border-radius: 16px; width: min(420px, 92vw); box-shadow: 0 4px 24px rgba(37,31,33,.10); max-height: 92vh; overflow-y: auto; }
.authbox h1 { margin: 0 0 6px; font-size: 22px; }
.authbox form { margin-top: 14px; }
.formerror { background: #fbe9e7; color: #b3261e; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; }

/* admin layout */
.adminhead { background: var(--page); border-bottom: 1px solid var(--hairline); padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.adminhead h1 { margin: 0; font-size: 20px; }
.adminhead p { margin: 3px 0 0; color: var(--ink2); font-size: 13px; }
.headright { display: flex; gap: 8px; align-items: center; }
.headright select { flex: 0 0 auto; }
.tabs { display: flex; gap: 4px; overflow-x: auto; background: var(--page); border-bottom: 1px solid var(--hairline); padding: 0 12px; }
.tabs button { border: 0; background: none; padding: 13px 14px; font-size: 14.5px; font-weight: 600; color: var(--ink2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.admin main, main.narrow { max-width: 980px; margin: 0 auto; padding: 16px; }

/* POS */
.pos { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 820px) { .pos { grid-template-columns: 1.5fr 1fr; } }
.posgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.positem { background: var(--page); border: 1px solid var(--hairline); border-radius: 10px; padding: 10px; cursor: pointer; text-align: left; font-size: 13px; display: flex; flex-direction: column; gap: 4px; min-height: 86px; transition: border-color .15s, box-shadow .15s; }
.positem:hover:not(:disabled) { border-color: var(--brand); box-shadow: 0 2px 8px rgba(37,31,33,.08); }
.positem img { width: 100%; height: 56px; object-fit: contain; }
.positem b { color: var(--brand); }
.positem i { color: #b3261e; font-style: normal; font-size: 11.5px; }
.positem:disabled { opacity: .45; cursor: default; }
.posright { background: var(--page); border-radius: 12px; padding: 14px; height: fit-content; position: sticky; top: 12px; }
.posright h2 { margin: 0 0 10px; font-size: 16px; }
.cartline { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.qtyctl { display: inline-flex; align-items: center; gap: 8px; }
.qtyctl button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--sand); cursor: pointer; font-size: 15px; }
.carttotal { font-size: 17px; margin: 12px 0 6px; }
.heldrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px dashed var(--brand); background: #eef7f4; color: var(--brand); border-radius: 20px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }

/* orders */
.ordercard { background: var(--page); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(37,31,33,.06); }
.ohead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ohead .r { margin-left: auto; font-weight: 700; }
.obody { color: var(--ink2); font-size: 13.5px; margin: 7px 0; }
.oactions { display: flex; gap: 8px; flex-wrap: wrap; }
.oactions .action, .oactions .linkbtn { padding: 7px 12px; font-size: 13px; }

/* public catalog - warm paper, ink, brand-flame storefront */
body.catalog { background: #F7F3EC; }
.catalog .shophead { padding: 18px 16px 0; max-width: 1040px; margin: 0 auto; }
.brandbar { display: flex; align-items: center; gap: 10px; padding: 2px 2px 16px; }
.brandname { font-weight: 800; letter-spacing: .1em; font-size: 15px; text-transform: uppercase; }
.brandsub { font-size: 12px; color: var(--ink2); }
.catalog .hero { background: #23201B; color: #f6efe4; border-radius: 20px; padding: 24px 20px; display: grid; gap: 18px; overflow: hidden; }
.savepill { display: inline-block; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .09em; padding: 6px 12px; border-radius: 999px; margin-bottom: 12px; }
.catalog .hero h1 { margin: 0 0 8px; font-size: 29px; line-height: 1.14; font-weight: 800; letter-spacing: -0.01em; }
.herosub { margin: 0 0 14px; font-size: 13.5px; color: #cfc6b8; }
.herophoto { border-radius: 14px; background: #1c1915; display: flex; align-items: center; justify-content: center; padding: 10px; aspect-ratio: 4 / 3; }
.herophoto img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.wabutton { display: inline-block; background: var(--brand); color: #fff; text-decoration: none; padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 14.5px; transition: filter .15s; }
.wabutton:hover { filter: brightness(1.08); }
.filterbar { position: sticky; top: 0; z-index: 4; background: #F7F3EC; padding: 14px 0 2px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 0; max-width: 1040px; margin: 0 auto; align-items: center; }
.cat { border: 1.5px solid #e5ddd0; background: transparent; border-radius: 999px; padding: 8px 14px; min-height: 40px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.cat.on { background: #23201B; color: #f6efe4; border-color: #23201B; }
.catalog .grid { display: grid; gap: 14px; padding: 14px 16px 90px; grid-template-columns: 1fr 1fr; max-width: 1040px; margin: 0 auto; }
@media (max-width: 420px) { .catalog .grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 10px 90px; } }
@media (min-width: 900px) { .catalog .grid { grid-template-columns: 1fr 1fr 1fr; } }
.card { background: #fffdf9; border: 1px solid #e5ddd0; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s, transform .18s; }
@media (hover: hover) { .card:hover { box-shadow: 0 6px 18px rgba(35,32,27,.10); transform: translateY(-2px); } }
.photobtn { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; padding: 8px; border: 0; width: 100%; cursor: zoom-in; }
.card img.zoomable { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; display: block; }
.numtag { position: absolute; top: 8px; left: 8px; background: rgba(255,253,249,.92); color: var(--ink); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.nophoto { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: var(--ink2); background: #f1ece4; font-size: 13px; }
.cardbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.brandline { margin: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); }
.cardbody h2 { margin: 0; font-size: 15.5px; font-weight: 800; line-height: 1.25; }
.desc { margin: 0; color: var(--ink2); font-size: 12px; white-space: pre-line; line-height: 1.55; }
.pricerow { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.price { font-size: 19px; font-weight: 800; }
.mrp { font-size: 12.5px; color: var(--ink2); text-decoration: line-through; }
.save { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: 3px 8px; border-radius: 999px; }
.pricerow .badge { margin-left: auto; }
.ask { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-size: 14.5px; font-weight: 700; cursor: pointer; transition: filter .15s; margin-top: auto; text-align: center; display: block; text-decoration: none; }
.ask:hover:not(:disabled) { filter: brightness(1.08); }
.ask:disabled { background: #c9c4c2; cursor: default; }
.wa-order { background: #23201B; }
.empty { padding: 28px 16px; color: var(--ink2); }
.cfoot { text-align: center; color: var(--ink2); font-size: 12px; padding: 16px 0 90px; }
.lightbox { position: fixed; inset: 0; background: rgba(24,21,17,.93); z-index: 20; display: grid; place-items: center; padding: 18px; cursor: zoom-out; overflow: auto; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; background: #fff; }
.lightbox img.full { max-width: none; max-height: none; cursor: grab; margin: auto; }
.lbhint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.14); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; pointer-events: auto; }
.lbclose { position: absolute; top: 14px; right: 16px; background: var(--brand); color: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 17px; cursor: pointer; }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; background: #23201B; color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; z-index: 5; }
.cartgo { background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; }
.cartmodal { position: fixed; inset: 0; background: rgba(24,21,17,.5); z-index: 6; display: grid; place-items: end center; }
.cartsheet { background: #fffdf9; border-radius: 16px 16px 0 0; width: min(560px, 100%); padding: 20px; max-height: 86vh; overflow-y: auto; }
.cartsheet h2 { margin: 0 0 10px; }
@media (min-width: 760px) {
  .catalog .shophead { padding: 26px 28px 0; }
  .catalog .hero { grid-template-columns: 1.1fr 1fr; align-items: center; padding: 34px 36px; gap: 32px; }
  .catalog .hero h1 { font-size: 38px; }
  .herosub { font-size: 14.5px; }
}

/* order status steps */
.steps { display: flex; gap: 0; list-style: none; padding: 0; margin: 18px 0; }
.steps li { flex: 1; text-align: center; font-size: 12.5px; color: var(--ink2); padding-top: 14px; position: relative; }
.steps li::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: #d8d2cf; }
.steps li.done { color: var(--brand); font-weight: 600; }
.steps li.done::before { background: var(--brand); }

/* receipt */
body.receipt { background: #ece7e4; }
.slip { max-width: 380px; margin: 26px auto; background: #fff; padding: 22px; border-radius: 6px; font-size: 13.5px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.slip h1 { font-size: 18px; margin: 0 0 4px; }
.slip .center { text-align: center; }
.slip hr { border: 0; border-top: 1px dashed #ccc; margin: 10px 0; }
@media print { .noprint { display: none; } body.receipt { background: #fff; } .slip { box-shadow: none; margin: 0; } }
.varsel { width: 100%; margin: 4px 0 8px; }
.varrow input { min-width: 90px; }
.newshoppanel { margin: 12px 16px 0; }
.gbtn { display: block; text-align: center; text-decoration: none; margin: 10px 0; }
.hint.center { text-align: center; }
.tabswrap { position: relative; }
.tabswrap::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 36px; background: linear-gradient(to right, rgba(245,240,235,0), var(--page)); pointer-events: none; }
.tabs { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
a.action.gbtn { background: var(--brand); color: #fff; border-radius: 10px; padding: 12px; font-weight: 700; }
.planpick { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.planpick input { margin-top: 4px; }
.planpick { justify-content: flex-start; }
.planpick input[type=radio] { width: auto; flex: none; }
.planpick.disabled { opacity: 0.55; cursor: not-allowed; }

@media print {
  .adminhead, .tabs, .noprint, button { display: none !important; }
  body { background: #fff; }
  .panel, .card { border: none; box-shadow: none; }
}
.panel label.hint { display: flex; align-items: center; gap: 8px; }
.panel label.hint input[type=checkbox] { width: auto; flex: none; margin: 0; }
.varaxes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.varaxis { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.varaxis-sel { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.varstock { width: 100%; }

/* the hidden attribute must always win over component display rules */
[hidden] { display: none !important; }
.mapbtn { display: inline-block; background: #fff; color: var(--brand); border: 2px solid var(--brand); text-decoration: none; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14.5px; margin: 0 0 8px 10px; transition: filter .15s; }
.mapbtn:hover { filter: brightness(0.95); }
.cmp { margin-top: 8px; border: 1px dashed var(--brand); border-radius: 10px; padding: 7px 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.cmptag { font-weight: 700; color: var(--brand); }
.cmpitem { color: #555; }
a.cmpitem { color: var(--brand); text-decoration: underline; }
.cmpsave { color: #1a7f37; font-weight: 700; }
.cmp-low { border-style: solid; border-color: #1a7f37; background: #eff8f0; }
.cmpmore, .cmpsame { color: #999; font-size: 12px; }
.specbox { background: #fbf8f1; border: 1px solid #ece2cf; border-radius: 12px; padding: 10px 12px; margin: 6px 0 2px; display: grid; grid-template-columns: 84px 1fr; row-gap: 7px; column-gap: 10px; box-shadow: 0 1px 2px rgba(60, 40, 10, .05); }
.specline { display: contents; font-size: 13px; line-height: 1.5; }
.speclabel { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); padding-top: 2px; }
.specval { color: #26221c; font-weight: 500; }
.cardbody h2 { letter-spacing: -.01em; }
@media (max-width: 420px) { .specbox { grid-template-columns: 70px 1fr; padding: 8px 9px; column-gap: 8px; } .specval { font-size: 12px; } }

.grid.single { grid-template-columns: 1fr; max-width: 480px; margin: 18px auto; padding: 0 12px; }
.backlink { text-align: center; margin: 4px 0 22px; }
.backlink a { color: var(--brand); font-weight: 600; text-decoration: none; }
.widebox { background: var(--page); padding: 28px; border-radius: 16px; width: min(1100px, 94vw); box-shadow: 0 4px 24px rgba(37,31,33,.10); margin: 24px auto; overflow-x: auto; }
.widebox h1 { margin: 0 0 6px; font-size: 22px; }
.widebox table td, .widebox table th { vertical-align: top; }
