:root {
    color-scheme: light;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #172033;
    background: #f5f7fa;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    --navy: #10233f;
    --blue: #0876a5;
    --blue-dark: #075985;
    --muted: #64748b;
    --line: #e4e9ef;
    --surface: #fff;
    --page-width: 1180px;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.65; }
a { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #7dd3fc;
    outline-offset: 3px;
}
.site-page { min-height: 100vh; display: flex; flex-direction: column; background: #f5f7fa; }
.site-header {
    position: sticky;
    z-index: 5;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 11px max(24px, calc((100% - var(--page-width)) / 2));
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid #e8edf2;
    box-shadow: 0 3px 14px #0f172a0b;
    backdrop-filter: blur(12px);
}
.brand img { display: block; width: 166px; max-height: 56px; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { color: #334155; text-decoration: none; font-size: .96rem; font-weight: 650; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--blue); }
.site-nav .nav-contact { padding: 9px 16px; border-radius: 7px; background: var(--navy); color: #fff; }
.site-nav .nav-contact:hover { background: #19385e; color: #fff; }
.audience-toggle {
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid #d5dde7;
    border-radius: 7px;
    background: #fff;
    color: #334155;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
}
.audience-toggle:hover { border-color: #9fc5d6; background: #f3f9fb; color: var(--blue-dark); }
.catalog-main, .admin-main { width: min(var(--page-width), calc(100% - 40px)); margin: 0 auto; flex: 1; }
.catalog-main { padding: 40px 0 64px; }
.catalog-hero { margin: 0 0 28px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--blue-dark);
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.eyebrow::before { width: 22px; height: 2px; background: #18a4bd; content: ""; }
.page-heading { margin: 0 0 8px; color: var(--navy); font-size: clamp(2rem, 4vw, 2.85rem); line-height: 1.2; letter-spacing: -.035em; }
.page-intro { max-width: 680px; margin: 0; color: #5b6779; font-size: 1.04rem; }
.catalog-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(190px, 250px) auto;
    gap: 10px;
    margin: 25px 0 15px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 5px 20px #0f172a08;
}
.catalog-tools input, .catalog-tools select {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #d5dde7;
    border-radius: 7px;
    background: #fff;
    color: #172033;
}
.catalog-tools input::placeholder { color: #8793a3; }
.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 0;
    border-radius: 7px;
    background: var(--blue);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.button:hover { transform: translateY(-1px); background: var(--blue-dark); box-shadow: 0 5px 12px #07598525; }
.button.secondary { background: #edf3f7; color: #24354b; }
.button.secondary:hover { background: #dce8f0; box-shadow: none; }
.button.danger { background: #b42318; color: #fff; }
.catalog-results { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.catalog-result-count { margin: 0 0 16px; color: var(--muted); font-size: .93rem; }
.clear-filters { margin: 0 0 16px; font-size: .9rem; font-weight: 650; text-decoration: none; }
.clear-filters:hover { text-decoration: underline; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 20px; }
.product-card {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #e9edf2;
    border-radius: 11px;
    background: var(--surface);
    box-shadow: 0 4px 16px #0f172a08;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.product-card:hover { transform: translateY(-4px); border-color: #d3e2ec; box-shadow: 0 14px 30px #0f172a12; }
.product-card-image { position: relative; display: block; overflow: hidden; background: #eaf0f4; }
.product-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .25s ease; }
.product-card:hover img { transform: scale(1.025); }
.product-placeholder { display: grid; min-height: 230px; aspect-ratio: 4 / 3; place-items: center; background: linear-gradient(140deg,#eef3f6,#e3ebf0); color: #6b7789; font-size: .9rem; }
.featured-tag { position: absolute; top: 12px; left: 12px; padding: 5px 10px; border-radius: 99px; background: #fff; color: #075985; font-size: .76rem; font-weight: 750; box-shadow: 0 2px 8px #0f172a18; }
.product-card-content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 17px; }
.product-category, .muted { color: var(--muted); font-size: .87rem; }
.product-category { margin-bottom: 5px; }
.product-card h2 { margin: 0 0 8px; font-size: 1.12rem; line-height: 1.4; }
.product-card h2 a { color: var(--navy); text-decoration: none; }
.product-card h2 a:hover { color: var(--blue-dark); }
.product-card p { margin: 0 0 15px; color: #5b6779; font-size: .93rem; line-height: 1.55; }
.product-price { margin: auto 0 13px; padding-top: 5px; color: var(--blue-dark); font-size: 1.04rem; font-weight: 750; }
.product-card-content .button { margin-top: auto; }
.empty-state { padding: 30px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #526074; text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--navy); font-size: 1.1rem; }
.empty-state p { margin: 0 0 16px; }
.notice { padding: 16px 18px; border: 1px solid #dce8ef; border-left: 4px solid var(--blue); border-radius: 9px; background: #fff; color: #526074; }
.notice.error { border-color: #f3d4d1; border-left-color: #b42318; color: #8e1b13; }
.product-back { display: inline-flex; gap: 7px; align-items: center; margin: 0 0 18px; color: #526074; text-decoration: none; font-weight: 650; }
.product-back:hover { color: var(--blue-dark); }
.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); gap: 38px; padding: clamp(20px, 4vw, 42px); border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 26px #0f172a08; }
.product-detail-image { position: sticky; top: 100px; display: block; width: 100%; max-height: 620px; border-radius: 10px; background: #eaf0f4; object-fit: contain; }
.product-detail h1 { margin: 3px 0 10px; color: var(--navy); font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.2; letter-spacing: -.025em; }
.product-detail h2 { margin: 25px 0 9px; color: var(--navy); font-size: 1.13rem; }
.product-detail .product-category { font-weight: 700; }
.product-detail .product-price { margin: 8px 0 16px; padding: 0; font-size: 1.35rem; }
.product-copy { white-space: pre-line; color: #526074; }
.product-summary { margin: 0 0 18px; color: #405066; font-size: 1.04rem; }
.specifications { padding-left: 20px; color: #526074; white-space: pre-line; }
.product-contact { margin-top: 26px; padding: 18px; border-radius: 9px; background: #f2f7fa; }
.product-contact p { margin: 0 0 12px; color: #526074; }
.site-footer { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 23px; border-top: 1px solid #263d58; background: #10233f; color: #d7e1ee; }
.site-footer p { margin: 0; }
.site-footer a { color: #d7e1ee; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.admin-page { min-height: 100vh; background: #f4f6f9; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px max(20px, calc((100% - var(--page-width)) / 2)); background: #10233f; color: #fff; box-shadow: 0 3px 12px #10233f20; }
.admin-topbar a { color: #fff; text-decoration: none; }
.admin-brand { font-size: 1.05rem; font-weight: 750; white-space: nowrap; }
.admin-links { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; }
.admin-links a { color: #dce8f2; font-size: .92rem; }
.admin-links a:hover { color: #fff; }
.admin-main { padding: 32px 0 56px; }
.admin-main > .notice { margin-bottom: 18px; }
.admin-panel { padding: clamp(18px, 3vw, 28px); border: 1px solid #e7ebf0; border-radius: 11px; background: #fff; box-shadow: 0 5px 18px #0f172a08; }
.admin-panel + .admin-panel { margin-top: 18px; }
.admin-panel h1 { margin: 0 0 5px; color: var(--navy); font-size: 1.75rem; }
.admin-panel h2 { margin: 23px 0 12px; color: var(--navy); font-size: 1.16rem; }
.admin-panel > .muted { margin: 0 0 20px; }
.admin-form { display: grid; gap: 15px; max-width: 760px; }
.admin-form label { display: grid; gap: 6px; color: #334155; font-size: .94rem; font-weight: 650; }
.admin-form input, .admin-form select, .admin-form textarea {
    width: 100%;
    min-height: 43px;
    padding: 10px 11px;
    border: 1px solid #d3dbe5;
    border-radius: 7px;
    background: #fff;
    color: #172033;
}
.admin-form input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--blue); }
.admin-form label:has(input[type="checkbox"]) span { display: flex; align-items: center; gap: 9px; }
.admin-form textarea { min-height: 130px; resize: vertical; }
.admin-form small { color: var(--muted); font-size: .85rem; font-weight: 400; }
.admin-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.admin-actions form { display: inline-flex; }
.inline-translation-form { display: flex; min-width: 260px; gap: 7px; }
.inline-translation-form input { width: 100%; min-width: 130px; min-height: 38px; padding: 7px 9px; border: 1px solid #d3dbe5; border-radius: 7px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.admin-table th, .admin-table td { padding: 12px 11px; border-bottom: 1px solid #e8edf2; text-align: left; vertical-align: middle; }
.admin-table th { background: #f8fafc; color: #526074; font-size: .85rem; font-weight: 700; }
.admin-table tbody tr:hover { background: #fafcfd; }
.status { display: inline-block; padding: 4px 10px; border-radius: 99px; background: #edf2f7; font-size: .82rem; font-weight: 650; }
.status.published, .status.active { background: #e5f6ec; color: #166534; }
.status.draft, .status.inactive { background: #f1f5f9; color: #526074; }
.role-badge { display: inline-block; padding: 4px 10px; border: 1px solid #dce5eb; border-radius: 99px; background: #f5f8fa; color: #405066; font-size: .82rem; font-weight: 700; }
.role-badge.role-super { border-color: #c8dff0; background: #eaf5fb; color: #075985; }
.admin-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; margin-top: 22px; }
.summary-card { padding: 18px; border: 1px solid #e8edf2; border-radius: 9px; background: #f9fbfc; color: #526074; }
.summary-card strong { display: block; color: var(--navy); font-size: 1.9rem; line-height: 1.25; }
.login-wrap { width: min(440px, calc(100% - 32px)); margin: 8vh auto; }
.login-wrap .admin-panel { padding: 30px; }
.login-wrap h1 { margin-bottom: 4px; }
.login-wrap .admin-form { margin-top: 22px; }
.login-wrap > .admin-panel > p:last-child { margin: 20px 0 0; text-align: center; }

@media (max-width: 700px) {
    .site-header { position: static; align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px 20px; }
    .site-nav { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
    .site-nav a { font-size: .9rem; }
    .site-nav .nav-contact { padding: 7px 10px; }
    .catalog-main, .admin-main { width: min(100% - 28px, var(--page-width)); }
    .catalog-main { padding: 28px 0 44px; }
    .catalog-tools { grid-template-columns: 1fr; }
    .catalog-tools .button { width: 100%; }
    .catalog-results { align-items: flex-start; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
    .product-detail { grid-template-columns: 1fr; gap: 22px; }
    .product-detail-image { position: static; max-height: 440px; }
    .admin-topbar { align-items: flex-start; flex-direction: column; padding: 14px 18px; }
    .admin-links { gap: 12px; }
    .admin-main { padding-top: 20px; }
    .site-footer { flex-direction: column; gap: 4px; text-align: center; }
}

@media (max-width: 420px) {
    .product-grid { grid-template-columns: 1fr; }
    .product-card img, .product-placeholder { aspect-ratio: 16 / 10; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
