/*
 * Estate OS local theme overrides.
 *
 * Keep this file small: override only the Material design tokens declared in
 * theme.css. It is loaded last and is intentionally excluded from update
 * overlays so a local brand is not overwritten.
 *
 * Example:
 * :root {
 *     --md-sys-color-primary: #8bd5ff;
 *     --md-sys-color-on-primary: #00344a;
 *     --md-sys-color-primary-container: #004d67;
 *     --md-sys-color-on-primary-container: #c2e8ff;
 *     --md-sys-shape-corner-medium: 20px;
 * }
 */

.service-tree-shop { --service-accent: #e8a949; }
.service-tree-shop .service-tree-icon { color: #e8a949; border-color: #e8a949; }
.shop-admin-product > summary input[type="checkbox"] { width:18px; height:18px; margin-right:10px; }
.shop-admin-preview { display:grid; gap:10px; }
.shop-admin-preview[hidden] { display:none; }
.shop-admin-preview img { max-width:min(100%,256px); max-height:192px; object-fit:contain; }

/* Shop catalogue: shared dashboard colours follow the selected theme. */
.shop-admin-page { color:var(--text); min-width:0; }
.shop-admin-page .section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:24px; }
.shop-admin-page .section-heading p { max-width:65ch; color:var(--muted); }
.shop-admin-page .section-heading .button { flex-shrink:0; }
.shop-admin-page .shop-admin-product { margin:0 0 10px; border:1px solid var(--border); border-radius:14px; background:var(--surface-deep); overflow:hidden; }
.shop-admin-page .shop-admin-product > summary { display:flex; align-items:center; gap:16px; padding:18px 20px; cursor:pointer; list-style:none; color:var(--text); }
.shop-admin-product > summary::-webkit-details-marker { display:none; }
.shop-admin-product > summary:hover { background:var(--surface); }
.shop-admin-title { flex:1; min-width:0; overflow-wrap:anywhere; }
.shop-admin-version { color:var(--muted); font-size:.85rem; }
.shop-admin-price { min-width:75px; text-align:right; font-weight:700; white-space:nowrap; }
.shop-admin-status { padding:5px 10px; border:1px solid var(--border); border-radius:999px; font-size:.75rem; color:var(--muted); background:var(--surface); white-space:nowrap; }
.shop-admin-status.is-published { color:var(--md-sys-color-on-primary-container); background:var(--md-sys-color-primary-container); }
.shop-admin-chevron { font-size:1.3rem; color:var(--muted); transition:transform .15s; }
.shop-admin-product[open] > summary .shop-admin-chevron { transform:rotate(180deg); }
.shop-admin-page .shop-admin-product > .dashboard-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; padding:24px; margin:0; border-top:1px solid var(--border); }
.shop-admin-product .dashboard-form label { display:flex; flex-direction:column; gap:8px; min-width:0; font-weight:600; }
.shop-admin-product .dashboard-form :is(input:not([type="checkbox"]),select,textarea) { width:100%; min-width:0; box-sizing:border-box; }
.shop-admin-wide { grid-column:1 / -1; }
.shop-admin-product .dashboard-form small { font-weight:400; color:var(--muted); }
.shop-admin-product .dashboard-form .checkbox-row { flex-direction:row; align-items:center; }
.shop-admin-product .dashboard-form > .button { justify-self:start; }
.shop-admin-page .shop-admin-toolbar { display:grid; gap:12px; padding:16px; margin:22px 0 12px; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.shop-admin-toolbar .button-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0; }
.shop-admin-toolbar .button { min-height:36px; padding:9px 14px; font-size:.85rem; }
.shop-admin-toolbar output { color:var(--muted); margin-left:auto; font-size:.85rem; }
.shop-admin-count { color:var(--muted); font-size:.85rem; margin:16px 0 12px; }
.shop-admin-page .table-scroll { overflow-x:auto; border:1px solid var(--border); border-radius:14px; margin:16px 0 28px; background:var(--surface-deep); }
.shop-admin-page > details:not(.shop-admin-product) { border:1px solid var(--border); border-radius:14px; padding:18px; background:var(--surface-deep); margin:20px 0; }
.shop-admin-page > details > summary { cursor:pointer; font-weight:600; }
.shop-admin-page h3 { margin-top:28px; }
.shop-admin-product > summary:focus-visible { outline:2px solid var(--md-sys-color-primary); outline-offset:-3px; }
@media (max-width:700px) {
    .shop-admin-page .section-heading { flex-direction:column; gap:12px; }
    .shop-admin-page .shop-admin-product > summary { flex-wrap:wrap; gap:10px; padding:14px; }
    .shop-admin-title { flex-basis:calc(100% - 60px); }
    .shop-admin-chevron { margin-left:auto; }
    .shop-admin-page .shop-admin-product > .dashboard-form { grid-template-columns:1fr; padding:16px; }
    .shop-admin-toolbar output { width:100%; margin-left:0; }
}

