/* ENJENEER DESIGNS shop.
 *
 * White and black with hot pink for the one thing on a screen you should
 * touch next. Mobile first: everything is sized for a thumb and widened at
 * 760px for desktop. One typeface, Inter, served from /fonts.
 */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink:    #111111;
  --paper:  #FFFFFF;
  --pink:   #FF0066;
  --pink-dark: #D60056;
  --pink-soft: #FFE5F0;
  --gray:   #F4F4F5;
  --gray-2: #E8E8EA;
  --muted:  #6B6B70;
  --line:   #E3E3E6;
  --green:  #0F8A4C;
  --red:    #C62828;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wrap: 1120px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: 30px; text-transform: uppercase; letter-spacing: .02em; }
h2 { font-size: 22px; }
h3 { font-size: 17px; text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.fine { font-size: 12px; color: var(--muted); }
em { font-style: normal; color: var(--pink); }

.skip {
  position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff;
  padding: 8px 12px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 8px; }

/* ------------------------------- layout -------------------------------- */

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 20px var(--gutter); }
.wrap.narrow { max-width: 680px; }
.main { min-height: 60vh; }
.section-title { margin: 28px 0 14px; font-size: 14px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

/* ------------------------------- top bar ------------------------------- */

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: var(--wrap); margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: 12px; }
/* The logo keeps its own proportions no matter how tight the row gets:
 * flex is not allowed to shrink it, and the nav gives way first. */
.brand { flex: 0 0 auto; display: block; }
.brand img { width: auto; height: 30px; max-width: none; }
/* The header holds the logo, Shop and the cart. About lives in the footer. */
.topnav { display: flex; gap: 2px; margin-left: auto; min-width: 0; }
.topnav a { text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 999px; white-space: nowrap; }
.topnav a:hover { background: var(--gray); }
.cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; text-decoration: none; }
.cart-link:hover { background: var(--gray); }
.cart-count { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }

/* --------------------------------- hero --------------------------------- */

.hero { background: var(--paper); text-align: center; }
.hero .wrap { padding-top: 28px; padding-bottom: 8px; }
.hero-logo { margin: 0 auto 22px; max-width: 420px; }
.hero-logo img { width: 100%; height: auto; }
.hero-box { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 26px 20px 24px; max-width: 720px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 700; color: var(--pink); margin-bottom: 8px; }
.lede { font-size: 17px; color: var(--muted); max-width: 60ch; }
.hero .lede { margin-left: auto; margin-right: auto; color: #fff; }
.hero-cta { margin: 18px 0 0; }

/* ------------------------------- buttons -------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .06s ease, background .15s ease;
}
.btn:hover { background: #000; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-add { background: var(--pink); border-color: var(--pink); width: 100%; font-size: 17px; }
.btn-add:hover { background: var(--pink-dark); border-color: var(--pink-dark); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--gray); }
.btn-block { width: 100%; }
.hero .btn { background: var(--pink); border-color: var(--pink); }
.hero .btn:hover { background: var(--pink-dark); border-color: var(--pink-dark); }

/* ------------------------------- category grid -------------------------- */

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cat { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--gray); text-decoration: none; aspect-ratio: 1; box-shadow: var(--shadow); }
.cat-img { position: absolute; inset: 0; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.cat:hover .cat-img img { transform: scale(1.04); }
.cat-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 12px 12px; background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0)); color: #fff; }
.cat-name { display: block; font-weight: 800; font-size: 16px; line-height: 1.2; text-transform: uppercase; letter-spacing: .03em; }
.cat-count { display: block; font-size: 12px; opacity: .85; }

.notice-grid { display: grid; gap: 12px; }
.notice { background: var(--gray); border-radius: var(--radius); padding: 18px; }
.notice h3 { margin-bottom: 6px; }
.notice p:last-child { margin-bottom: 0; }

/* ------------------------------- product grid --------------------------- */

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 12px; }
.card { display: block; text-decoration: none; }
.card-img { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--gray); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.card-noimg { width: 100%; height: 100%; background: repeating-linear-gradient(45deg, var(--gray), var(--gray) 10px, var(--gray-2) 10px, var(--gray-2) 20px); }
.card-noimg.big { aspect-ratio: 1; border-radius: var(--radius); }
.card-body { padding: 8px 2px 0; }
.card-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.card-price { color: var(--muted); font-size: 14px; margin-top: 2px; }

