:root {
  color-scheme: light;
  --paper: #f5f3ed;
  --surface: #fff;
  --text: #25241d;
  --subtle: #5e5b50;
  --accent: #e5ba56;
  --green: #222f29;
  --line: #dfdcd0;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--text);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding-block: 28px 64px; }
a { color: inherit; }
a:hover { color: #815817; }
.container { width: min(1360px, calc(100% - 48px)); margin-inline: auto; }
h1, h2, h3, p { margin-top: 0; }
h1 { line-height: 1.12; }
h3 { font-size: 1.03rem; line-height: 1.33; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  color: #231c0f; background: var(--accent); border: 1px solid transparent;
  border-radius: 7px; padding: 9px 15px; font-weight: 690; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { background: #edc874; color: #231c0f; }
.light { background: var(--surface); border-color: var(--line); }
.light:hover { background: #fff7e7; }
input, select, textarea { min-width: 0; padding: 9px 12px; background: #fff; color: var(--text); border: 1px solid #c9c5b8; border-radius: 7px; }
textarea { resize: vertical; }
:focus-visible { outline: 3px solid #8a6922; outline-offset: 2px; }
.site-header { background: var(--surface); }
.utility { background: var(--green); color: #f7f5ee; }
.utility .container { display: flex; justify-content: flex-end; gap: 22px; padding-block: 8px; }
.utility a { font-size: .87rem; text-decoration: none; }
.utility a:hover, .admin-header a:hover, .footer a:hover { color: var(--accent); }
.head-main { display: grid; grid-template-columns: auto minmax(190px, 1fr) auto; gap: 36px; align-items: center; padding-block: 20px; }
.brand { display: inline-flex; gap: 11px; align-items: center; color: var(--green); text-decoration: none; }
.brand-icon { width: 47px; height: 47px; border-radius: 10px; display: grid; place-items: center; background: var(--green); color: var(--accent); font-size: 1.7rem; font-weight: 790; }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { font-size: 1.45rem; }
.brand small { letter-spacing: .2em; font-size: .83rem; margin-top: 4px; }
.search { display: flex; gap: 7px; }
.search input { width: 100%; }
.catalog-nav { background: #efede4; border-block: 1px solid var(--line); }
.nav-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding-block: 8px; }
.nav-row ul { list-style: none; padding: 0; margin: 0; }
.nav-row > ul { display: contents; }
.nav-row > ul > li { position: relative; }
.catalog-nav a, .catalog-nav summary { display: block; text-decoration: none; padding: 7px 9px; font-size: .93rem; font-weight: 600; border-radius: 5px; }
.catalog-nav summary { display: list-item; cursor: pointer; }
.catalog-nav a:hover, .catalog-nav summary:hover { background: #fff8e3; }
.catalog-nav .nav-action { color: #735219; }
.nav-row > ul > li > details > .branch { position: absolute; z-index: 3; left: 0; top: 100%; width: min(330px, 86vw); max-height: 59vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 7px; box-shadow: 0 9px 28px #2222; }
.nav-row > ul > li:nth-child(n+8) > details > .branch { left: auto; right: 0; }
.branch > a { background: #f0eee7; }
.branch .branch { border-left: 1px solid var(--line); margin-left: 12px; }
.hero { min-height: 340px; display: flex; align-items: center; border-radius: 14px; padding: clamp(24px, 5vw, 64px); color: #fff; background: linear-gradient(90deg, #17251ff5, #17251fb0 48%, #17251f1f), url('/static/hero.jpg') center 56% / cover; }
.hero h1 { margin-bottom: 10px; font-size: clamp(2rem, 4.2vw, 3.7rem); letter-spacing: -.045em; }
.hero p { margin-bottom: 16px; }
.hero p:first-child { color: #f0cc84; }
.listing-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin: 25px 0 12px; }
.listing-heading > :is(h1,h2) { margin: 0; }
.listing-heading span, .sku, .breadcrumb, .price del { color: var(--subtle); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 23px; }
.chips:empty { display: none; }
.chips a { background: #fff; border: 1px solid var(--line); border-radius: 100px; text-decoration: none; font-size: .9rem; padding: 5px 13px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.product, .detail, .panel, .empty { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; }
.product { min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.image { height: 205px; padding: 17px; display: grid; place-items: center; border-bottom: 1px solid #eeebe4; overflow: hidden; }
.image img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.no-image { color: #6c6557; }
.product-body { padding: 15px; display: flex; flex-direction: column; flex: 1; }
.product h3 { margin-bottom: 14px; overflow-wrap: anywhere; }
.product h3 a { text-decoration: none; }
.sku { margin: 0 0 6px; font-size: .84rem; overflow-wrap: anywhere; }
.product .price { margin-top: auto; }
.price { font-size: 1.13rem; margin-bottom: 13px; }
.price del { font-size: .88rem; }
.cart-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cart-form label { display: flex; align-items: center; gap: 5px; font-size: .85rem; }
.cart-form input { width: 62px; padding: 6px; }
.cart-form button { font-size: .86rem; padding: 7px 9px; }
.cart-form [role=status] { flex-basis: 100%; color: #305633; font-size: .85rem; }
.pager { display: flex; justify-content: center; gap: 14px; align-items: center; margin-top: 25px; }
.detail { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; padding: clamp(16px, 4vw, 40px); }
.detail .image { height: 350px; border: 0; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
.panel, .empty { padding: clamp(16px, 4vw, 30px); }
.panel { max-width: 900px; margin-inline: auto; }
.panel form:not(.cart-form) { display: grid; gap: 14px; }
.panel form button { justify-self: start; }
.panel form > label, .fields label { display: grid; gap: 5px; font-weight: 625; }
.panel form .check { display: flex; align-items: center; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.order-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px auto; gap: 10px; align-items: center; padding-block: 10px; border-bottom: 1px solid var(--line); }
.order-row input { width: 100%; }
.order-row span { overflow-wrap: anywhere; }
.footer, .admin-header { background: var(--green); color: #f8f6ef; }
.footer .container, .admin-header .container, .admin-header nav { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; padding-block: 15px; }
.admin-header nav { margin-right: auto; padding: 0; }
.admin-header a { text-decoration: none; }
.login { max-width: 430px; margin-block: 45px; }
.login h1, .editor h1 { margin-top: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
table { width: 100%; border-collapse: collapse; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
td:last-child { text-align: right; }
tr:last-child td { border-bottom: 0; }
.admin-search { max-width: 450px; margin-bottom: 14px; }
.admin-image img { max-width: 125px; max-height: 125px; object-fit: contain; }
.delete-form { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger { background: #f3dfda; color: #7a261b; }
.message { padding: 10px 13px; background: #eff6e9; }
.message.error { color: #7a261b; background: #f7e7e3; }
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .head-main { gap: 16px; }
  .nav-row > ul > li:nth-child(n) > details > .branch { position: static; width: auto; }
  .nav-row > ul > li:has(> details[open]) { width: 100%; }
}
@media (max-width: 680px) {
  .container { width: calc(100% - 24px); }
  .head-main { grid-template-columns: 1fr auto; gap: 12px; }
  .head-main .search { grid-row: 2; grid-column: 1/-1; }
  .head-main .button { font-size: .85rem; padding-inline: 8px; }
  .brand strong { font-size: 1.18rem; }
  .brand-icon { width: 38px; height: 38px; }
  .utility .container { justify-content: center; gap: 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .image { height: 140px; padding: 8px; }
  .product-body { padding: 10px; }
  .detail, .fields { grid-template-columns: 1fr; }
  .detail .image { height: 250px; }
  .hero { min-height: 265px; }
}

:root { --paper:#f0f5ff; --green:#101d45; --accent:#ffc740; --line:#dbe4f4; --subtle:#505e78; }
.utility { background:#101d45; }
.brand-icon { background:#154adb; color:#fff; }
.account-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.head-main { gap:24px; }
.catalog-nav { background:#164bde; border:0; color:#fff; }
.catalog-nav .nav-row { min-height:58px; gap:5px 14px; }
.catalog-nav a:hover, .catalog-nav summary:hover { background:#dfeaff; color:#12295f; }
.catalog-nav .nav-action { margin-left:auto; background:#ffcd42; color:#202440; }
.department-menu { position:relative; }
.department-menu > summary { list-style:none; padding:10px 15px; color:#162660; background:#fff; display:flex; gap:10px; align-items:center; }
.department-menu > summary::-webkit-details-marker { display:none; }
.department-menu > summary::after { content:'⌄'; margin-left:9px; }
.department-menu[open] > summary::after { content:'⌃'; }
.department-panel { position:absolute; top:calc(100% + 7px); left:0; z-index:10; width:min(740px, calc(100vw - 28px)); max-height:65vh; overflow:auto; padding:13px; background:white; color:#14234e; border:1px solid var(--line); border-radius:12px; box-shadow:0 16px 40px #11204a35; }
.department-panel > ul { display:grid; grid-template-columns:1fr 1fr; gap:4px 10px; align-items:start; }
.department-panel > ul > li { background:#f1f5ff; border-radius:6px; }
.department-panel .branch { padding:4px 7px; }
.department-panel .branch > a { background:#dae6ff; }
.hero { min-height:390px; color:#fff; background:linear-gradient(100deg,#142d9b 6%,#163edbec 41%,#102f8734 78%),url('/static/hero.jpg') center 56% / cover; }
.hero p:first-child { color:#ffe58d; font-weight:700; }
.hero h1 { max-width:620px; }
.departments { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; margin-top:18px; }
.departments a { padding:clamp(12px,2.3vw,23px); border-radius:12px; text-decoration:none; color:#fff; background:#204bd0; }
.departments a:nth-child(2) { background:#b73517; }
.departments a:nth-child(3) { background:#5c2c9f; }
.departments a:nth-child(4) { background:#087451; }
.departments a:hover { filter:brightness(1.12); }
.departments strong,.departments span { display:block; }
.departments span { margin-top:4px; font-size:.88rem; }
.product { box-shadow:0 4px 14px #183b7e0a; }
.product:hover { border-color:#a6bafb; box-shadow:0 8px 24px #173b821a; }
.cart-form button, .search button { background:#164bde; color:white; }
.cart-form button:hover, .search button:hover { background:#1139aa; }
th { padding:10px 12px; text-align:left; background:#e8efff; }
@media (max-width:960px) { .departments { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:680px) {
  .catalog-nav .nav-row { gap:5px; }
  .catalog-nav .nav-row > a { display:none; }
  .catalog-nav .nav-row > .nav-action { display:block; }
  .department-panel > ul { grid-template-columns:1fr; }
  .head-main { gap:12px; }
  .account-actions { gap:4px; }
  .account-actions .button { padding:7px; }
  .hero { min-height:310px; }
}
