/* ==========================================================================
   Visual site editor (demo) — De Vries Bikecenter
   ========================================================================== */

body.editing { padding-top: 58px; padding-right: 0; background: #efe9dd; }
body.editing .site-header,
body.editing .site-footer,
body.editing .demo-dock,
body.editing .announce { display: none !important; }
body.editing #page {
  margin: 0 auto;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(12,14,7,.08), var(--shadow-l);
  transition: max-width .35s ease;
}
body.editing #page a { cursor: default; }
body.editing #page button:not(.blk-tools button) { pointer-events: none; }
body.editing.preview-tablet #page { max-width: 834px; }
body.editing.preview-mobile #page { max-width: 430px; }
body.editing.preview-tablet #page .products { grid-template-columns: repeat(2, minmax(0,1fr)); }
body.editing.preview-mobile #page .products,
body.editing.preview-mobile #page .cats { grid-template-columns: 1fr; }
body.editing.preview-mobile #page .usps { grid-template-columns: 1fr 1fr; }
body.editing.preview-mobile #page .split,
body.editing.preview-mobile #page .contact-grid { grid-template-columns: 1fr; }
body.editing.preview-mobile #page .footer-top { grid-template-columns: 1fr; }
body.editing.preview-mobile #page .hero h1 { font-size: 2.6rem; }

