@font-face {
    font-family: "Google Sans Custom";
    src: url("/assets/fonts/GoogleSans-Variable.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Archivo Black Custom";
    src: url("/assets/fonts/ArchivoBlack-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

* { box-sizing: border-box; }

:root {
    --bg: #f3f0ec;
    --workspace: #eee9e4;
    --surface: #fffdfa;
    --surface-strong: #ffffff;
    --surface-soft: #f7f3ee;
    --ink: #1f1b18;
    --muted: #776f68;
    --line: #ddd5ce;
    --line-soft: #ebe4dd;
    --rail: #191512;
    --rail-2: #241f1b;
    --accent: #ff7658;
    --accent-soft: #fff0ea;
    --teal: #246c67;
    --shadow: 0 14px 34px rgba(35, 28, 23, 0.10);
    --shadow-soft: 0 5px 18px rgba(35, 28, 23, 0.07);
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--workspace);
    font-family: "Google Sans Custom", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    letter-spacing: 0;
}

a { color: inherit; }

[hidden] {
    display: none !important;
}

::selection {
    background: rgba(255, 118, 88, 0.28);
}

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(90deg, var(--rail) 0 34%, transparent 34%),
        var(--workspace);
}

.login-box {
    width: min(420px, calc(100vw - 32px));
    padding: 30px;
    background: rgba(255, 253, 250, 0.96);
    border: 1px solid rgba(221, 213, 206, 0.9);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

h1 {
    margin: 0;
    font-size: clamp(28px, 2.2vw, 42px);
    line-height: 1.04;
    letter-spacing: 0;
    font-family: "Archivo Black Custom", "Google Sans Custom", "Segoe UI", Arial, sans-serif;
}

h2,
.topbar strong,
.product-card h2,
.detail-panel h1,
.detail-media-head h2,
.thumbnail-panel h2,
.content-head h1 {
    font-family: "Archivo Black Custom", "Google Sans Custom", "Segoe UI", Arial, sans-serif;
    letter-spacing: -0.02em;
}

label {
    display: block;
    margin: 0 0 14px;
    font-weight: 760;
}

input {
    width: 100%;
    margin-top: 6px;
    padding: 12px 12px;
    color: var(--ink);
    background: var(--surface-strong);
    border: 1px solid #cfc7c0;
    border-radius: 6px;
    outline: 0;
    font-family: inherit;
}

select,
textarea {
    width: 100%;
    margin-top: 6px;
    padding: 12px 12px;
    color: var(--ink);
    background: var(--surface-strong);
    border: 1px solid #cfc7c0;
    border-radius: 6px;
    outline: 0;
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 118, 88, 0.16);
}

select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 118, 88, 0.16);
}

button,
.topbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    color: #fffdfa;
    background: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 7px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 760;
    font-family: inherit;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

button:hover,
.topbar a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.error {
    margin-bottom: 14px;
    padding: 10px 12px;
    color: #8d2b1f;
    background: #ffe5df;
    border-radius: 6px;
}

.topbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 30px;
    color: #fffdfa;
    background: rgba(25, 21, 18, 0.98);
    border-bottom: 1px solid #302924;
}

.topbar strong {
    display: inline-block;
    margin-right: 18px;
    font-size: 24px;
    font-weight: 860;
    letter-spacing: 0;
}

.topbar span {
    color: #c9c0b8;
    font-size: 15px;
}

.topbar a {
    min-width: 120px;
    color: var(--ink);
    background: var(--surface);
    border-color: var(--surface);
}

.page {
    padding: 0;
}

.page-with-sidebar {
    min-height: calc(100vh - 76px);
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
}

.catalog-menu {
    position: sticky;
    top: 0;
    height: calc(100vh - 76px);
    padding: 22px 12px;
    overflow: auto;
    color: #f8f1eb;
    background: var(--rail);
    border-right: 1px solid #2e2722;
}

.catalog-menu::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 10px;
}

.catalog-menu::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: #bcb3ac;
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.menu-section + .menu-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #3a332d;
}

.menu-section h2 {
    margin: 0 0 10px;
    padding: 0 10px;
    color: #b9afa8;
    font-size: 11px;
    font-weight: 820;
    text-transform: uppercase;
    letter-spacing: 0;
}

.menu-section a {
    display: block;
    margin: 3px 0;
    padding: 12px 12px;
    color: #f8f1eb;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 760;
    line-height: 1.22;
}

