/* ==========================================================================
   Marine Garage — Boat Sales (listing, detail, embeds)
   Works inside the main site (dark, on top of styles.css) and standalone in
   iframes (dark or light theme).
   ========================================================================== */

.mg {
  --mg-bg: #0a0a0a;
  --mg-surface: #111111;
  --mg-card: #161616;
  --mg-card-hover: #1b1b1b;
  --mg-text: #ffffff;
  --mg-text-2: #b8b8b8;
  --mg-muted: #8c8c8c;
  --mg-border: rgba(255, 255, 255, 0.08);
  --mg-border-strong: rgba(255, 255, 255, 0.18);
  --mg-input: #0e0e0e;
  --mg-accent: var(--accent, #e63946);
  --mg-accent-dark: #c1121f;
  --mg-accent-soft: rgba(230, 57, 70, 0.14);
  --mg-green: #22c55e;
  --mg-amber: #f5a524;
  --mg-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --mg-radius: 16px;
  --mg-head: 'Oswald', 'Arial Narrow', sans-serif;
  --mg-body: 'Inter', system-ui, -apple-system, sans-serif;
}

.mg-theme-light {
  --mg-bg: #ffffff;
  --mg-surface: #f5f6f7;
  --mg-card: #ffffff;
  --mg-card-hover: #ffffff;
  --mg-text: #0d0f12;
  --mg-text-2: #3f4650;
  --mg-muted: #666d77;
  --mg-border: rgba(15, 23, 42, 0.1);
  --mg-border-strong: rgba(15, 23, 42, 0.22);
  --mg-input: #ffffff;
  --mg-accent-soft: rgba(230, 57, 70, 0.09);
  --mg-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

/* --- Standalone (iframe) base ------------------------------------------ */
.mg-embed-html, .mg-embed { margin: 0; background: var(--mg-bg); }
.mg-embed { font-family: var(--mg-body); color: var(--mg-text-2); line-height: 1.6; -webkit-font-smoothing: antialiased; }
/* Resets use :where() so they carry zero specificity and never beat component styles. */
:where(.mg-embed) *, :where(.mg-embed) *::before, :where(.mg-embed) *::after { box-sizing: border-box; }
:where(.mg-embed) img { max-width: 100%; display: block; }
:where(.mg-embed) a { color: inherit; text-decoration: none; }
:where(.mg-embed) :where(h1, h2, h3, p, ul, dl, dd, figure) { margin: 0; padding: 0; }
:where(.mg-embed) .container { width: 100%; padding: 0 16px; }
.mg-embed-wrap { padding: 16px 0 24px; }
.mg-embed-wrap > .mg-browser { padding: 0 16px; }

.mg button, .mg input, .mg select, .mg textarea { font-family: inherit; font-size: inherit; }
.mg :focus-visible { outline: 2px solid var(--mg-accent); outline-offset: 2px; }
.mg .accent { color: var(--mg-accent); }
.mg-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- Buttons ------------------------------------------------------------ */
.mg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 0.92rem; letter-spacing: 0.2px; cursor: pointer; white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.mg-btn:active { transform: translateY(1px); }
.mg-btn-primary { background: var(--mg-accent); color: #fff; }
.mg-btn-primary:hover { background: var(--mg-accent-dark); box-shadow: 0 10px 28px rgba(230, 57, 70, 0.35); color: #fff; }
.mg-btn-ghost { background: transparent; color: var(--mg-text); border-color: var(--mg-border-strong); }
.mg-btn-ghost:hover { border-color: var(--mg-accent); color: var(--mg-accent); }
.mg-btn-block { width: 100%; }
.mg-btn-icon { width: 48px; padding: 0; }
.mg-btn[disabled] { opacity: 0.6; cursor: progress; }
.mg-link { display: inline-flex; align-items: center; gap: 6px; color: var(--mg-accent); font-weight: 600; }
.mg-link:hover { gap: 10px; }

/* --- Hero ---------------------------------------------------------------- */
.mg-hero { position: relative; padding: 150px 0 56px; overflow: hidden; background: var(--mg-surface); border-bottom: 1px solid var(--mg-border); }
.mg-hero--small { padding-bottom: 90px; min-height: 60vh; }
.mg-hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center 60%; opacity: 0.28;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%); mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
}
.mg-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,10,0.2), rgba(10,10,10,0.85)); pointer-events: none; }
.mg-hero .container { position: relative; z-index: 1; }
.mg-hero h1 {
  font-family: var(--mg-head); font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; line-height: 1.05; color: var(--mg-text); margin: 0 0 16px;
}
.mg-hero-lead { font-size: 1.1rem; max-width: 620px; color: var(--mg-text-2); margin-bottom: 32px; }
.mg-hero-lead a { color: var(--mg-accent); }
.mg-hero-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.mg-hero-stats > div {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--mg-border); color: var(--mg-text); font-size: 0.92rem; font-weight: 500;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.mg-hero-stats svg { color: var(--mg-accent); }
.mg-hero-stats strong { font-family: var(--mg-head); font-size: 1.7rem; line-height: 1; color: var(--mg-accent); }

