/* Design of a traditional fashion house's online shop: white, black type, a small dark service bar on top,
   search – logo – account in the header, categories in capitals below, a filter column beside the product grid,
   portrait product pictures and black square buttons. */
:root {
  --white: #ffffff;
  --paper: #f6f5f3;
  --ink: #1a1a1a;
  --text: #333333;
  --muted: #777777;
  --line: #e2e2e2;
  --line-dark: #c8c8c8;
  --accent: #8c1d2c;
  --accent-dark: #6f1622;
  --green: #2e7d4f;
  --orange: #b35c00;
  --sans: "Helvetica Neue", Helvetica, "Segoe UI", Roboto, "Liberation Sans", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", "Liberation Serif", "DejaVu Serif", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans); color: var(--text); background: var(--white);
  font-size: 15px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { color: var(--ink); font-weight: 400; margin: 0 0 .5em; line-height: 1.2; }
h1 { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h2 { font-family: var(--serif); font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
h3 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Service bar */
.topbar { background: var(--ink); color: #e8e8e8; font-size: .75rem; letter-spacing: .04em; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: .45rem 24px; display: flex; justify-content: center; gap: .9rem; flex-wrap: wrap; }
.topbar-sep { color: #666; }

/* Header: search – logo – actions */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 1.1rem 24px .9rem;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem;
}
.header-search { display: flex; align-items: center; border-bottom: 1px solid var(--line-dark); max-width: 300px; }
.header-search input { border: none; outline: none; background: none; padding: .4rem 0; flex: 1; min-width: 0; font-size: .88rem; }
.search-btn { background: none; border: none; cursor: pointer; padding: .3rem; color: var(--ink); display: flex; }
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink); }
.brand:hover { color: var(--ink); }
#brand-name { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: .14em; text-transform: uppercase; line-height: 1.1; }
.brand-sub { font-size: .66rem; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); margin-top: .2rem; }
.header-actions { display: flex; justify-content: flex-end; gap: 1.4rem; }
.action-link { display: flex; flex-direction: column; align-items: center; gap: .2rem; font-size: .7rem; letter-spacing: .04em; color: var(--ink); position: relative; }
.action-link img, .action-link svg { width: 20px; height: 20px; }
.action-link.active { color: var(--accent); }
.cart-count {
  position: absolute; top: -6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: .62rem; line-height: 17px; text-align: center; font-weight: 700;
}
.cart-count:empty { display: none; }
.action-link[hidden], .header-search[hidden], .main-nav[hidden], .footer-col[hidden] { display: none; }
.account-user { cursor: default; }
.account-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.account-logout {
  background: none; border: none; padding: 0; cursor: pointer; font-size: .7rem; letter-spacing: .04em;
  color: var(--muted); text-decoration: underline;
}
.account-logout:hover { color: var(--accent); }
.no-access { max-width: 560px; margin: 0 auto; }
.no-access .btn { margin-top: 1rem; }

/* Categories */
.main-nav {
  max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: flex-start; gap: 2.2rem;
  overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.main-nav::-webkit-scrollbar { display: none; }
/* Centred while the categories fit; when they do not, the bar scrolls from the first one (nothing is cut off). */
.main-nav a:first-child { margin-left: auto; }
.main-nav a:last-child { margin-right: auto; }
.main-nav a { flex: 0 0 auto; }
.main-nav a {
  padding: .75rem 0 .7rem; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--accent); }
.main-nav a.active { border-bottom-color: var(--ink); }

/* Page */
.page { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.4rem 24px 4.5rem; }
.loading { color: var(--muted); text-align: center; padding: 5rem 0; }
.empty { text-align: center; padding: 4.5rem 1rem; color: var(--muted); }
.empty h2 { color: var(--ink); }
.breadcrumb { font-size: .78rem; color: var(--muted); margin-bottom: 1.4rem; display: flex; gap: .45rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.back { display: inline-block; margin-bottom: 1.2rem; font-size: .82rem; color: var(--muted); }

/* Teaser */
.hero {
  background: var(--paper); padding: clamp(1.8rem, 5vw, 3.4rem) clamp(1.4rem, 5vw, 3.4rem); margin-bottom: 2.4rem;
  display: flex; flex-direction: column; align-items: flex-start; gap: .4rem;
}
.hero-eyebrow { font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.hero h1 { margin: 0; }
.hero p { margin: 0; color: var(--text); max-width: 620px; }

/* Listing: filter column and grid */
.listing { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.4rem; align-items: start; }
.filter-col { position: sticky; top: 150px; }
.filter-col h3 { border-bottom: 1px solid var(--ink); padding-bottom: .6rem; margin-bottom: .6rem; }
.filter-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.filter-list button {
  background: none; border: none; padding: .38rem 0; cursor: pointer; width: 100%; text-align: left;
  display: flex; justify-content: space-between; color: var(--text); font-size: .9rem;
}
.filter-list button:hover { color: var(--accent); }
.filter-list button.active { color: var(--ink); font-weight: 700; }
.filter-list .count { color: var(--muted); font-weight: 400; font-size: .8rem; }
.listing-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.listing-head h1 { margin: 0; }
.listing-tools { display: flex; align-items: center; gap: .9rem; font-size: .82rem; color: var(--muted); }
.sort { border: 1px solid var(--line-dark); background: var(--white); padding: .45rem .7rem; border-radius: 0; font-size: .82rem; color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2.2rem 1.4rem; }
.card { display: flex; flex-direction: column; position: relative; }
.card-image { display: block; aspect-ratio: 3 / 4; background: var(--paper); overflow: hidden; position: relative; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-image img { transform: scale(1.04); }
.card-badge {
  position: absolute; top: .7rem; left: 0; background: var(--accent); color: #fff; font-size: .66rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; padding: .25rem .6rem;
}
.card-body { padding: .85rem 0 0; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.card-dept { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.card-title { font-size: .95rem; color: var(--ink); line-height: 1.35; }
.card-price { font-size: .95rem; font-weight: 700; color: var(--ink); margin-top: .15rem; }
.card-action { margin-top: .7rem; }
.card-action .btn { width: 100%; }
.placeholder {
  width: 100%; height: 100%; min-height: 120px; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 3rem; color: #bdb8b0; background: var(--paper);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid var(--ink); background: var(--ink); color: #fff; border-radius: 0;
  padding: .7rem 1.3rem; cursor: pointer; font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.secondary { background: var(--white); color: var(--ink); }
.btn.secondary:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.big { padding: 1rem 1.8rem; font-size: .82rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: .2rem 0; font-size: .8rem; text-decoration: underline; }
.link-btn:hover { color: var(--accent); }

/* Product page */
.product { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.6rem, 4vw, 4rem); align-items: start; }
.product-image { aspect-ratio: 3 / 4; background: var(--paper); overflow: hidden; position: sticky; top: 150px; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-info .card-dept { margin-bottom: .4rem; }
.product-info h1 { margin-bottom: .6rem; }
.product-price { font-size: 1.5rem; font-weight: 700; color: var(--ink); margin: 0 0 1.4rem; }
.product-desc { white-space: pre-line; margin: 0; }
.label { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin: 1.6rem 0 .7rem; }
.label span { color: var(--muted); font-weight: 400; letter-spacing: .02em; text-transform: none; margin-left: .3rem; }
.sizes { display: flex; flex-wrap: wrap; gap: .5rem; }
.size {
  min-width: 52px; padding: .7rem .8rem; border: 1px solid var(--line-dark); background: var(--white);
  cursor: pointer; text-align: center; font-size: .88rem;
}
.size:hover { border-color: var(--ink); }
.size.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.buy-box { margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.buy-row { display: flex; gap: .8rem; align-items: stretch; flex-wrap: wrap; }
.buy-row .btn { flex: 1; }
.buy-row.center-row { justify-content: center; }
.buy-row.center-row .btn { flex: 0 0 auto; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-dark); background: var(--white); }
.stepper button { width: 40px; height: 44px; border: none; background: none; cursor: pointer; font-size: 1.1rem; color: var(--ink); }
.stepper button:hover { background: var(--paper); }
.stepper span { min-width: 30px; text-align: center; }
.benefits { list-style: none; margin: 1.6rem 0 0; padding: 0; font-size: .85rem; color: var(--text); }
.benefits li { padding: .35rem 0 .35rem 1.5rem; position: relative; }
.benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.note { font-size: .8rem; color: var(--muted); margin-top: 1rem; }

/* Basket and checkout */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2.4rem; align-items: start; }
.panel { background: var(--white); border: 1px solid var(--line); padding: 1.6rem; }
.panel.summary { background: var(--paper); border-color: var(--paper); }
.basket-line { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 1.3rem; align-items: start; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.basket-line:first-child { padding-top: 0; }
.basket-line:last-child { border-bottom: none; padding-bottom: 0; }
.thumb { width: 110px; aspect-ratio: 3 / 4; overflow: hidden; background: var(--paper); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .placeholder { font-size: 1.8rem; min-height: 0; }
.line-title { font-size: 1rem; color: var(--ink); margin-bottom: .2rem; }
.line-meta { color: var(--muted); font-size: .82rem; margin-bottom: .6rem; }
.line-amount { text-align: right; font-size: 1rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.sum-row { display: flex; justify-content: space-between; padding: .4rem 0; font-size: .9rem; }
.sum-row.total { border-top: 1px solid var(--ink); margin-top: .8rem; padding-top: .9rem; font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.field input, .field textarea { border: 1px solid var(--line-dark); border-radius: 0; background: var(--white); padding: .75rem .85rem; font-size: .95rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field textarea { min-height: 96px; resize: vertical; }
.pay-hint { border-left: 3px solid var(--accent); background: var(--white); padding: .85rem 1rem; font-size: .84rem; margin: 1.2rem 0; }

/* Orders */
.orders { border-top: 1px solid var(--line); }
.order-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 1.2rem; align-items: center;
  padding: 1.1rem .2rem; border-bottom: 1px solid var(--line); color: var(--ink);
}
.order-row:hover { background: var(--paper); color: var(--ink); }
.order-no { font-weight: 700; }
.badge { display: inline-block; padding: .2rem .6rem; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: var(--paper); color: var(--muted); white-space: nowrap; }
.badge.wait { background: #fbefe2; color: var(--orange); }
.badge.paid { background: #e4f2ea; color: var(--green); }
.payment-box { display: grid; grid-template-columns: 200px 1fr; gap: 1.8rem; align-items: center; }
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border: 1px solid var(--line); }
.qr img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.kv { display: grid; grid-template-columns: max-content 1fr auto; gap: .45rem 1rem; align-items: center; margin: 0; }
.kv dt { color: var(--muted); font-size: .82rem; }
.kv dd { margin: 0; font-weight: 700; color: var(--ink); word-break: break-word; }
.lines-table { width: 100%; border-collapse: collapse; }
.lines-table th { text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: .5rem .4rem; border-bottom: 1px solid var(--ink); }
.lines-table td { padding: .75rem .4rem; border-bottom: 1px solid var(--line); }
.lines-table .num { text-align: right; white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 1.4rem; }

/* Sign in and registration */
.auth { max-width: 900px; margin: 1rem auto; }
.auth-head { text-align: center; margin-bottom: 2rem; }
.auth-head p { color: var(--muted); margin: 0; }
.auth-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.auth .field { margin-bottom: 1rem; }

/* Footer, toast, dialog */
.site-footer { background: var(--paper); border-top: 1px solid var(--line); margin-top: 2rem; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 2.6rem 24px 1.8rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; font-size: .85rem; }
.footer-col h4 { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .8rem; }
.footer-col p { margin: 0; color: var(--text); }
.footer-col a { display: block; padding: .15rem 0; color: var(--text); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { background: var(--ink); color: #bbb; text-align: center; font-size: .72rem; letter-spacing: .06em; padding: .8rem 24px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: .85rem 1.3rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
  transition: opacity .25s ease, transform .25s ease; max-width: min(92vw, 520px); z-index: 50; white-space: pre-line; font-size: .9rem;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #b3261e; }
.dialog-layer { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 1rem; }
.dialog-layer[hidden] { display: none; }
.dialog { background: var(--white); padding: 1.8rem; max-width: 440px; width: 100%; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.dialog p { white-space: pre-line; margin-top: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .8rem; margin-top: 1.2rem; flex-wrap: wrap; }

@media (max-width: 960px) {
  .listing { grid-template-columns: 1fr; }
  .filter-col { position: static; }
  .filter-list { display: flex; gap: .5rem 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
  .filter-list li { flex: 0 0 auto; }
  .filter-list button { width: auto; gap: .4rem; }
  .product, .two-col, .payment-box, .auth-cols { grid-template-columns: 1fr; }
  .product-image { position: static; }
  .qr { margin: 0 auto; }
}
@media (max-width: 680px) {
  .topbar-inner .topbar-sep, .topbar-inner span:nth-child(n+3) { display: none; }
  .header-inner { grid-template-columns: auto 1fr; gap: .8rem; padding: .8rem 16px; }
  .header-search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .brand { align-items: flex-start; text-align: left; }
  .brand-sub { display: none; }
  .action-link span:not(.cart-count) { display: none; }
  .header-actions .account-user .account-name { display: block; max-width: 90px; font-size: .62rem; }
  .main-nav { justify-content: flex-start; gap: 1.4rem; padding: 0 16px; }
  .page { padding: 1rem 16px 3.5rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem .9rem; }
  .form-grid { grid-template-columns: 1fr; }
  .order-row { grid-template-columns: 1fr auto; }
  .order-row .order-amount { grid-column: 2; }
  .basket-line { grid-template-columns: 84px minmax(0, 1fr); }
  .thumb { width: 84px; }
  .line-amount { grid-column: 2; text-align: left; }
  .footer-inner { grid-template-columns: 1fr; }
}