.menu-section a:hover {
    background: var(--rail-2);
    border-color: #403832;
}

.menu-section a.active {
    color: var(--ink);
    background: var(--accent-soft);
    border-color: rgba(255, 118, 88, 0.72);
    box-shadow: inset 4px 0 0 var(--accent);
}

.menu-section p {
    margin: 0;
    padding: 0 10px;
    color: #b9afa8;
    font-size: 13px;
}

.catalog-content {
    min-width: 0;
    padding: 34px 38px 44px;
    background:
        linear-gradient(180deg, #f6f2ee 0, var(--workspace) 240px),
        var(--workspace);
}

.content-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid #d8cec6;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--teal);
    font-size: 12px;
    font-weight: 860;
    text-transform: uppercase;
}

.result-pill {
    flex: 0 0 auto;
    padding: 10px 14px;
    color: var(--teal);
    background: #e6f0ee;
    border: 1px solid #c9dfdb;
    border-radius: 999px;
    font-weight: 800;
}

.catalog-tools {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
}

.search-box {
    width: min(520px, 100%);
    margin: 0;
}

.search-box span {
    display: block;
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 860;
    text-transform: uppercase;
}

.search-box input {
    height: 46px;
    margin: 0;
    padding: 0 14px;
    background: var(--surface-strong);
    border-color: #d8cec6;
    box-shadow: var(--shadow-soft);
}

.search-count {
    flex: 0 0 auto;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    color: var(--muted);
    background: rgba(255, 253, 250, 0.78);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 800;
}