.mg-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--mg-muted); margin-bottom: 22px; }
.mg-crumbs a:hover { color: var(--mg-accent); }
.mg-crumbs [aria-current] { color: var(--mg-text-2); }

.mg-section { padding: 40px 0 80px; }

/* --- Toolbar & filters -------------------------------------------------- */
.mg-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.mg-search { flex: 1 1 280px; position: relative; display: flex; align-items: center; }
.mg-search svg { position: absolute; left: 16px; color: var(--mg-muted); pointer-events: none; }
.mg-toolbar input, .mg-toolbar select, .mg-form input, .mg-form select, .mg-form textarea {
  width: 100%; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--mg-border-strong);
  background-color: var(--mg-input); color: var(--mg-text); font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.mg-toolbar input::placeholder, .mg-form input::placeholder, .mg-form textarea::placeholder { color: var(--mg-muted); }
.mg-toolbar input:focus, .mg-toolbar select:focus, .mg-form input:focus, .mg-form textarea:focus {
  outline: none; border-color: var(--mg-accent); box-shadow: 0 0 0 3px var(--mg-accent-soft);
}
.mg-search input { padding-left: 46px; }
.mg-toolbar select {
  width: auto; flex: 0 1 auto; padding-right: 40px; cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.mg-saved-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--mg-border-strong); background: var(--mg-input); color: var(--mg-text); font-weight: 500;
}
.mg-saved-toggle span { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--mg-border); font-size: 0.8rem; }
.mg-saved-toggle[aria-pressed="true"] { border-color: var(--mg-accent); color: var(--mg-accent); background: var(--mg-accent-soft); }
.mg-saved-toggle[aria-pressed="true"] svg { fill: currentColor; }

.mg-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 8px; scrollbar-width: none; }
.mg-chips::-webkit-scrollbar { display: none; }
.mg-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--mg-border-strong); background: transparent; color: var(--mg-text-2); font-weight: 500; font-size: 0.88rem;
  transition: all 0.2s;
}
.mg-chip span { font-size: 0.75rem; color: var(--mg-muted); }
.mg-chip:hover { border-color: var(--mg-text-2); color: var(--mg-text); }
.mg-chip.is-active { background: var(--mg-text); border-color: var(--mg-text); color: var(--mg-bg); }
.mg-chip.is-active span { color: inherit; opacity: 0.6; }
.mg-results { font-size: 0.9rem; color: var(--mg-muted); margin: 4px 0 18px; }
.mg-results strong { color: var(--mg-text); }