/* ------------------------------------------------------------- Top bar -- */
.ed-bar {
  position: fixed; inset: 0 0 auto 0; height: 58px; z-index: 130;
  display: flex; align-items: center; gap: 16px; padding: 0 14px;
  background: #12140d; color: #f4eee1; border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: 13px;
}
.ed-bar__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ed-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13px; letter-spacing: -.01em; }
.ed-brand svg { width: 20px; height: 20px; color: var(--burlywood); }
.ed-bar .demo-flag { background: rgba(230,187,123,.16); color: var(--burlywood); }
.ed-bar__mid { margin-inline: auto; display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.07); padding: 3px; border-radius: 10px; }
.ed-bar__mid button, .ed-bar__right button, .ed-bar__right a {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 0; border-radius: 7px; background: transparent; color: rgba(244,238,225,.78);
  font-size: 12px; font-weight: 500; transition: background .15s ease, color .15s ease;
}
.ed-bar__mid button:hover, .ed-bar__right button:hover, .ed-bar__right a:hover { background: rgba(255,255,255,.1); color: #fff; }
.ed-bar__mid button.is-active { background: var(--cream); color: var(--ink); }
.ed-bar__mid svg, .ed-bar__right svg { width: 15px; height: 15px; }
.ed-bar__right { display: flex; align-items: center; gap: 4px; }
.ed-bar__right .divider { width: 1px; height: 22px; background: rgba(255,255,255,.14); margin: 0 4px; }
.ed-btn-save { background: var(--peru) !important; color: #1b1206 !important; font-weight: 600 !important; }
.ed-btn-save:hover { background: var(--burlywood) !important; }
.ed-btn-save.is-dirty::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #1b1206; margin-left: 1px; }
.ed-close { color: rgba(244,238,225,.7); }
.ed-bar .label-full { display: inline; }
@media (max-width: 1080px) { .ed-bar .label-full { display: none; } .ed-bar__mid { display: none; } }

/* --------------------------------------------------------------- Panel -- */
.ed-panel {
  position: fixed; top: 58px; right: 0; bottom: 0; width: 328px; z-index: 125;
  background: #fbf8f2; border-left: 1px solid rgba(12,14,7,.12);
  display: flex; flex-direction: column; box-shadow: -20px 0 50px -30px rgba(12,14,7,.3);
}
.ed-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: #fff; }
.ed-tabs button { border: 0; background: transparent; padding: 13px 4px 11px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.ed-tabs button.is-active { color: var(--ink); border-bottom-color: var(--peru); }
.ed-panes { flex: 1; overflow-y: auto; }
.ed-pane { display: none; padding: 16px; }
.ed-pane.is-active { display: block; }
.ed-pane h4 { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 4px 0 10px; font-family: var(--font-ui); font-weight: 600; }
.ed-pane h4 + p { font-size: 12px; color: var(--muted); margin: -4px 0 12px; }
.ed-pane .divider { height: 1px; background: var(--line); margin: 16px 0; }

/* block list */
.ed-list { display: grid; gap: 5px; }
.ed-item {
  display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 8px;
  cursor: grab; transition: border-color .15s ease, box-shadow .15s ease;
}
.ed-item:hover { border-color: var(--line); }
.ed-item.is-selected { border-color: var(--peru); box-shadow: 0 0 0 2px rgba(206,151,70,.18); }
.ed-item.is-hidden { opacity: .45; }
.ed-item__grip { color: var(--silver-100, #b4b5ba); display: grid; place-items: center; }
.ed-item__grip svg { width: 13px; height: 13px; }
.ed-item__label { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-item__acts { display: flex; gap: 1px; }
.ed-item__acts button { width: 24px; height: 24px; border: 0; background: transparent; border-radius: 5px; display: grid; place-items: center; color: var(--muted); }
.ed-item__acts button:hover { background: var(--cream-2); color: var(--ink); }
.ed-item__acts svg { width: 13px; height: 13px; }
.ed-item.dragging { opacity: .4; }
.ed-list .drop-line { height: 2px; background: var(--peru); border-radius: 2px; margin: 2px 0; }

/* add blocks */
.ed-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-preset {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 10px;
  display: grid; gap: 8px; text-align: left; font-size: 11.5px; font-weight: 600;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.ed-preset:hover { border-color: var(--peru); transform: translateY(-2px); box-shadow: var(--shadow-s); }
.ed-preset__thumb { height: 46px; border-radius: 6px; background: var(--cream-2); display: grid; place-items: center; color: var(--brand-deep); }
.ed-preset__thumb svg { width: 22px; height: 22px; }
.ed-preset--wide { grid-column: span 2; grid-template-columns: 46px 1fr; align-items: center; }
.ed-preset--wide .ed-preset__thumb { height: 46px; width: 46px; }
.ed-preset small { display: block; font-weight: 400; color: var(--muted); font-size: 10.5px; margin-top: 2px; }

/* style pane */
.ed-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ed-swatch { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; padding: 5px; display: grid; gap: 5px; }
.ed-swatch span { display: block; height: 30px; border-radius: 5px; border: 1px solid rgba(0,0,0,.06); }
.ed-swatch small { font-size: 10px; text-align: center; color: var(--muted); }
.ed-swatch.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.ed-seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ed-seg button { border: 0; background: #fff; padding: 8px 4px; font-size: 11px; color: var(--muted); border-right: 1px solid var(--line); }
.ed-seg button:last-child { border-right: 0; }
.ed-seg button.is-active { background: var(--ink); color: var(--cream); }
.ed-field { display: grid; gap: 6px; margin-bottom: 12px; }
.ed-field label { font-size: 11px; font-weight: 600; color: var(--muted); }
.ed-field input, .ed-field select, .ed-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 8px 10px; font-size: 12px;
}
.ed-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 10px; line-height: 1.6; }
.ed-empty svg { width: 28px; height: 28px; margin: 0 auto 8px; color: var(--silver-100, #b4b5ba); }

/* ---------------------------------------------------------- Canvas marks -- */
body.editing #page [data-block] { outline: 1px dashed rgba(206,151,70,.45); outline-offset: -6px; transition: outline-color .15s ease; }
body.editing #page [data-block]:hover { outline-color: var(--peru); }
body.editing #page [data-block].is-selected { outline: 2px solid var(--peru); outline-offset: -6px; }
body.editing #page [data-block].drop-before::before,
body.editing #page [data-block].drop-after::after {
  content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--peru); z-index: 20;
}
body.editing #page [data-block].drop-before::before { top: -2px; }
body.editing #page [data-block].drop-after::after { bottom: -2px; }

.blk-tools {
  position: absolute; top: 8px; right: 8px; z-index: 30; display: flex; gap: 2px;
  background: rgba(12,14,7,.92); border-radius: 8px; padding: 3px; opacity: 0;
  transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
body.editing [data-block]:hover > .blk-tools,
body.editing [data-block].is-selected > .blk-tools,
body.editing [data-block]:focus-within > .blk-tools { opacity: 1; transform: none; }
.blk-tools__label { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.55); padding: 6px 7px 6px 9px; white-space: nowrap; }
.blk-tools button { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: rgba(255,255,255,.82); display: grid; place-items: center; }
.blk-tools button:hover { background: rgba(255,255,255,.16); color: #fff; }
.blk-tools button.is-danger:hover { background: #a33a2e; }
.blk-tools svg { width: 14px; height: 14px; }
.blk-tools__grip { cursor: grab; }
.blk-tools__grip:active { cursor: grabbing; }

body.editing [data-edit="text"] { transition: box-shadow .15s ease, background .15s ease; border-radius: 3px; }
body.editing [data-edit="text"]:hover { box-shadow: 0 0 0 2px rgba(206,151,70,.55); background: rgba(255,255,255,.08); }
body.editing [data-edit="text"]:focus { outline: none; box-shadow: 0 0 0 3px var(--peru); background: rgba(255,255,255,.12); }
body.editing img[data-edit="image"] { cursor: pointer; transition: filter .15s ease; }
body.editing img[data-edit="image"]:hover { filter: brightness(.82); }

.ed-selected-hint {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 128;
  background: rgba(12,14,7,.92); color: #f4eee1; padding: 8px 16px; border-radius: 999px;
  font-size: 11.5px; display: flex; align-items: center; gap: 8px; pointer-events: none;
  box-shadow: var(--shadow-m); white-space: nowrap;
}
.ed-selected-hint kbd { background: rgba(255,255,255,.14); border-radius: 4px; padding: 1px 5px; font-size: 10px; font-family: inherit; }
.ed-selected-hint svg { width: 13px; height: 13px; color: var(--burlywood); }

/* ---------------------------------------------------------- Media modal -- */
.media-panel { width: min(760px, 100%); padding: 26px; }
.media-panel h3 { font-size: 24px; }
.media-panel > p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.media-thumb { aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #fff; padding: 0; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb:hover { border-color: var(--peru); }
.media-thumb.is-active { border-color: var(--ink); }
.media-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.media-or::before, .media-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.media-upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.media-note { font-size: 11.5px; color: var(--muted); margin-top: 12px; }

@media (max-width: 1000px) {
  body.editing #page { margin: 0; }
  .ed-panel { width: 300px; }
}
@media (max-width: 860px) {
  .ed-panel { top: auto; height: 46vh; width: 100%; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; }
  body.editing { padding-bottom: 46vh; }
  .ed-bar__right .hide-sm { display: none; }
}

/* --- added layout helpers ------------------------------------------------ */
body.editing { padding-right: 328px; }
body.editing #page [data-hidden="true"] { display: block !important; opacity: .3; pointer-events: none; }
[data-hidden="true"] { display: none !important; }
@media (max-width: 760px) { [data-hide-mobile="true"] { display: none !important; } }
.rot90 { transform: rotate(90deg); }
.ed-bar__right button[disabled] { opacity: .3; pointer-events: none; }
.ed-bar__right a[data-exit] { padding-inline: 8px; }
@media (max-width: 1000px) { body.editing { padding-right: 300px; } }
@media (max-width: 860px) { body.editing { padding-right: 0; } }
