:root { --primary: #243447; --accent: #d99b2b; --ink: #17202a; --muted: #68727d; --line: #e4e7eb; --surface: #f6f7f8; --white: #fff; --danger: #a93226; --radius: 14px; }
* { box-sizing: border-box; }
html { color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
body { margin: 0; background: var(--white); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.narrow { width: min(680px, calc(100% - 32px)); }
.narrow-wide { width: min(860px, calc(100% - 32px)); }
.site-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.nav-wrap { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.15rem; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
nav a, .link-button { color: var(--ink); font-weight: 600; }
.nav-form { display: inline; margin: 0; }
.currency-form, .language-form { margin: 0; }
.currency-form select, .language-form select { width: auto; padding: 5px 25px 5px 8px; border-radius: 6px; font-size: .82rem; font-weight: 750; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.link-button { padding: 0; border: 0; background: none; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border: 1px solid var(--primary); border-radius: 9px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.button:hover { filter: brightness(1.08); text-decoration: none; }
.button-small { min-height: 36px; padding: 7px 13px; }
.button-wide { width: 100%; }
.button-secondary { border-color: var(--line); background: var(--white); color: var(--ink); }
.hero { padding: 74px 0 64px; color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000)); }
.hero h1 { max-width: 760px; margin: 4px 0 28px; font-size: clamp(2.1rem, 5vw, 4.4rem); line-height: 1.04; letter-spacing: -.04em; }
.eyebrow { margin: 0; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.search-form { display: flex; width: min(620px, 100%); gap: 10px; }
.search-form input { flex: 1; min-width: 0; border: 0; border-radius: 9px; padding: 12px 15px; }
.search-form .button { border-color: var(--accent); background: var(--accent); color: #151515; }
.shop-layout { display: grid; grid-template-columns: 210px 1fr; gap: 44px; padding-block: 52px 84px; }
.categories { display: flex; flex-direction: column; gap: 6px; }
.categories h2 { font-size: 1rem; margin: 0 0 10px; }
.categories a { padding: 9px 11px; border-radius: 8px; color: var(--ink); }
.categories a.active { background: var(--surface); font-weight: 750; }
.categories a.parent-active { font-weight: 700; }
.subcategories { display: flex; flex-direction: column; gap: 4px; margin-left: 11px; padding-left: 9px; border-left: 1px solid var(--line); }
.categories a.subcategory { padding: 7px 10px; font-size: .93rem; color: var(--muted); }
.categories a.subcategory.active { color: var(--ink); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-heading h1, .section-heading h2 { margin: 0; }
.section-heading > span { color: var(--muted); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: transform .18s ease, box-shadow .18s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(20, 30, 40, .09); }
.product-image { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); color: var(--muted); }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body { padding: 18px; }
.product-card h3 { margin: 3px 0 15px; font-size: 1.08rem; }
.product-card h3 a { color: var(--ink); }
.muted { margin: 0; color: var(--muted); }
.price-row, .summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.stock { color: #24734b; font-size: .82rem; }
.out-stock, .error-text, .danger { color: var(--danger); }
.page-section { min-height: 62vh; padding-block: 48px 80px; }
.product-detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 62px; padding-block: 52px 84px; }
.gallery { display: grid; gap: 16px; align-content: start; }
.gallery img, .image-placeholder { width: 100%; border-radius: var(--radius); background: var(--surface); }
.gallery img { max-height: 680px; object-fit: contain; }
.image-placeholder { display: grid; place-items: center; min-height: 460px; color: var(--muted); }
.product-info { position: sticky; top: 104px; align-self: start; }
.product-info h1 { margin: 9px 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.06; }
.detail-price { margin: 18px 0; color: var(--primary); font-size: 1.55rem; font-weight: 800; }
.prose { color: #3c4650; }
.stack-form p { display: grid; gap: 6px; margin: 0 0 17px; }
.stack-form label, .cart-controls label { font-weight: 700; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #cbd0d5; border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); border-color: var(--accent); }
.helptext { color: var(--muted); font-size: .82rem; }
.errorlist { margin: 3px 0; padding-left: 20px; color: var(--danger); }
.add-form { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.panel, .order-summary { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.panel h1, .panel h2, .order-summary h2 { margin-top: 0; }
.form-footer { margin: 22px 0 0; text-align: center; }
.alerts { padding-top: 14px; }
.alert { padding: 12px 15px; border-radius: 8px; background: #e9f2fc; }
.alert-success { background: #e6f5ed; }
.alert-error { background: #fdebea; color: #7d2119; }
.empty-state { grid-column: 1 / -1; padding: 62px 24px; border: 1px dashed #cbd0d5; border-radius: var(--radius); text-align: center; }
.two-column { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.order-summary { position: sticky; top: 100px; background: var(--surface); }
.order-summary .summary-row { padding: 12px 0 20px; font-size: 1.15rem; }
.cart-list { display: grid; gap: 14px; }
.cart-item { display: grid; grid-template-columns: 100px minmax(170px, 1fr) 120px 110px; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.cart-item h2 { margin: 0; font-size: 1rem; }
.cart-item p { margin: 4px 0; color: var(--muted); }
.cart-thumb { height: 88px; border-radius: 8px; background: var(--surface); overflow: hidden; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-controls { display: grid; gap: 6px; }
.cart-controls label { font-size: .78rem; }
.cart-controls input { padding: 7px; }
.cart-controls .button { min-height: 34px; padding: 5px; font-size: .82rem; }
.notice { padding: 14px 16px; border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, #fff); }
.top-gap { margin-top: 22px; }
address { font-style: normal; line-height: 1.75; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--surface); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-block; padding: 4px 9px; border-radius: 999px; background: #edf0f2; font-size: .8rem; font-weight: 750; }
.status-confirmed, .status-completed { background: #dff3e8; color: #19623d; }
.status-rejected, .status-cancelled { background: #fae4e2; color: #8c2921; }
.order-title { margin-top: 26px; }
.order-line { display: flex; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.order-line p { margin: 3px 0; color: var(--muted); }
.total-row { padding-top: 22px; font-size: 1.15rem; }
.conversation-list { display: grid; gap: 10px; }
.conversation-card { display: flex; justify-content: space-between; gap: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.conversation-card:hover { border-color: var(--accent); text-decoration: none; }
.conversation-card div:first-child { display: grid; }
.conversation-card span { color: var(--muted); }
.conversation-meta { display: grid; text-align: right; color: var(--muted); font-size: .85rem; }
.chat-page { width: min(860px, calc(100% - 32px)); padding-block: 34px 60px; }
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.chat-header h1 { margin: 7px 0 0; }
.message-stream { height: min(58vh, 600px); overflow-y: auto; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); }
.message { width: min(78%, 620px); margin-bottom: 13px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 4px 13px 13px 13px; background: #fff; }
.message-mine { margin-left: auto; border: 0; border-radius: 13px 4px 13px 13px; background: var(--primary); color: #fff; }
.message-shop { border-left: 4px solid var(--accent); }
.message > div { display: flex; justify-content: space-between; gap: 12px; font-size: .78rem; }
.message time { opacity: .72; }
.message p { margin: 6px 0 0; white-space: pre-wrap; }
.empty-chat { display: grid; place-items: center; height: 100%; color: var(--muted); }
.chat-compose { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
.chat-compose textarea { resize: vertical; }
.site-footer { padding: 38px 0; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; }
.footer-grid p { margin: 6px 0; color: var(--muted); }
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-detail, .two-column { grid-template-columns: 1fr; }
  .product-info, .order-summary { position: static; }
  .cart-item { grid-template-columns: 80px 1fr; }
  .cart-item > :nth-child(n+3) { grid-column: 2; }
}
@media (max-width: 660px) {
  .nav-wrap { padding-block: 12px; align-items: flex-start; }
  nav { justify-content: flex-end; gap: 10px 14px; font-size: .88rem; }
  .brand span { display: none; }
  .hero { padding-block: 48px; }
  .shop-layout { grid-template-columns: 1fr; gap: 28px; }
  .categories { flex-direction: row; overflow-x: auto; }
  .categories h2 { display: none; }
  .categories a { white-space: nowrap; }
  /* Flatten the tree into the horizontal strip instead of stacking a column in it. */
  .subcategories { display: contents; }
  .product-grid { grid-template-columns: 1fr; }
  .product-detail { padding-top: 28px; gap: 30px; }
  .message { width: 92%; }
  .chat-compose { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; }
}