/* --- Grid & cards ------------------------------------------------------- */
.mg-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .mg-cols-2, .mg-cols-3, .mg-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .mg-cols-3, .mg-cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1140px) { .mg-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.mg-card {
  position: relative; background: var(--mg-card); border: 1px solid var(--mg-border); border-radius: var(--mg-radius); overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.35s, border-color 0.35s;
  animation: mgFadeUp 0.5s both;
}
.mg-card:hover { transform: translateY(-4px); box-shadow: var(--mg-shadow); border-color: var(--mg-border-strong); }
.mg-card[hidden] { display: none; }
.mg-card-link { display: block; color: inherit; height: 100%; }
.mg-card-media { position: relative; aspect-ratio: 4 / 3; background: var(--mg-surface); overflow: hidden; }
.mg-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.45s, transform 0.8s cubic-bezier(0.2, 0.7, 0.3, 1); }
.mg-card-alt { opacity: 0; }
@media (hover: hover) {
  .mg-card:hover .mg-card-media img { transform: scale(1.04); }
  .mg-card:hover .mg-card-alt { opacity: 1; }
}
.mg-card.is-sold .mg-card-media img { filter: grayscale(0.7); opacity: 0.7; }
.mg-noimg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--mg-muted); }

.mg-badges { position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; max-width: calc(100% - 70px); }
.mg-card .mg-badge:nth-child(n + 3) { display: none; }
.mg-badge {
  padding: 5px 9px; border-radius: 7px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
  background: #fff; color: #0a0a0a; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.mg-badge--sold { background: #0a0a0a; color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); }
.mg-badge--offer { background: var(--mg-amber); color: #1a1200; }
.mg-badge--drop { background: var(--mg-green); color: #04220f; }
.mg-badge--featured { background: var(--mg-accent); color: #fff; }

.mg-photo-count {
  position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.75rem; font-weight: 600; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.mg-save {
  position: absolute; top: 10px; right: 10px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform 0.2s, background 0.2s;
}
.mg-save:hover { transform: scale(1.08); background: rgba(0, 0, 0, 0.7); }
.mg-save[aria-pressed="true"] { color: var(--mg-accent); background: #fff; }
.mg-save[aria-pressed="true"] svg, .mg-btn-icon[aria-pressed="true"] svg { fill: currentColor; }
.mg-btn-icon[aria-pressed="true"] { color: var(--mg-accent); border-color: var(--mg-accent); }
.mg-save.is-pop svg, .mg-btn-icon.is-pop svg { animation: mgPop 0.4s; }

.mg-card-body { padding: 16px 18px 18px; }
.mg-card-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 4px; min-height: 34px; line-height: 34px; }
.mg-price { font-size: 1.4rem; font-weight: 700; color: var(--mg-text); letter-spacing: -0.3px; line-height: 1.2; }
.mg-price small { font-size: 0.72rem; font-weight: 600; color: var(--mg-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.mg-was { font-size: 0.9rem; color: var(--mg-muted); }
.mg-card-title {
  font-size: 1rem; font-weight: 600; color: var(--mg-text); line-height: 1.35; margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--mg-body); text-transform: none; letter-spacing: 0;
}
.mg-card-meta { font-size: 0.85rem; color: var(--mg-muted); margin: 0 0 12px; }
.mg-card-specs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.mg-card-specs li {
  padding: 4px 10px; border-radius: 8px; background: var(--mg-surface); border: 1px solid var(--mg-border);
  font-size: 0.78rem; font-weight: 500; color: var(--mg-text-2); line-height: 1.4;
}
.mg-card-specs li::before { content: none; }

.mg-empty { text-align: center; padding: 60px 20px; color: var(--mg-muted); border: 1px dashed var(--mg-border-strong); border-radius: var(--mg-radius); }
.mg-empty svg { margin: 0 auto 12px; color: var(--mg-accent); }
.mg-empty h3 { color: var(--mg-text); font-size: 1.25rem; margin-bottom: 6px; font-family: var(--mg-body); text-transform: none; letter-spacing: 0; }
.mg-empty p { max-width: 440px; margin: 0 auto 18px; }
.mg-empty[hidden] { display: none; }
.mg-more { text-align: center; margin-top: 28px; }

/* --- Sell your boat ------------------------------------------------------ */
.mg-sell { padding: 90px 0; background: var(--mg-surface); border-top: 1px solid var(--mg-border); scroll-margin-top: 80px; }
.mg-sell-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px; align-items: center; }
.mg-sell h2 { font-family: var(--mg-head); font-size: clamp(2rem, 4vw, 3rem); text-transform: uppercase; letter-spacing: 1.5px; color: var(--mg-text); line-height: 1.1; margin-bottom: 18px; }
.mg-sell p { font-size: 1.05rem; margin-bottom: 24px; max-width: 520px; }
.mg-ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.mg-ticks li { display: flex; align-items: center; gap: 12px; color: var(--mg-text); }
.mg-ticks li::before { content: none; }
.mg-ticks svg { flex: 0 0 auto; width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--mg-accent-soft); color: var(--mg-accent); }

/* --- Forms --------------------------------------------------------------- */
.mg-card-panel, .mg-summary, .mg-enquire { background: var(--mg-card); border: 1px solid var(--mg-border); border-radius: 20px; padding: 26px; }
.mg-form { display: grid; gap: 14px; position: relative; }
.mg-form h3, .mg-form-title { font-family: var(--mg-head); font-size: 1.35rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--mg-text); margin: 0 0 2px; }
.mg-form label { display: grid; gap: 6px; }
.mg-form label > span { font-size: 0.8rem; font-weight: 600; color: var(--mg-text-2); }
.mg-form textarea { padding: 12px 16px; min-height: 96px; resize: vertical; line-height: 1.5; }
.mg-form .is-invalid { border-color: #ff6b6b !important; box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15) !important; }
.mg-field-error { font-size: 0.78rem; color: #ff8a8a; }
.mg-theme-light .mg-field-error { color: #c62828; }
.mg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mg-form-note { font-size: 0.82rem; color: var(--mg-muted); text-align: center; margin: 0; }
.mg-form-note a { color: var(--mg-text); font-weight: 600; }
.mg-form-status:empty { display: none; }
.mg-form-status.is-error { padding: 12px 14px; border-radius: 12px; background: rgba(255, 107, 107, 0.1); color: #ff8a8a; font-size: 0.9rem; }
.mg-theme-light .mg-form-status.is-error { color: #c62828; }

.mg-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-quick-chip {
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--mg-border-strong); background: transparent; color: var(--mg-text-2);
  font-size: 0.8rem; cursor: pointer; transition: all 0.2s;
}
.mg-quick-chip:hover, .mg-quick-chip.is-active { border-color: var(--mg-accent); color: var(--mg-accent); background: var(--mg-accent-soft); }
.mg-toggles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mg-toggles-label { flex-basis: 100%; font-size: 0.8rem; font-weight: 600; color: var(--mg-text-2); }
.mg-toggle { display: inline-flex !important; position: relative; cursor: pointer; }
.mg-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mg-toggle span {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 10px; border: 1px solid var(--mg-border-strong);
  font-size: 0.8rem !important; font-weight: 500 !important; color: var(--mg-text-2); transition: all 0.2s;
}
.mg-toggle span::before { content: ''; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--mg-muted); transition: all 0.2s; }
.mg-toggle input:checked + span { border-color: var(--mg-accent); color: var(--mg-text); background: var(--mg-accent-soft); }
.mg-toggle input:checked + span::before {
  background: var(--mg-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat;
  border-color: var(--mg-accent);
}
.mg-toggle input:focus-visible + span { outline: 2px solid var(--mg-accent); outline-offset: 2px; }

.mg-success { text-align: center; padding: 18px 6px; animation: mgFadeUp 0.5s both; }
.mg-success-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: rgba(34, 197, 94, 0.14); color: var(--mg-green); }
.mg-success-icon svg { width: 30px; height: 30px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: mgDraw 0.6s 0.2s forwards; }
.mg-success h3 { font-family: var(--mg-head); text-transform: uppercase; letter-spacing: 1px; font-size: 1.5rem; color: var(--mg-text); margin-bottom: 8px; }
.mg-success p { color: var(--mg-text-2); margin-bottom: 16px; }

/* --- Detail page -------------------------------------------------------- */
.mg-detail { padding: 118px 0 40px; }
.mg-detail.mg-detail--embed { padding-top: 8px; }
.mg-preview-bar { position: fixed; top: 74px; left: 0; right: 0; z-index: 999; padding: 9px 16px; text-align: center; background: var(--mg-amber); color: #1a1200; font-size: 0.9rem; }
.mg-preview-bar a { text-decoration: underline; font-weight: 700; }
.mg-admin-bar { background: #1d4ed8; color: #fff; }
.mg-preview .mg-detail { padding-top: 150px; }
.mg-embed-back { padding: 14px 16px 6px; }
.mg-embed-back a { display: inline-flex; align-items: center; gap: 8px; color: var(--mg-text-2); font-weight: 600; font-size: 0.9rem; }
.mg-embed-back a:hover { color: var(--mg-accent); }

.mg-detail-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px 40px; align-items: start;
  grid-template-areas: "gallery side" "content side";
}
.mg-gallery-area { grid-area: gallery; min-width: 0; }
.mg-content { grid-area: content; min-width: 0; }
.mg-side { grid-area: side; display: grid; gap: 16px; }
@media (min-width: 961px) and (min-height: 860px) { .mg-site .mg-side { position: sticky; top: 96px; } }

.mg-gallery--empty { aspect-ratio: 3 / 2; border-radius: 20px; background: var(--mg-surface); border: 1px solid var(--mg-border); position: relative; }
.mg-stage { position: relative; border-radius: 20px; overflow: hidden; background: #050505; aspect-ratio: 3 / 2; }
.mg-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; }
.mg-track::-webkit-scrollbar { display: none; }
.mg-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; border: 0; padding: 0; margin: 0; background: #050505; cursor: zoom-in; overflow: hidden; }
.mg-slide::before { content: ''; position: absolute; inset: -40px; background: var(--bg) center / cover; filter: blur(28px) brightness(0.55); }
.mg-slide img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.mg-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; z-index: 2;
  display: grid; place-items: center; background: rgba(10, 10, 10, 0.55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.25s, background 0.2s;
}
.mg-prev { left: 14px; }
.mg-next { right: 14px; }
.mg-stage:hover .mg-nav, .mg-nav:focus-visible { opacity: 1; }
.mg-nav:hover { background: var(--mg-accent); }
.mg-nav[disabled] { opacity: 0 !important; pointer-events: none; }
.mg-counter, .mg-expand {
  position: absolute; bottom: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px;
  background: rgba(10, 10, 10, 0.6); color: #fff; font-size: 0.82rem; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 0;
}
.mg-counter { left: 14px; }
.mg-expand { right: 14px; cursor: pointer; padding: 9px; }
.mg-expand:hover { background: var(--mg-accent); }
.mg-stage .mg-badges { top: 16px; left: 16px; }
.mg-stage .mg-badge { font-size: 0.75rem; padding: 7px 11px; }

.mg-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.mg-thumb { flex: 0 0 auto; width: 92px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; opacity: 0.55; background: var(--mg-surface); transition: opacity 0.2s, border-color 0.2s; }
.mg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mg-thumb:hover { opacity: 0.9; }
.mg-thumb.is-active { opacity: 1; border-color: var(--mg-accent); }

.mg-summary-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.mg-status { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mg-text); }
.mg-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--mg-green); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); }
.mg-status--under_offer::before { background: var(--mg-amber); box-shadow: 0 0 0 4px rgba(245, 165, 36, 0.18); }
.mg-status--sold::before { background: var(--mg-accent); box-shadow: 0 0 0 4px var(--mg-accent-soft); }
.mg-status--draft::before { background: var(--mg-muted); box-shadow: none; }
.mg-listed { font-size: 0.8rem; color: var(--mg-muted); }
.mg-title { font-family: var(--mg-head); font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; line-height: 1.15; color: var(--mg-text); margin: 0 0 8px; }
.mg-headline { color: var(--mg-text-2); margin: 0 0 16px; font-size: 0.98rem; }
.mg-summary-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.mg-price--lg { font-size: 2.3rem; letter-spacing: -0.8px; }
.mg-summary-price .mg-was { font-size: 1.05rem; }
.mg-location { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--mg-muted); margin: 0 0 18px; }
.mg-status-note { font-size: 0.88rem; padding: 12px 14px; border-radius: 12px; background: rgba(245, 165, 36, 0.1); border: 1px solid rgba(245, 165, 36, 0.25); color: var(--mg-text); margin: 0 0 18px; }
.mg-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }

.mg-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.mg-fact { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--mg-card); border: 1px solid var(--mg-border); }
.mg-fact svg { grid-row: span 2; color: var(--mg-accent); }
.mg-fact span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mg-muted); line-height: 1.2; }
.mg-fact strong { color: var(--mg-text); font-weight: 600; font-size: 0.98rem; line-height: 1.3; }

