:root {
    --ink: #25211d;
    --muted: #706960;
    --paper: #f5f1e9;
    --card: #fffdf8;
    --accent: #8f2f27;
    --gold: #bc8b45;
    --line: #ded5c7;
    --ok: #e0eee2;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, sans-serif; line-height: 1.5; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 80px; }
.narrow { max-width: 520px; }
.hero { padding: 32px 0 42px; max-width: 760px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2.3rem, 7vw, 4.8rem); line-height: 1; margin-bottom: 18px; }
h2 { font-family: Georgia, serif; }
.eyebrow, .step { text-transform: uppercase; letter-spacing: .16em; color: var(--accent); font-weight: bold; font-size: .78rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 12px 30px #3c2b1c12; }
.event-card { display: grid; gap: 20px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label { display: grid; gap: 7px; font-weight: bold; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.recommendation { padding: 14px 16px; border-left: 4px solid var(--gold); background: #f8eedf; }
.service-types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.service-type { display: grid; gap: 4px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.service-type span { font-size: .8rem; color: var(--muted); }
.service-type.active { border-color: var(--accent); box-shadow: 0 0 0 2px #8f2f2722; background: #fff9f5; }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 28px; margin-top: 44px; }
.section-heading, .modal-header, .admin-header, .request-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.category { margin: 24px 0 32px; }
.category h3 { margin: 0 0 10px; padding: 0; font-size: 1.18rem; font-weight: 800; letter-spacing: .01em; }
.products { display: grid; gap: 8px; }
.product { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 16px 4px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.product.has-image { grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; }
.product p, .muted, .fineprint { color: var(--muted); }
.product small { color: var(--muted); }
.product-action { display: grid; justify-items: end; gap: 12px; }
.product-image-button { width: 88px; height: 88px; border: 0; padding: 0; border-radius: 14px; overflow: hidden; background: #eee5d8; cursor: pointer; }
.product-image-button img, .admin-product-thumb, .admin-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.quantity { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.quantity button { border: 0; background: #eee5d8; width: 38px; height: 38px; font-size: 1.3rem; cursor: pointer; }
.quantity input { width: 55px; border: 0; text-align: center; padding: 5px; }
.line-total { color: var(--accent); font-weight: bold; }
.summary { position: sticky; top: 20px; height: max-content; }
.summary-line, .total { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-line span { display: grid; }
.summary-line small { color: var(--muted); }
.total { margin-top: 20px; font-size: 1.12rem; }
.primary, .secondary, .danger { display: inline-block; border: 0; border-radius: 10px; padding: 12px 17px; text-decoration: none; cursor: pointer; text-align: center; }
.primary { background: var(--accent); color: #fff; font-weight: bold; width: 100%; margin-top: 16px; }
.primary.compact { width: auto; margin-top: 0; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.secondary { background: #eee5d8; color: var(--ink); }
.danger { background: #f5dddd; color: #791c1c; }
.modal { position: fixed; inset: 0; background: #241c16c9; padding: 20px; display: grid; place-items: center; overflow: auto; }
.hidden, .modal.hidden, .message.hidden { display: none; }
.modal-card { width: min(760px, 100%); }
.image-modal-card { width: min(760px, 100%); display: grid; gap: 12px; justify-items: end; }
.image-modal-card img { width: 100%; max-height: 80vh; object-fit: contain; border-radius: 18px; background: #fff; }
.check { display: flex; align-items: start; margin-top: 16px; }
.check input { width: auto; margin-top: 5px; }
.service-assignment { border: 1px solid var(--line); border-radius: 12px; margin-top: 16px; padding: 8px 16px 16px; }
.service-assignment legend { font-weight: 800; padding: 0 7px; }
.service-assignment legend small { display: block; color: var(--muted); font-weight: normal; }
.service-assignment p { margin-bottom: 4px; }
.service-assignment .check { margin-top: 8px; }
.message { padding: 13px; margin: 14px 0; border-radius: 10px; }
.success { background: var(--ok); }
.error { background: #f5dddd; color: #791c1c; }
.login { display: grid; gap: 16px; }
.request { margin: 20px 0; }
.status { background: var(--ok); padding: 5px 10px; border-radius: 99px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
.admin-nav { display: flex; gap: 10px; margin: 22px 0; }
.admin-nav .active { background: var(--accent); color: #fff; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.product-admin-list { display: grid; gap: 12px; }
.admin-product { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.admin-product.inactive { opacity: .6; }
.admin-product-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-product-thumb { width: 72px; height: 72px; border-radius: 12px; border: 1px solid var(--line); flex: 0 0 auto; }
.admin-image-tools { display: grid; gap: 12px; margin-top: 16px; }
.admin-image-tools small { color: var(--muted); font-weight: normal; }
.admin-image-preview img { width: 140px; height: 140px; border-radius: 14px; border: 1px solid var(--line); }
.inline-service-types { display: flex; gap: 8px 16px; flex-wrap: wrap; border: 0; padding: 8px 0 0; margin: 8px 0 0; }
.inline-service-types legend { font-size: .8rem; font-weight: bold; color: var(--muted); }
.inline-service-types .check { margin: 0; font-size: .86rem; font-weight: normal; }

@media (max-width: 1050px) {
    .service-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
    .catalog-layout { grid-template-columns: 1fr; }
    .summary { position: static; order: -1; }
    .product, .product.has-image { grid-template-columns: 1fr; }
    .product-action { justify-items: start; }
    .admin-product { display: grid; }
}

@media (max-width: 600px) {
    .grid, .service-types { grid-template-columns: 1fr; }
    .section-heading, .modal-header, .admin-header, .request-head { display: grid; }
    .shell { width: min(100% - 20px, 1180px); padding-top: 20px; }
    .admin-nav { display: grid; }
}
