/* "Commodore 64/128" theme.
   The whole page is a C64 screen: light-blue border, blue screen, a BASIC boot banner and a blinking cursor. Window title bars are
   reverse video (RVS ON), the category list is a disk directory (21 "INDIVIDUAL COMPUTERS" DIR), form messages are BASIC errors
   ("?" ... READY.). The "GO 128" button swaps the palette for a C128 80-column green-phosphor display.
   Type: Sixtyfour (an 8x8 home-computer face) for the chrome and Tiny5 for reading text — both SIL OFL, self-hosted in assets/fonts/.
   CSS + inline SVG only. */

@font-face { font-family: "Sixtyfour"; src: url("fonts/sixtyfour.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Tiny5"; src: url("fonts/tiny5.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {                       /* C64 palette (Pepto), with the light blue brightened a little so body text is comfortable to read */
    --border: #7869c4;
    --screen: #40318d;
    --screen2: #352879;
    --dark: #2b2070;
    --dim: #5a4cae;
    --text: #bdb4f9;
    --white: #ffffff;
    --yellow: #bfce72;
    --link: #8fe0ea;
    --ok: #94e089;
    --err: #ff9a92;
    --rev: #1a1250;           /* text on a light-blue (reverse video) bar */
    --chrome: "Sixtyfour", "C64 Pro Mono", "Courier New", monospace;
    --body: "Tiny5", "Courier New", monospace;
    --mono: var(--body);
}
html[data-mode="128"] {       /* C128, 80-column monitor */
    --border: #2bd14f;
    --screen: #000000;
    --screen2: #04130a;
    --dark: #031a0c;
    --dim: #147a2c;
    --text: #6bff8e;
    --white: #d9ffe3;
    --yellow: #e6ff6a;
    --link: #7dffe0;
    --ok: #6bff8e;
    --err: #ff9a82;
    --rev: #000000;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--border); scrollbar-color: var(--border) var(--screen2); }
body { margin: 0; padding: 22px; background: var(--border); min-height: 100vh; font: 20px/1.3 var(--body); color: var(--text); }
@media (max-width: 640px) { body { padding: 8px; } }
.screen { position: relative; background: var(--screen); min-height: calc(100vh - 44px); display: flex; flex-direction: column; }
@media (max-width: 640px) { .screen { min-height: calc(100vh - 16px); } }
/* faint scanlines */
.screen::after { content: ""; position: fixed; inset: 22px; pointer-events: none; z-index: 60; background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.04) 2px 3px); }
@media (max-width: 640px) { .screen::after { inset: 8px; } }

a { color: var(--link); }
a:hover { background: var(--border); color: var(--rev); text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--chrome); font-weight: 400; line-height: 1.5; margin: 0 0 .6em; color: var(--white); text-transform: uppercase; }
h1 { font-size: 18px; } h2 { font-size: 14px; } h3 { font-size: 12px; }
p { margin: 0 0 .7em; }
.mono { font-family: var(--body); }
.muted { color: var(--text); opacity: .8; }
.small { font-size: 17px; }
.sr { position: absolute; left: -9999px; }