.mg-block { margin-top: 44px; scroll-margin-top: 100px; }
.mg-block h2 { position: relative; font-family: var(--mg-head); font-size: 1.4rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; color: var(--mg-text); margin: 0 0 18px; padding-left: 16px; }
.mg-block h2::before { content: ''; position: absolute; left: 0; top: 0.2em; bottom: 0.2em; width: 4px; border-radius: 4px; background: var(--mg-accent); }
.mg-description p { margin: 0 0 1em; font-size: 1.02rem; line-height: 1.8; color: var(--mg-text-2); }
.mg-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.mg-features li { display: flex; align-items: flex-start; gap: 10px; color: var(--mg-text); padding: 0; }
.mg-features li::before { content: none; }
.mg-features svg { flex: 0 0 auto; margin-top: 4px; color: var(--mg-accent); }
.mg-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; margin: 0; }
.mg-specs div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--mg-border); }
.mg-specs dt { color: var(--mg-muted); font-size: 0.92rem; }
.mg-specs dd { margin: 0; color: var(--mg-text); font-weight: 500; text-align: right; font-size: 0.95rem; }

.mg-video { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 18px; background: #000 center / cover; cursor: pointer; overflow: hidden; }
.mg-video::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); transition: background 0.2s; }
.mg-video:hover::before { background: rgba(0, 0, 0, 0.1); }
.mg-video span { position: relative; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; background: var(--mg-accent); color: #fff; box-shadow: 0 10px 40px rgba(230, 57, 70, 0.5); }
.mg-video span svg { fill: currentColor; margin-left: 4px; }
.mg-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.mg-fineprint { font-size: 0.78rem; color: var(--mg-muted); line-height: 1.55; margin: 16px 0 0; }

.mg-why-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mg-why-grid > div { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; padding: 18px; border-radius: 16px; background: var(--mg-card); border: 1px solid var(--mg-border); }
.mg-why-grid svg { grid-row: span 2; color: var(--mg-accent); width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: var(--mg-accent-soft); }
.mg-why-grid h3 { font-size: 0.95rem; font-weight: 600; color: var(--mg-text); margin: 0 0 4px; font-family: var(--mg-body); text-transform: none; letter-spacing: 0; }
.mg-why-grid p { font-size: 0.85rem; color: var(--mg-muted); margin: 0; line-height: 1.5; }

.mg-similar { border-top: 1px solid var(--mg-border); margin-top: 40px; padding-top: 60px; }
.mg-section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.mg-section-head h2 { font-family: var(--mg-head); font-size: clamp(1.5rem, 3vw, 2rem); text-transform: uppercase; letter-spacing: 1.5px; color: var(--mg-text); margin: 0; }

.mg-actionbar { display: none; }

/* --- Lightbox ------------------------------------------------------------ */
.mg-lightbox {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 5, 5, 0.96); animation: mgFade 0.25s both; touch-action: pan-y;
}
.mg-lightbox[hidden] { display: none; }
.mg-lightbox.is-positioned { position: absolute; bottom: auto; top: var(--lb-top, 0); height: var(--lb-height, 100vh); }
.mg-lightbox figure { margin: 0; max-width: 92vw; display: grid; gap: 10px; justify-items: center; }
.mg-lightbox img { max-width: 92vw; max-height: calc(var(--lb-height, 100vh) * 0.84); object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none; }
.mg-lightbox figcaption { color: #ccc; font-size: 0.9rem; }
.mg-lightbox figcaption:empty { display: none; }
.mg-lb-close, .mg-lb-nav { position: absolute; border: 0; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; border-radius: 50%; display: grid; place-items: center; transition: background 0.2s; }
.mg-lb-close:hover, .mg-lb-nav:hover { background: var(--mg-accent); }
.mg-lb-close { top: 18px; right: 18px; width: 50px; height: 50px; }
.mg-lb-nav { top: 50%; transform: translateY(-50%); width: 58px; height: 58px; }
.mg-lb-prev { left: 20px; }
.mg-lb-next { right: 20px; }
.mg-lb-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 600; font-size: 0.9rem; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); }