.article-permission-switch { appearance:none; flex-shrink:0; width:42px; height:24px; min-height:0; padding:3px; border:1px solid var(--border-strong); border-radius:999px; background:var(--surface-soft); cursor:pointer; }
.article-permission-switch::before { content:''; display:block; width:16px; height:16px; border-radius:50%; background:var(--muted); transition:transform .15s; }
.article-permission-switch:checked { background:var(--md-sys-color-primary); border-color:var(--md-sys-color-primary); }
.article-permission-switch:checked::before { transform:translateX(17px); background:var(--md-sys-color-on-primary); }
.shop-admin-product .dashboard-form .object-switch { flex-direction:row; }

.shop-admin-sku { display:block; margin-top:4px; font-size:.75rem; font-weight:400; color:var(--muted); }

/* Article editor: compact fields, consistent surfaces and contained actions. */
.shop-admin-page .shop-admin-product > .dashboard-form { gap:16px 20px; padding:20px; align-items:start; }
.shop-admin-product .dashboard-form :is(input:not([type="checkbox"]),select,textarea) { font:inherit; font-weight:400; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text); min-height:42px; }
.shop-admin-product .dashboard-form textarea { min-height:180px; line-height:1.55; resize:vertical; }
.shop-admin-product .dashboard-form label { font-weight:500; font-size:.9rem; gap:6px; }
.shop-admin-product .dashboard-form small { line-height:1.45; font-size:.8rem; }
.shop-admin-product .dashboard-form fieldset { min-width:0; margin:0; padding:14px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.shop-admin-product .dashboard-form legend { padding:0 6px; font-size:.9rem; font-weight:600; }
.shop-admin-product .shop-admin-preview { grid-column:1/-1; display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.shop-admin-product .shop-admin-preview[hidden] { display:none; }
.shop-admin-product .shop-admin-preview img { order:-1; width:128px; height:96px; object-fit:contain; border-radius:8px; }
.shop-admin-product > .article-delivery-action { display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; padding:18px 20px; border-top:1px solid var(--border); background:var(--surface); margin:0; }
.article-delivery-action .small-note { flex:1 1 280px; margin:0; line-height:1.5; }
.shop-admin-product > .article-delete-action { padding:12px 20px; margin:0; display:flex; justify-content:flex-end; border-top:1px solid var(--border); }
@media(max-width:640px) { .shop-admin-product > .article-delivery-action { align-items:stretch; } .article-delivery-action .button { width:100%; } }

.article-list-permissions { display:inline-flex; flex-wrap:wrap; align-items:center; gap:5px; margin-left:auto; }
.article-list-permissions > span { padding:3px 8px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text); font-size:.72rem; font-weight:500; line-height:1.4; white-space:nowrap; }
@media(max-width:640px) { .article-list-permissions { margin-left:0; } }