::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--screen2); border-left: 2px solid var(--border); }
::-webkit-scrollbar-thumb { background: var(--border); border: 2px solid var(--screen2); }
::-webkit-scrollbar-corner { background: var(--screen2); }

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ---- Boot banner + command line (the menu bar) ---- */
.boot { padding: 16px 18px 0; }
.banner { display: flex; align-items: center; justify-content: center; gap: 12px; text-decoration: none; color: var(--text); font: 13px/1.4 var(--chrome); letter-spacing: .02em; text-align: center; flex-wrap: wrap; }
.banner:hover { background: none; color: var(--white); }
.banner svg { width: 40px; height: 28px; flex: none; }
.sys { text-align: center; font: 11px/1.8 var(--chrome); color: var(--text); margin: 4px 0 6px; }
.sys .m128, html[data-mode="128"] .sys .m64 { display: none; }
html[data-mode="128"] .sys .m128 { display: inline; }
.menubar { border-top: 3px solid var(--border); border-bottom: 3px solid var(--border); font: 11px/1 var(--chrome); letter-spacing: .02em; margin: 0 -18px; padding: 0 18px; }
.menubar-in { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; min-height: 36px; }
.menubar a, .menubar summary { color: var(--text); text-decoration: none; padding: 0 12px; display: inline-flex; align-items: center; min-height: 36px; cursor: pointer; list-style: none; text-transform: uppercase; }
.menubar summary::-webkit-details-marker { display: none; }
.menubar a:hover, .menubar summary:hover, .menubar details[open] > summary { background: var(--border); color: var(--rev); }
.ready { display: inline-flex; align-items: center; padding-right: 14px; color: var(--white); }
.ready::after { content: "\2588"; margin-left: 4px; animation: blink 1.06s steps(1) infinite; }
.menubar .spacer { flex: 1; }
.menu { position: relative; display: flex; }
.menu-list { position: absolute; top: 100%; left: 0; background: var(--screen); border: 3px solid var(--border); min-width: 270px; padding: 4px; max-height: 70vh; overflow: auto; z-index: 70; margin-top: 3px; }
.menu-list a { display: flex; justify-content: space-between; gap: 14px; width: 100%; padding: 8px 10px; min-height: 0; font: 11px/1.4 var(--chrome); }
.menu-list .n { color: var(--yellow); }
.menu-list a:hover .n { color: var(--rev); }
.menu-list hr { border: 0; border-top: 2px dashed var(--dim); margin: 4px 0; }
.search { display: flex; align-items: center; padding: 0 8px; }
.search input { width: 150px; padding: 4px 8px; font-size: 18px; }
.cartlink b { background: var(--yellow); color: var(--rev); padding: 3px 6px; margin-left: 8px; font: 10px/1 var(--chrome); }
.cartlink:hover b { background: var(--screen); color: var(--white); }
.modebtn { font: 10px/1 var(--chrome); color: var(--yellow); background: transparent; border: 2px solid var(--yellow); padding: 0 10px; margin: 6px 0 6px 8px; cursor: pointer; letter-spacing: .02em; }
.modebtn:hover { background: var(--yellow); color: var(--rev); }