/* --- Toast & share menu ------------------------------------------------- */
.mg-toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); z-index: 10001; opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 12px; background: var(--mg-text); color: var(--mg-bg); font-weight: 600; font-size: 0.9rem; box-shadow: var(--mg-shadow);
  transition: opacity 0.25s, transform 0.25s;
}
.mg-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.mg-share-menu {
  position: absolute; z-index: 50; min-width: 200px; padding: 6px; border-radius: 14px; background: var(--mg-card); border: 1px solid var(--mg-border-strong); box-shadow: var(--mg-shadow);
  display: grid; animation: mgFadeUp 0.2s both;
}
.mg-share-menu a, .mg-share-menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; border: 0; background: none; color: var(--mg-text); font-size: 0.9rem; cursor: pointer; text-align: left; }
.mg-share-menu a:hover, .mg-share-menu button:hover { background: var(--mg-accent-soft); color: var(--mg-accent); }
.mg-actions { position: relative; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1100px) {
  .mg-detail-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 20px 28px; }
}

@media (max-width: 960px) {
  .mg-detail { padding-top: 96px; }
  .mg-detail-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "summary" "content" "enquire"; }
  .mg-side { display: contents; }
  .mg-summary { grid-area: summary; }
  .mg-enquire { grid-area: enquire; margin-top: 24px; scroll-margin-top: 90px; }
  .mg-sell-grid { grid-template-columns: 1fr; gap: 36px; }
  .mg-site.mg-has-actionbar { padding-bottom: 76px; }
  .mg-site .mg-actionbar {
    display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(10, 10, 10, 0.92); border-top: 1px solid var(--mg-border);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transform: translateY(0); transition: transform 0.3s;
  }
  .mg-site .mg-actionbar.is-hidden { transform: translateY(110%); }
  .mg-nav { opacity: 1; width: 40px; height: 40px; }
}