.search-empty {
    margin-top: 16px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.product-card {
    min-width: 0;
    display: grid;
    gap: 10px;
    padding: 14px;
    background: rgba(255, 253, 250, 0.96);
    border: 1px solid rgba(221, 213, 206, 0.92);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: #c9bbb0;
    box-shadow: 0 16px 34px rgba(35, 28, 23, 0.12);
}

.product-card-main {
    display: block;
    color: inherit;
    text-decoration: none;
}

.product-card-media {
    min-height: 0;
    display: block;
    width: 100%;
    overflow: hidden;
    padding: 0;
    color: inherit;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: linear-gradient(180deg, #fffdfb 0%, #f7f3ee 100%);
    box-shadow: none;
}

.product-card-media.has-lightbox {
    cursor: zoom-in;
}

.product-card img,
.product-card .thumb-empty {
    width: 100%;
    aspect-ratio: 16 / 8.6;
    display: block;
    object-fit: contain;
    padding: 10px;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.product-card .thumb-empty {
    display: grid;
    place-items: center;
    color: #8c837b;
}

.product-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.product-card-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    color: var(--teal);
    background: rgba(230, 240, 238, 0.96);
    border: 1px solid #c9dfdb;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0;
    text-transform: uppercase;
}

.product-card-body {
    display: grid;
    gap: 10px;
}

.product-card-head {
    display: grid;
    gap: 6px;
}

.product-card-category,
.product-card-price-label,
.product-card-footer span {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

.product-card h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.18;
    font-weight: 860;
}

.product-card-customer {
    margin: 0;
    color: var(--muted);
    line-height: 1.35;
    font-size: 12px;
}

.product-card-pricing {
    display: grid;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
}

.product-card-material-list {
    display: grid;
    gap: 10px;
}

.product-card-material-panel {
    display: grid;
    gap: 4px;
    padding: 11px;
    background: #faf6f1;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
}

.product-card-material {
    margin: 0;
    color: var(--ink);
    font-size: 11px;
    line-height: 1.4;
    font-weight: 700;
}

.product-card-material-price {
    margin: 0;
    color: var(--teal);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 780;
}

.product-card-material-breakdown {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.product-card-more {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 2px;
}

.product-card-footer strong {
    color: var(--teal);
    font-size: 12px;
    font-weight: 780;
}

.product-card-footer span {
    color: var(--teal);
    font-size: 14px;
    font-weight: 700;
}

.muted-row {
    color: var(--muted);
}

.empty {
    max-width: 560px;
    margin: 0;
    padding: 16px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.success {
    max-width: 680px;
    margin: 0 0 18px;
    padding: 14px 16px;
    color: #18534f;
    background: #e6f0ee;
    border: 1px solid #c9dfdb;
    border-radius: 8px;
    font-weight: 760;
}

.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;
}

.detail-page,
.order-page {
    min-height: calc(100vh - 76px);
    padding: 30px 34px 40px;
    background:
        radial-gradient(circle at top right, rgba(255, 118, 88, 0.08), transparent 26%),
        linear-gradient(180deg, #f7f3ef 0, var(--workspace) 260px),
        var(--workspace);
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.34fr) minmax(390px, 0.78fr);
    gap: 28px;
    align-items: start;
}

.detail-media,
.detail-panel,
.cart-item,
.place-order {
    background: rgba(255, 253, 250, 0.96);
    border: 1px solid rgba(221, 213, 206, 0.92);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.detail-media,
.detail-panel {
    border-radius: 24px;
}

.detail-media {
    position: relative;
    display: grid;
    gap: 18px;
    padding: 22px;
}

.detail-media-head {
    display: flex;
    align-items: start;
    justify-content: flex-start;
    gap: 14px;
}

.detail-media-head h2 {
    margin: 4px 0 0;
    font-size: 18px;
    line-height: 1.16;
    font-weight: 740;
}

.detail-media-gallery {
    display: grid;
    gap: 18px;
}

.detail-media-card {
    display: grid;
    gap: 12px;
}

.detail-media-card-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.detail-media-stage {
    min-height: min(58vh, 700px);
    display: grid;
    place-items: center;
    padding: 26px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 244, 239, 0.96));
    border: 1px solid rgba(234, 226, 217, 0.92);
    border-radius: 22px;
}

.detail-media-stage-secondary {
    min-height: min(38vh, 420px);
}

.detail-media-link {
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
    color: inherit;
    text-decoration: none;
    cursor: zoom-in;
}

.detail-media img,
.detail-media .thumb-empty {
    width: 100%;
    max-height: min(56vh, 640px);
    object-fit: contain;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.detail-media-stage-secondary img,
.detail-media-stage-secondary .thumb-empty {
    max-height: min(34vh, 360px);
}

.detail-media-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.detail-media-foot p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox-backdrop[hidden] {
    display: none !important;
}

.lightbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(24, 18, 15, 0.76);
    backdrop-filter: blur(4px);
}

.lightbox-shell {
    position: relative;
    width: min(1280px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    display: grid;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 253, 250, 0.98);
    border: 1px solid rgba(221, 213, 206, 0.92);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(18, 14, 12, 0.32);
}

.lightbox-meta {
    padding-right: 56px;
}

.lightbox-meta strong {
    display: block;
    font-size: 22px;
    line-height: 1.12;
}

.lightbox-stage {
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    cursor: zoom-out;
    background:
        radial-gradient(circle at top right, rgba(255, 118, 88, 0.10), transparent 28%),
        linear-gradient(180deg, #fffdfb 0%, #f7f3ee 100%);
    border: 1px solid var(--line-soft);
    border-radius: 16px;
}

.lightbox-stage img {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 190px);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    min-width: 46px;
    min-height: 46px;
    padding: 0;
    font-size: 28px;
    line-height: 1;
    border-radius: 999px;
}

.detail-panel {
    display: grid;
    gap: 22px;
    padding: 30px 28px;
    position: sticky;
    top: 24px;
}

.detail-header {
    margin: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(232, 224, 216, 0.92);
}

.detail-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-head-top .eyebrow {
    margin: 0;
}

.detail-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 13px;
    color: var(--teal);
    background: rgba(255, 253, 250, 0.92);
    border: 1px solid rgba(211, 229, 226, 0.92);
    border-radius: 999px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 740;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-back-link:hover {
    color: var(--ink);
    background: var(--accent-soft);
    border-color: rgba(255, 118, 88, 0.72);
}

.detail-panel h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 2.6vw, 40px);
    line-height: 0.98;
    letter-spacing: -0.03em;
    font-weight: 760;
}

.detail-muted {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
}

.detail-quick-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.detail-stat,
.price-preview-card,
.detail-inline-note {
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(249, 244, 239, 0.96), rgba(246, 240, 234, 0.96));
    border: 1px solid rgba(234, 226, 217, 0.92);
    border-radius: 16px;
}

.detail-stat span,
.price-preview-head span,
.price-preview-grid span,
.detail-inline-note p {
    color: var(--muted);
}

.detail-stat span,
.price-preview-grid span {
    display: block;
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.detail-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 16px;
    font-weight: 740;
}

.detail-form-section {
    display: grid;
    gap: 18px;
}

.detail-section-head h2 {
    margin: 0 0 6px;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 740;
}