/* ---- Page frame ---- */
.desktop { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 18px 36px; }
.cols { display: grid; grid-template-columns: 290px 1fr; gap: 24px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.stack > * + * { margin-top: 24px; }
@media (max-width: 860px) { .cols, .cols-2 { grid-template-columns: 1fr; } }

/* ---- Windows: a bordered box with a reverse-video title bar ---- */
.win { position: relative; background: var(--screen); border: 3px solid var(--border); }
.win-title { display: flex; align-items: center; min-height: 28px; padding: 3px 12px; background: var(--border); color: var(--rev); cursor: default; }
.win-title h2, .win-title h1, .win-title .t { margin: 0; padding: 0; font: 12px/1.4 var(--chrome); letter-spacing: .02em; color: var(--rev); text-transform: uppercase; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.win-body { margin: 0; padding: 16px; background: transparent; }
.win-body.paper { background: var(--screen2); border: 2px solid var(--dim); margin: 10px; }
.win-status { border-top: 2px dashed var(--dim); padding: 6px 12px; font-size: 17px; display: flex; justify-content: space-between; gap: 10px; }
.win.shaded > :not(.win-title) { display: none; }
/* inactive windows (cards, sidebar): outlined title until you point at them */
.card > .win-title, aside.win > .win-title { background: transparent; border-bottom: 3px solid var(--border); }
.card > .win-title .t, aside.win > .win-title h2 { color: var(--text); }
.card:hover > .win-title, .card:focus-within > .win-title, aside.win:hover > .win-title { background: var(--border); }
.card:hover > .win-title .t, .card:focus-within > .win-title .t, aside.win:hover > .win-title h2 { color: var(--rev); }
.infobar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 14px; font-size: 18px; color: var(--yellow); border-bottom: 2px dashed var(--dim); }

/* ---- Buttons: reverse-video blocks ---- */
.btn, button.btn { font: 11px/1.3 var(--chrome); letter-spacing: .02em; color: var(--rev); text-transform: uppercase; text-decoration: none; display: inline-block; cursor: pointer; padding: 9px 14px 8px; min-height: 32px; text-align: center; background: var(--border); border: 0; border-radius: 0; margin: 2px; }
.btn:hover { background: var(--white); color: var(--rev); }
.btn:active { background: var(--yellow); }
.btn.default { background: var(--yellow); color: #2a1f6b; }
.btn.default:hover { background: var(--white); }
.btn[disabled], .btn.off { background: transparent; color: var(--dim); outline: 2px dashed var(--dim); outline-offset: -2px; cursor: not-allowed; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn.link { background: none; color: var(--link); text-decoration: underline; padding: 0; min-height: 0; font: 18px/1 var(--body); text-transform: none; margin: 0; }
.btn.link:hover { background: var(--border); color: var(--rev); }
/* fields: a light-blue frame and a block cursor */
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=number], select, textarea {
    font: 20px/1.2 var(--body); color: var(--white); background: var(--dark); border: 2px solid var(--border); border-radius: 0; padding: 6px 8px; max-width: 100%; caret-color: var(--white); caret-shape: block;
}
input::placeholder, textarea::placeholder { color: var(--border); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--yellow); outline-offset: 0; }
input[type=number] { width: 4em; }
textarea { width: 100%; min-height: 96px; resize: vertical; }
select { -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 36px;
    background: var(--dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h12v2H10v2H8v2H6v2H4V6H2V4H0z' fill='%23bfce72'/%3E%3C/svg%3E") right 10px center / 14px no-repeat; }
select option { background: var(--screen); color: var(--white); }
input[type=checkbox], input[type=radio] { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin: 0 8px 0 0; vertical-align: -5px; background: var(--dark); border: 2px solid var(--border); flex: none; cursor: pointer; }
input[type=checkbox]:checked { background: var(--dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M1 1h2v2h2v2h2V3h2V1h2v2h-2v2H8v2h2v2h2v2h-2V9H8V7H6V5H4v2H3v2H1V9h2V7h1V5H3V3H1z' fill='%23bfce72'/%3E%3C/svg%3E") center / 12px no-repeat; }
input[type=radio]:checked { background: var(--yellow); box-shadow: inset 0 0 0 4px var(--dark); }
label { display: block; font: 11px/1.6 var(--chrome); letter-spacing: .02em; color: var(--text); text-transform: uppercase; margin-bottom: 6px; }
label .small, label .muted { font: inherit; color: var(--text); opacity: .7; }
.field { margin-bottom: 16px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel], .field select { width: 100%; }
.field-err { color: var(--err); font-size: 18px; margin-top: 4px; text-transform: uppercase; }
.field-err::before { content: "?"; margin-right: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 16px; }
@media (max-width: 560px) { .row, .row3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: flex-start; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* ---- BASIC messages ---- */
.alert { position: relative; background: var(--dark); color: var(--text); border: 3px solid var(--border); padding: 12px 16px; margin-bottom: 20px; font: 21px/1.25 var(--body); text-transform: uppercase; }
.alert::after { content: "READY."; display: block; margin-top: 10px; color: var(--text); }
.alert.ok { color: var(--ok); border-color: var(--ok); } .alert.ok::before { content: "OK. "; }
.alert.error { color: var(--err); border-color: var(--err); } .alert.error::before { content: "? "; }

/* ---- Hero ---- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.hero h1 { font-size: 18px; line-height: 1.5; }
.hero h1::after { content: "\2588"; margin-left: 6px; animation: blink 1.06s steps(1) infinite; }
.hero .mac { width: 180px; height: 126px; }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; } .hero .mac { display: none; } }
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; }

/* ---- Disk directory (categories) ---- */
.finder { list-style: none; margin: 0; padding: 0; border: 2px solid var(--dim); }
.finder::before { content: '0 "CATEGORIES" AR 2A'; display: block; padding: 4px 8px; background: var(--border); color: var(--rev); font: 11px/1.5 var(--chrome); letter-spacing: .02em; }
.finder li a { display: block; position: relative; padding: 3px 8px 3px calc(8px + 3.4ch + 10px); text-decoration: none; color: var(--text); text-transform: uppercase; font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
.finder li a:hover, .finder li a.on { background: var(--border); color: var(--rev); }
.finder li a::before { content: '"'; }
.finder li a::after { content: '"'; }
.finder .n { position: absolute; left: 8px; top: 3px; width: 3.4ch; text-align: right; color: var(--yellow); }
.finder li a:hover .n, .finder li a.on .n { color: var(--rev); }
.finder li a.d1 { padding-left: calc(8px + 3.4ch + 10px + 16px); } .finder li a.d2 { padding-left: calc(8px + 3.4ch + 10px + 32px); } .finder li a.d3 { padding-left: calc(8px + 3.4ch + 10px + 48px); }

/* ---- Product grid + cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.card { display: flex; flex-direction: column; }
.card .win-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card .pic { display: block; position: relative; background: var(--white); border: 3px solid var(--border); aspect-ratio: 1 / 1; overflow: hidden; }
.card .name { color: var(--white); text-decoration: none; line-height: 1.15; font-size: 21px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .name:hover { background: none; color: var(--yellow); text-decoration: underline; }
.card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font: 24px/1 var(--body); color: var(--yellow); }
.price s { color: var(--dim); margin-right: 8px; font-size: .8em; }
.tag { font: 9px/1 var(--chrome); padding: 4px 6px; border: 2px solid var(--border); color: var(--text); display: inline-block; text-transform: uppercase; }
.tag.out { background: var(--border); color: var(--rev); } .tag.low { border-color: var(--yellow); color: var(--yellow); }
.noimg { display: grid; place-items: center; height: 100%; color: var(--dim); font-size: 18px; background: var(--screen2); }

/* ---- Product page ---- */
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 760px) { .product { grid-template-columns: 1fr; } }
.ptitle { font: 400 16px/1.5 var(--chrome) !important; color: var(--white); text-transform: uppercase; letter-spacing: .02em; }
.buy { background: var(--screen2); border: 3px solid var(--border); padding: 14px; margin: 16px 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.buy .price { font-size: 34px; }
.prose { font-size: 21px; line-height: 1.25; color: var(--text); }
.prose h2, .prose h3, .prose h4 { margin: 1.2em 0 .5em; font-size: 12px; color: var(--yellow); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 .8em; }
.prose table { border-collapse: collapse; margin-bottom: .8em; } .prose td, .prose th { border: 2px solid var(--dim); padding: 3px 8px; }
.prose strong { color: var(--white); font-weight: 400; }
.crumbs { font-size: 18px; margin-bottom: 14px; color: var(--text); text-transform: uppercase; }
.crumbs a { color: var(--link); } .crumbs a:hover { background: var(--border); color: var(--rev); }

/* ---- Tables: directory listings ---- */
table.t { width: 100%; border-collapse: collapse; border: 3px solid var(--border); }
table.t th { background: var(--border); color: var(--rev); text-align: left; padding: 5px 8px; font: 10px/1.4 var(--chrome); letter-spacing: .02em; text-transform: uppercase; }
table.t td { padding: 8px; border-bottom: 2px dashed var(--dim); vertical-align: middle; }
table.t tbody tr:hover td { background: var(--screen2); }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }
table.t tfoot td { border-top: 3px solid var(--border); color: var(--white); }
.thumb { width: 56px; height: 56px; border: 2px solid var(--border); background: var(--white); }
.item { display: flex; gap: 12px; align-items: center; }
.item a { color: var(--link); }

/* ---- Order status ---- */
.status { font: 9px/1 var(--chrome); text-transform: uppercase; border: 2px solid var(--border); padding: 4px 6px; color: var(--text); }
.status.new { color: var(--yellow); border-color: var(--yellow); } .status.invoiced { color: var(--link); border-color: var(--link); }
.status.paid, .status.shipped, .status.completed { color: var(--ok); border-color: var(--ok); } .status.cancelled { color: var(--dim); text-decoration: line-through; }
.steps { display: flex; gap: 0; margin: 12px 0 18px; }
.steps div { flex: 1; text-align: center; font: 9px/1.4 var(--chrome); padding: 8px 2px; border: 2px solid var(--border); margin-left: -2px; text-transform: uppercase; color: var(--text); }
.steps div.done { background: var(--border); color: var(--rev); }
.steps div.cur { background: var(--yellow); color: var(--rev); border-color: var(--yellow); }

/* ---- Pager ---- */
.pager { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.pager a, .pager span { min-width: 34px; text-align: center; padding: 8px 10px 7px; font: 10px/1.3 var(--chrome); background: var(--border); color: var(--rev); text-decoration: none; }
.pager span.on { background: var(--yellow); }
.pager a:hover { background: var(--white); color: var(--rev); }

/* ---- Footer + misc ---- */
.statusbar { border-top: 3px solid var(--border); font-size: 18px; color: var(--text); text-transform: uppercase; }
.statusbar-in { padding: 10px 18px; display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.statusbar a { color: var(--link); }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 6px; align-items: center; }
.inline { display: inline; }
.subcats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin: 0 0 20px; align-items: start; }
.subcats a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 58px; border: 3px solid var(--border); padding: 10px; text-decoration: none; color: var(--text); text-transform: uppercase; }
.subcats a:hover { background: var(--border); color: var(--rev); }
.subcats img { width: 100%; height: 90px; object-fit: contain; background: var(--white); }
.cardh { margin: 0; font: inherit; line-height: inherit; }

/* ---- Images can never affect layout or spill out of their box (see the Vintage theme for the reason) ---- */
.gallery { min-width: 0; }
.gallery .main { position: relative; display: block; overflow: hidden; background: var(--white); border: 3px solid var(--border); aspect-ratio: 1 / 1; }
.gallery .main img, .gallery .main .noimg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; display: block; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumbs a { flex: 0 0 66px; width: 66px; height: 66px; position: relative; overflow: hidden; display: block; background: var(--white); border: 3px solid var(--border); }
.thumbs a img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; display: block; }
.thumbs a:hover { background: var(--white); }
.thumbs a.on { border-color: var(--yellow); }
.card .pic img, .card .pic .noimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb { position: relative; display: block; overflow: hidden; flex: 0 0 56px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; display: block; }

/* ---- Product options (add-ons) ---- */
.opts { background: var(--screen2); border: 3px solid var(--border); padding: 14px; margin: 16px 0 0; }
.opts .field { margin-bottom: 12px; } .opts .field:last-child { margin-bottom: 0; }
.opts select, .opts input[type=text] { width: 100%; max-width: 380px; }
.opts label.check { display: flex; align-items: flex-start; font: 20px/1.2 var(--body); text-transform: none; margin: 0; color: var(--text); }
.opt-line { font-size: 17px; }

/* Orders split by seller */
.order-group { border: 2px solid currentColor; margin: 0 0 14px; padding: 0; background: rgba(255,255,255,.35); }
.order-group > .t { margin: 0; }
.order-group > p { margin: 8px; }
.order-group-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 6px 10px; background: rgba(0,0,0,.12); border-bottom: 2px solid currentColor; }
.order-group-head.seller-line { border: 2px solid currentColor; margin-bottom: 12px; }
.og-num { font-weight: bold; text-transform: uppercase; font-size: .85em; }
.split-note { margin-bottom: 14px; }

/* Recommended products ("goes well with") */
.recs { margin-top: 18px; }
.rec-list { list-style: none; margin: 0 0 12px; padding: 0; }
.rec { display: grid; grid-template-columns: 24px 64px 1fr auto auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-bottom: 1px dotted currentColor; }
.rec:last-child { border-bottom: 0; }
.rec-pick input { width: 18px; height: 18px; }
.rec-pic { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: #fff; }
.rec-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rec-info a { font-weight: bold; }
.rec-info .small { display: block; }
.rec-price { white-space: nowrap; font-weight: bold; }
.rec-act:empty { display: none; }
@media (max-width: 620px) { .rec { grid-template-columns: 24px 56px 1fr; } .rec-price, .rec-act { grid-column: 3; } .rec-pic { width: 56px; height: 56px; } }

.backorder-note { margin: 10px 0; }