@media (max-width: 640px) {
  .mg-hero { padding: 120px 0 36px; }
  .mg-hero-stats > div { flex: 1 1 calc(50% - 12px); padding: 10px 12px; font-size: 0.82rem; }
  .mg-hero-stats strong { font-size: 1.4rem; }
  .mg-toolbar select { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .mg-search { flex-basis: 100%; }
  .mg-saved-toggle { flex: 1 1 calc(50% - 5px); justify-content: center; }
  .mg-stage { border-radius: 0; aspect-ratio: 4 / 3.2; margin: 0 -24px; }
  .mg-embed .mg-stage { margin: 0 -16px; }
  .mg-thumbs { display: none; }
  .mg-nav { display: none; }
  .mg-summary, .mg-enquire, .mg-card-panel { padding: 20px; border-radius: 18px; }
  .mg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mg-features, .mg-specs { grid-template-columns: 1fr; }
  .mg-why-grid { grid-template-columns: 1fr; }
  .mg-row { grid-template-columns: 1fr; }
  .mg-price--lg { font-size: 2rem; }
  .mg-lb-nav { display: none; }
  .mg-sell { padding: 60px 0; }
}

@keyframes mgFadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes mgFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mgPop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes mgDraw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .mg *, .mg *::before, .mg *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .mg-actionbar, .mg-enquire, .mg-similar, .mg-save, .mg-nav, .mg-thumbs { display: none !important; }
}