.detail-section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.detail-config-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(249, 244, 239, 0.88), rgba(246, 240, 234, 0.92));
    border: 1px solid rgba(234, 226, 217, 0.92);
    border-radius: 18px;
}

.material-option-list {
    display: grid;
    gap: 10px;
}

.material-option {
    width: 100%;
    min-height: 0;
    padding: 14px 16px;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink);
    background: rgba(255, 253, 250, 0.98);
    border: 1px solid rgba(223, 214, 205, 0.96);
    border-radius: 16px;
    text-align: left;
}

.material-option:hover {
    color: var(--ink);
    background: rgba(255, 248, 244, 0.98);
    border-color: rgba(255, 118, 88, 0.58);
}

.material-option.is-active {
    background: linear-gradient(180deg, #fff6f2 0%, #fffdfb 100%);
    border-color: rgba(255, 118, 88, 0.88);
    box-shadow: 0 0 0 4px rgba(255, 118, 88, 0.10);
}

.material-option-name,
.material-option-price {
    display: block;
}

.material-option-copy {
    display: grid;
    justify-items: end;
    gap: 4px;
    text-align: right;
}

.material-option-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
}

.material-option-price {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 760;
    line-height: 1.3;
    white-space: nowrap;
}

.material-option-breakdown {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
    font-weight: 560;
    white-space: nowrap;
}

.price-preview-card {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    background: rgba(255, 253, 250, 0.92);
}

.price-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.price-preview-head strong,
.price-preview-grid strong {
    font-size: 15px;
    line-height: 1.25;
    font-weight: 760;
}

.price-preview-head span {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.price-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.price-preview-grid > div {
    min-width: 0;
}

.detail-field-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.78fr) minmax(0, 1.22fr);
    gap: 14px;
    align-items: start;
}