.grid-scroll { display: flex; overflow-x: auto; gap: 12px; scroll-snap-type: x mandatory; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.grid-scroll .card { flex: 0 0 44%; scroll-snap-align: start; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.chip small { color: var(--muted); font-weight: 500; }
.chip:hover { background: var(--ink); color: #fff; }
.chip:hover small { color: #ddd; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.empty { color: var(--muted); }

/* ------------------------------- product page --------------------------- */

.product-layout { display: grid; gap: 20px; }
.gallery-main { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; border-radius: var(--radius); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.gallery-main::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1; background: var(--gray); border-radius: var(--radius); overflow: hidden; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery-thumbs a { flex: 0 0 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; }
.gallery-thumbs a.is-active { border-color: var(--pink); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-info h1 { font-size: 24px; text-transform: none; letter-spacing: -0.01em; margin-bottom: 4px; }
.price { font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.description { margin-top: 22px; color: #333; }
.description p { margin-bottom: 10px; }
.description a { color: var(--pink); }
.pickup-note { font-size: 13px; color: var(--muted); background: var(--gray); border-radius: var(--radius-sm); padding: 12px 14px; }

/* -------------------------------- fields -------------------------------- */

.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.field-label { font-weight: 700; font-size: 15px; }
.req { font-size: 12px; font-weight: 600; color: var(--pink); text-transform: uppercase; letter-spacing: .06em; }
.opt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.help { font-size: 13px; color: var(--muted); margin: -2px 0 8px; }
input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--gray-2); border-radius: var(--radius-sm);
  background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid .choices { border-color: var(--red); }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.count { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }

.choices { display: grid; gap: 6px; border-radius: var(--radius-sm); }
.choices-pill { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--gray-2); border-radius: var(--radius-sm); cursor: pointer; background: #fff; }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--pink); flex: 0 0 auto; }
.choice:has(input:checked) { border-color: var(--pink); background: var(--pink-soft); }
.choices-pill .choice { flex: 1 1 auto; justify-content: center; }
.choices-pill .choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choices-pill .choice:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--pink-soft); }
.field-many .choices { max-height: 240px; overflow: auto; border: 1.5px solid var(--gray-2); padding: 6px; }
.field-many.is-open .choices { max-height: none; }
.expander { background: none; border: 0; padding: 4px 0 8px; color: var(--pink); font-weight: 600; cursor: pointer; text-decoration: underline; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--gray-2); border-radius: 999px; overflow: hidden; }
.qty button { width: 44px; height: 46px; border: 0; background: #fff; font-size: 22px; cursor: pointer; }
.qty button:hover { background: var(--gray); }
.qty input { width: 56px; min-height: 0; height: 46px; border: 0; border-radius: 0; text-align: center; padding: 0; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { box-shadow: none; }

.form-error { color: var(--red); font-weight: 600; background: #FDECEC; border-radius: var(--radius-sm); padding: 10px 14px; }

/* ---------------------------------- cart -------------------------------- */

.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line-img { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--gray); }
.line-img img { width: 100%; height: 100%; object-fit: cover; }
.line-name { font-weight: 700; }
.line-name a { text-decoration: none; }
.line-opt { font-size: 13px; color: var(--muted); }
.line-opt span { color: var(--ink); }
.line-qty { font-size: 13px; color: var(--muted); margin-top: 4px; }
.line-total { font-weight: 700; white-space: nowrap; }
.line-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.line-actions .qty button { width: 36px; height: 36px; font-size: 18px; }
.line-actions .qty input { height: 36px; width: 44px; }
.line-remove { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px 0; font-size: 13px; }
.line-warn { font-size: 13px; color: var(--red); font-weight: 600; }
.compact .line { grid-template-columns: 56px 1fr auto; padding: 10px 0; }
.compact .line-img { width: 56px; height: 56px; }

.cart-summary { margin-top: 20px; }
.code-form label { font-weight: 700; font-size: 14px; display: block; margin-bottom: 6px; }
.code-row { display: flex; gap: 8px; }
.code-row input { text-transform: uppercase; }
.code-row .btn { flex: 0 0 auto; }
.code-msg { font-size: 13px; margin: 6px 0 0; min-height: 18px; }
.code-msg.ok { color: var(--green); font-weight: 600; }
.code-msg.bad { color: var(--red); font-weight: 600; }

.totals { margin: 18px 0; }
.totals div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 600; }
.totals .total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font-size: 18px; }
.totals .total dt { color: var(--ink); font-weight: 700; }
.totals .paid dd { color: var(--green); }

.cart-empty { text-align: center; padding: 40px 0; color: var(--muted); }
.hp { position: absolute; left: -9999px; top: -9999px; }
.checkout-form h2 { margin-top: 26px; }

/* -------------------------------- order page ---------------------------- */

.placed { background: var(--pink-soft); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.placed h1 { text-transform: none; letter-spacing: 0; }
.placed p { margin: 0; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0; margin: 16px 0 22px; counter-reset: step; }
.steps li { position: relative; padding-top: 18px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.steps li::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px; border-radius: 4px; background: var(--gray-2); }
.steps li.done::before { background: var(--ink); }
.steps li.current::before { background: var(--pink); }
.steps li.current { color: var(--pink); }
.steps li.done { color: var(--ink); }
.status-cancelled { background: #FDECEC; border-radius: var(--radius-sm); padding: 12px 14px; color: var(--red); font-weight: 600; }
.lines { margin-top: 6px; }

.prose p { margin-bottom: 12px; }

/* --------------------------------- footer ------------------------------- */

.footer { border-top: 1px solid var(--line); margin-top: 40px; background: var(--gray); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 24px var(--gutter) 34px; font-size: 14px; color: var(--muted); }
.footer p { margin: 0 0 6px; }
.footer a { color: var(--ink); }

/* --------------------------------- toast -------------------------------- */

.toast-root { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(94vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 12px; animation: toast-in .2s ease; }
.toast a { color: var(--pink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.toast.bad { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* -------------------------------- desktop ------------------------------- */

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 20px 16px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .notice-grid { grid-template-columns: 1fr 1fr; }
  .grid-scroll .card { flex-basis: 30%; }
}

@media (min-width: 760px) {
  :root { --gutter: 24px; }
  h1 { font-size: 36px; }
  .hero .wrap { padding-top: 48px; padding-bottom: 16px; }
  .hero-logo { max-width: 560px; margin-bottom: 32px; }
  .hero-box { padding: 34px 40px 32px; }
  .brand img { height: 42px; }
  .topnav { gap: 6px; }
  .topnav a { font-size: 15px; padding: 8px 14px; }
  .product-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .gallery { position: sticky; top: 90px; }
  .product-info h1 { font-size: 30px; }
  .grid-scroll { display: grid; overflow: visible; }
  .grid-scroll .card { flex-basis: auto; }
}

@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
