:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #0b1f3a;
  --muted: #6b7a93;
  --blue: #1e4fd8;
  --blue-soft: #e8eefc;
  --line: #e3e9f5;
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* header */
.bar { position: sticky; top: 0; z-index: 5; background: rgba(245, 247, 251, .75); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.bar-inner { display: flex; justify-content: space-between; align-items: center; height: 60px; }
.logo { font-weight: 600; letter-spacing: .28em; font-size: 13px; color: var(--ink); }
.logo::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-left: 4px; vertical-align: middle; }
#cartBtn { background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; transition: transform .2s var(--ease), background .2s; }
#cartBtn:hover { background: var(--blue); transform: translateY(-1px); }
.link { font-size: 14px; color: var(--blue); font-weight: 500; }
.link:hover { opacity: .7; }

/* hero */
.hero { padding: 96px 0 64px; }
.hero h1 { font-weight: 600; font-size: clamp(40px, 7vw, 76px); line-height: 1; letter-spacing: -.045em; margin-bottom: 28px; }
.hero h1 { background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 40%, var(--blue) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .link { display: inline-flex; align-items: center; gap: 6px; background: var(--blue); color: #fff; padding: 12px 22px; border-radius: 999px; transition: transform .2s var(--ease), box-shadow .2s; }
.hero .link:hover { opacity: 1; transform: translateY(-2px); box-shadow: 0 8px 24px -8px rgba(30, 79, 216, .6); }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filters button { font-size: 13px; font-weight: 500; color: var(--muted); padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); transition: all .2s var(--ease); }
.filters button:hover { color: var(--ink); border-color: #c9d6f0; }
.filters button.on { color: #fff; background: var(--blue); border-color: var(--blue); }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; padding-bottom: 96px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 14px; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -20px rgba(11, 31, 58, .35); }
.card .img { aspect-ratio: 1; background: var(--blue-soft); border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; overflow: hidden; }
.card .img svg { width: 68%; height: 68%; transition: transform .4s var(--ease); }
.card:hover .img svg { transform: scale(1.05); }
.card .meta { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; }
.card .name { font-weight: 500; font-size: 14px; }
.card .price { font-weight: 600; font-size: 14px; }
.card .color { color: var(--muted); font-size: 12px; margin: 2px 0 10px; padding: 0 4px; }
.sizes { display: flex; gap: 4px; margin-bottom: 10px; padding: 0 4px; }
.sizes button { flex: 1; height: 28px; border-radius: 8px; background: var(--bg); font-size: 11px; font-weight: 500; color: var(--ink); transition: all .15s; }
.sizes button:hover { background: var(--blue-soft); color: var(--blue); }
.sizes button.on { background: var(--ink); color: #fff; }
.card [data-add] { display: block; width: calc(100% - 8px); margin: 0 4px; padding: 9px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 13px; transition: background .2s, opacity .2s; }
.card [data-add]:hover { opacity: 1; background: #1740b3; }
.card [data-add].wait { background: var(--bg); color: var(--muted); cursor: default; }

/* footer */
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* overlay, drawer, modal */
.overlay { position: fixed; inset: 0; background: rgba(11, 31, 58, .3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 10; }
.overlay.on { opacity: 1; pointer-events: auto; }

.drawer { position: fixed; top: 8px; right: 8px; bottom: 8px; width: min(400px, calc(100% - 16px)); background: var(--surface); border-radius: 20px; transform: translateX(calc(100% + 16px)); transition: transform .4s var(--ease); z-index: 20; display: flex; flex-direction: column; padding: 24px; box-shadow: 0 24px 64px -24px rgba(11, 31, 58, .4); }
.drawer.on { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; margin-bottom: 4px; font-weight: 600; font-size: 17px; }
.drawer-head .link { font-size: 13px; }

.lines { list-style: none; flex: 1; overflow-y: auto; }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 14px; margin-bottom: 8px; background: var(--bg); border-radius: 12px; font-size: 14px; font-weight: 500; }
.lines .sub { color: var(--muted); font-size: 12px; font-weight: 400; }
.lines .empty { color: var(--muted); background: none; font-weight: 400; }
.qty { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; background: var(--surface); border-radius: 999px; padding: 2px 4px; font-size: 13px; }
.qty button { color: var(--blue); width: 22px; height: 22px; border-radius: 50%; }
.qty button:hover { background: var(--blue-soft); }
.right { text-align: right; }
.right .link { font-size: 12px; font-weight: 400; color: var(--muted); }

.drawer-foot { padding-top: 12px; }
.row { display: flex; justify-content: space-between; margin: 8px 0 16px; font-weight: 600; }

.btn { width: 100%; background: var(--blue); color: #fff; padding: 14px; border-radius: 12px; font-weight: 500; transition: background .2s; }
.btn:hover { background: #1740b3; }
.btn:disabled { opacity: .35; cursor: default; }

.modal { position: fixed; inset: 0; display: none; place-items: center; z-index: 30; padding: 16px; }
.modal.on { display: grid; }
.modal-box { background: var(--surface); border-radius: 20px; width: min(420px, 100%); padding: 24px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 24px 64px -24px rgba(11, 31, 58, .4); animation: pop .3s var(--ease); }
.modal-box[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid transparent; border-radius: 10px; padding: 12px 14px; outline: none; transition: border-color .2s, background .2s; }
input:focus { border-color: var(--blue); background: var(--surface); }
.thanks { font-size: 28px; font-weight: 600; letter-spacing: -.02em; color: var(--blue); }
.muted { color: var(--muted); margin-bottom: 12px; }

@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { padding: 8px 8px 12px; }
  .sizes { gap: 3px; padding: 0; }
  .sizes button { font-size: 10px; height: 26px; }
  .hero { padding: 64px 0 40px; }
}