.detail-inline-note strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 760;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.detail-inline-note p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.detail-form-section > label {
    margin: 0;
    color: var(--ink);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-form-section > label input,
.detail-form-section > label select,
.detail-form-section > label textarea,
.detail-field-grid label input {
    margin-top: 8px;
}

.detail-field-grid label {
    margin: 0;
    color: var(--ink);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-config-card select,
.detail-form-section textarea,
.detail-field-grid input {
    border-radius: 14px;
}

.detail-panel > button,
.place-order button {
    width: 100%;
    margin-top: 8px;
    min-height: 50px;
    border-radius: 12px;
}

.thumbnail-source-pill {
    flex: 0 0 auto;
    padding: 7px 11px;
    color: var(--teal);
    background: rgba(230, 240, 238, 0.92);
    border: 1px solid rgba(201, 223, 219, 0.92);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 740;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.thumbnail-panel {
    margin-top: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
    gap: 22px;
    padding: 26px;
    background: rgba(255, 253, 250, 0.96);
    border: 1px solid rgba(221, 213, 206, 0.92);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
}

.thumbnail-panel-copy {
    max-width: 720px;
}

.thumbnail-panel h2 {
    margin: 0 0 6px;
    font-size: 19px;
    line-height: 1.2;
    font-weight: 740;
}

.thumbnail-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.thumbnail-tips {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 8px;
}

.thumbnail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
    margin-top: 0;
}

.thumbnail-actions form {
    margin: 0;
    height: 100%;
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 18px;
    background: linear-gradient(180deg, rgba(249, 244, 239, 0.82), rgba(246, 240, 234, 0.92));
    border: 1px solid rgba(234, 226, 217, 0.92);
    border-radius: 18px;
}

.thumbnail-actions input[type="file"] {
    min-height: 44px;
    padding: 10px;
    background: var(--surface-soft);
}

.thumbnail-form-title {
    margin: 0;
    color: var(--ink);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.success-note {
    margin-top: 12px;
    padding: 10px 12px;
    color: var(--teal);
    background: #e6f0ee;
    border: 1px solid #c9dfdb;
    border-radius: 6px;
    font-weight: 720;
}

.form-note {
    margin: -4px 0 14px;
    padding: 10px 12px;
    color: #8d2b1f;
    background: #ffe5df;
    border-radius: 6px;
}

.thumbnail-panel > .success-note,
.thumbnail-panel > .error {
    grid-column: 1 / -1;
    margin: 0;
}

.cart-list {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.cart-item {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) 120px 130px auto;
    gap: 16px;
    align-items: center;
    padding: 12px;
}

.cart-item img,
.cart-item .thumb-empty {
    width: 160px;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: 6px;
}

.cart-item h2 {
    margin: 0 0 6px;
    font-size: 17px;
    line-height: 1.2;
}

.cart-item p {
    margin: 0;
    color: var(--muted);
    line-height: 1.3;
}

.qty-field {
    margin: 0;
}

.line-total {
    display: grid;
    gap: 4px;
}

.line-total span,
.cart-total span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 820;
    text-transform: uppercase;
}

.line-total strong,
.cart-total strong {
    font-size: 16px;
    line-height: 1.2;
}

.cart-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.cart-total {
    min-width: 240px;
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.place-order {
    max-width: 680px;
    padding: 18px;
}

.history-client-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.history-client-filter span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 860;
    text-transform: uppercase;
}

.history-client-filter a {
    padding: 9px 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 760;
}

.history-client-filter a.active,
.history-client-filter a:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.orders-history-list {
    display: grid;
    gap: 14px;
}

.order-history-card {
    padding: 16px;
    background: rgba(255, 253, 250, 0.96);
    border: 1px solid rgba(221, 213, 206, 0.92);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.order-history-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.order-history-head h2 {
    margin: 0 0 4px;
    font-size: 19px;
}

.order-history-head p,
.order-history-customer,
.order-history-comment {
    margin: 0;
    color: var(--muted);
    line-height: 1.35;
}

.order-history-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.order-history-actions form {
    margin: 0;
}

button.danger-button {
    min-height: 34px;
    padding: 7px 11px;
    color: #8d2b1f;
    background: #fff4ef;
    border-color: #f0b7a6;
}

button.danger-button:hover {
    color: #fffaf7;
    background: #b63a2a;
    border-color: #b63a2a;
}

.order-history-comment {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: 6px;
}

.status-pill {
    flex: 0 0 auto;
    padding: 8px 11px;
    color: var(--teal);
    background: #e6f0ee;
    border: 1px solid #c9dfdb;
    border-radius: 999px;
    font-weight: 840;
}

.order-items-table {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.order-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 180px;
    gap: 12px;
    align-items: start;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: 6px;
}

.order-item-row strong,
.order-item-row span {
    display: block;
}

.order-item-row span {
    margin-top: 3px;
    color: var(--muted);
}

.order-item-row > div:nth-child(2),
.order-item-row > div:nth-child(3) {
    font-weight: 780;
}

.order-history-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}

.order-history-total span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 860;
    text-transform: uppercase;
}

@media (max-width: 980px) {
    .page-with-sidebar {
        grid-template-columns: 1fr;
    }

    .catalog-menu {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid #2e2722;
    }

    .catalog-content {
        padding: 24px 18px 32px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .topbar {
        height: auto;
        min-height: 70px;
        padding: 14px 16px;
    }

    .topbar strong,
    .topbar span {
        display: block;
    }

    .topbar span {
        margin-top: 4px;
    }

    .topbar a {
        min-width: auto;
        padding: 0 14px;
    }

    .topbar-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .content-head {
        align-items: start;
        flex-direction: column;
    }

    .catalog-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .search-count {
        align-self: flex-start;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-card-price-row {
        grid-template-columns: 1fr;
    }

    .product-card-price-values {
        justify-items: start;
        text-align: left;
    }

    .product-card-footer {
        align-items: start;
        flex-direction: column;
    }

    .product-card-meta {
        align-items: start;
        flex-direction: column;
    }

    .product-detail {
        grid-template-columns: 1fr;
    }

    .detail-panel {
        position: static;
    }

    .detail-head-top,
    .detail-media-head,
    .price-preview-head,
    .detail-field-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .detail-quick-stats,
    .price-preview-grid,
    .thumbnail-actions,
    .thumbnail-panel {
        grid-template-columns: 1fr;
    }

    .thumbnail-actions {
        align-items: stretch;
    }

    .lightbox-backdrop {
        padding: 16px;
    }

    .lightbox-shell {
        width: min(100vw - 32px, 100%);
        max-height: calc(100vh - 32px);
        padding: 16px;
    }

    .lightbox-meta {
        padding-right: 0;
    }

    .lightbox-meta strong {
        font-size: 18px;
    }

    .cart-item {
        grid-template-columns: 1fr;
    }

    .order-item-row {
        grid-template-columns: 1fr;
    }

    .order-history-total {
        align-items: flex-start;
        flex-direction: column;
    }

    .cart-item img,
    .cart-item .thumb-empty {
        width: 100%;
    }
}

@media (min-width: 981px) and (max-width: 1380px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
