/* ============================================================
   Duoporta — Shared styles (design tokens, hero, footer, icon system)
   ============================================================ */

:root {
    /* Palette */
    --color-bg-page-light: #eee9f7;
    --color-surface: #ffffff;
    --color-sidebar: #e7defa;

    --color-accent: #2a0f44;
    --color-accent-hover: #c5b3e6;
    --color-purple-deep: #2a0f44;
    --color-purple-mid: #5b2a8a;
    --color-purple-light: #c5b3e6;

    --color-text: #1a1130;
    --color-text-muted: #6b5d80;
    --color-text-on-dark: #ffffff;
    --color-text-on-dark-muted: #b9a6d4;

    --color-border: #d8cfe7;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-card: 0 2px 8px rgba(42, 15, 68, 0.08);
    --shadow-card-hover: 0 6px 20px rgba(42, 15, 68, 0.16);
    --shadow-popup: 0 12px 32px rgba(42, 15, 68, 0.24);

    /* Typography — Century Gothic per facelift spec; Jost (Google Fonts, loaded in the
       layouts) is the web-friendly geometric fallback for devices without it. */
    --font-body: 'Century Gothic', 'CenturyGothic', 'Jost', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Layout */
    --page-max: 1512px;
    --hero-height: 560px;
    --hero-overlap: 200px;
    --compare-bar-height: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg-page-light);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* Contain the full-bleed .search-band (100vw) so it can't cause horizontal scroll.
       clip (not hidden) so it doesn't create a scroll container that breaks sticky/fixed. */
    overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; padding: 0; margin: 0; }

/* ---------- Layout wrapper ---------- */
.page {
    max-width: var(--page-max);
    background: var(--color-bg-page-light);
    min-height: 100dvh;
    padding-bottom: calc(var(--compare-bar-height) + 20px);
    margin: 0 auto;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: var(--hero-height);
    background-image: url('/img/site/hero.png');
    background-size: cover;
    background-position: center 50%;
    background-color: var(--color-purple-deep);
    color: var(--color-text-on-dark);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--hero-overlap);
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Top: 25% overlay so the car photo is visible.
       Bottom: 100% opaque pure --color-purple-deep so it blends seamlessly with the page below. */
    background: linear-gradient(180deg, rgba(20, 5, 40, 0.25) 0%, rgba(42, 15, 68, 0.60) 50%, rgba(42, 15, 68, 1) 100%);
    pointer-events: none;
}

.hero__inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: var(--page-max);
    margin: 0 auto;
    width: 100%;
    padding: calc(28px + env(safe-area-inset-top, 0px)) 56px 0;
    gap: 24px;
}

.hero__prompt {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--color-text-on-dark);
    font-size: 14px;
    font-weight: 500;
    margin: auto 0 4px;
    padding: 0 56px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.hero__logo { display: flex; align-items: center; justify-self: start; }
.hero__logo-mark {
    display: block;
    width: 250px;
    height: auto;
    border-radius: 8px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.hero__title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.25;
}

.hero__actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero__login {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-on-dark);
    font-size: 14px;
    font-weight: 500;
}

.hero__login svg { width: 22px; height: 22px; opacity: 0.9; }

/* ---------- Search bar (overlaps hero bottom) ---------- */
.search-bar {
    max-width: 1024px;
    margin: calc(var(--hero-overlap) * -1) auto 80px;
    position: relative;
    z-index: 3;
    padding: 0 56px;
}

.search-bar__field {
    display: flex;
    background: white;
    border-radius: var(--radius-pill);
    padding: 8px 8px 8px 24px;
    box-shadow: 0 14px 36px rgba(42, 15, 68, 0.28);
    align-items: center;
    gap: 12px;
}

.search-bar__field svg {
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.search-bar__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    padding: 8px 0;
    color: var(--color-text);
    font-family: inherit;
}

.search-bar__input::placeholder { color: var(--color-text-muted); }

.search-bar__submit {
    background: var(--color-accent);
    color: white;
    border-radius: var(--radius-pill);
    padding: 10px 28px;
    font-weight: 600;
    font-size: 13px;
}

.search-bar__submit:hover { background: var(--color-accent-hover); }

/* ---------- Compare bar (sticky bottom) ---------- */
.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-purple-deep);
    color: var(--color-text-on-dark);
    padding: 14px 56px;
    display: flex;
    align-items: center;
    gap: 24px;
    z-index: 50;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

.compare-bar__status { font-size: 13px; color: var(--color-text-on-dark-muted); white-space: nowrap; }
.compare-bar__status strong { color: var(--color-text-on-dark); font-weight: 600; }

.compare-bar__cars { display: flex; gap: 8px; flex: 1; overflow-x: auto; }

.compare-bar__cta {
    background: var(--color-accent);
    color: white;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.compare-bar__cta:hover { background: var(--color-accent-hover); }

.compare-bar__buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.compare-bar__clear {
    color: var(--color-text-on-dark-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.compare-bar__clear:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Compare chip — injected by /search/compare AJAX into #compareBlock.
   The AJAX response carries the new markup; these styles size and theme each chip. */
.compare-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 10px 6px 6px;
    border-radius: var(--radius-md);
    font-size: 12px;
    white-space: nowrap;
    color: var(--color-text-on-dark);
}

.compare-chip__thumb {
    width: 40px;
    height: 26px;
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(120,40,140,0.45), rgba(10,10,10,0.85));
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    overflow: hidden;
}
.compare-chip__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.compare-chip__info { display: flex; flex-direction: column; line-height: 1.2; }
.compare-chip__brand {
    font-size: 9px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-accent);
    font-weight: 700;
}
.compare-chip__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-on-dark);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-chip__remove {
    color: var(--color-text-on-dark-muted);
    font-size: 14px;
    padding: 0 4px;
    background: none;
    border: none;
    cursor: pointer;
}
.compare-chip__remove:hover { color: #fff; }

/* When the shortlist is empty (no chips yet), the compare bar still shows status + buttons,
   but the CTA is dimmed because there's nothing to compare. */
.compare-bar:not(:has(.compare-chip)) .compare-bar__cta {
    opacity: 0.5;
    pointer-events: none;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--color-purple-deep);
    color: var(--color-text-on-dark);
    margin-top: 60px;
    padding-bottom: var(--compare-bar-height);
}

.site-footer__inner {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 40px 56px 28px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.site-footer__col--brand { display: flex; flex-direction: column; gap: 14px; max-width: 380px; }
.site-footer__logo img { display: block; height: 72px; width: auto; border-radius: 6px; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4)); }
.site-footer__tagline { font-size: 13px; color: var(--color-text-on-dark-muted); margin: 0; line-height: 1.55; }
.site-footer__heading { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--color-text-on-dark); margin: 0 0 14px; font-weight: 700; }
.site-footer__nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer__nav a { color: var(--color-text-on-dark-muted); font-weight: 500; font-size: 14px; transition: color 0.15s ease; }
.site-footer__nav a:hover { color: var(--color-accent); }
.site-footer__line { font-size: 13px; color: var(--color-text-on-dark-muted); margin: 0 0 6px; }
.site-footer__line a { color: inherit; transition: color 0.15s ease; }
.site-footer__line a:hover { color: var(--color-accent); }
.site-footer__base {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 16px 56px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: var(--color-text-on-dark-muted);
}

@media (max-width: 800px) {
    .site-footer__inner { grid-template-columns: 1fr; gap: 28px; padding: 28px 24px; }
    .site-footer__base { padding: 16px 24px; }
    .desktop-only{
        display: none;
    }
}

/* ---------- Bootstrap-modal partial (#myModal) — old enquiry form.
   Hidden by default; the existing search.js opens it by adding .in / display:block,
   but until then we keep it out of the page so it doesn't render inline. ---------- */
.modal {
    display: none;
}
.modal.in {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}
.modal.in .modal-dialog {
    background: white;
    max-width: 520px;
    margin: 40px auto;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-popup);
}

/* ============================================================
   Compact hero variant for marketing pages (contact, login, etc.)
   Shrinks the hero — no big tagline overlap; content sits closer.
   Photo removed per facelift feedback — solid brand purple instead.
   ============================================================ */
.hero--compact {
    min-height: 220px;
    padding-bottom: 40px;
    background-image: none;
}
.hero--compact .hero__title {
    font-size: 16px;
}

/* ============================================================
   Header bar variant (search page) — the photo hero is removed
   per facelift feedback; just the slim brand bar remains.
   ============================================================ */
.hero--bar {
    min-height: 0;
    background-image: none;
    /* Just the logo bar — the purple continues seamlessly into .search-band below */
    padding-bottom: 16px;
}
.hero--bar::after {
    display: none;
}
.hero--bar .hero__inner {
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

/* ============================================================
   Marketing-page primitives — used by contact, login, profile.
   .site-page = constrained content area
   .site-card = white rounded card with shadow
   .site-form = form field styles (label + input + textarea + select)
   .site-btn  = primary pink CTA + ghost variant
   ============================================================ */
.site-page {
    max-width: 980px;
    margin: -120px auto 60px;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.site-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    box-shadow: var(--shadow-card);
}
.site-card__title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800;
    color: var(--color-purple-deep);
}
.site-card__subtitle {
    margin: 0 0 24px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.site-card--split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    padding: 0;
    overflow: hidden;
}
.site-card--split > .site-card__main { padding: 32px 36px; }
.site-card--split > .site-card__aside {
    background: var(--color-purple-deep);
    color: white;
    padding: 32px 28px;
}

.site-form__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.site-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.site-form__field input,
.site-form__field select,
.site-form__field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--color-text);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.15s ease;
}
.site-form__field input:focus,
.site-form__field select:focus,
.site-form__field textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(214, 27, 135, 0.12);
}

.site-form__field textarea { resize: vertical; min-height: 96px; }
.site-form__field .req { color: var(--color-accent); }

.site-form__error {
    color: var(--color-accent);
    font-size: 12px;
    margin-top: 4px;
}
.site-form__hint {
    font-size: 11px;
    color: var(--color-text-muted);
}

.site-form__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.site-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}
.site-btn:active { transform: translateY(1px); }

.site-btn--primary {
    background: var(--color-accent);
    color: white;
    border: none;
}
.site-btn--primary:hover { background: var(--color-accent-hover); }

.site-btn--ghost {
    background: transparent;
    color: var(--color-purple-deep);
    border: 1.5px solid var(--color-purple-deep);
}
.site-btn--ghost:hover { background: var(--color-purple-deep); color: white; }

.site-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
}
.site-alert--success {
    background: rgba(91, 42, 138, 0.08);
    color: var(--color-purple-deep);
    border-left: 4px solid var(--color-purple-mid);
}
.site-alert--error {
    background: rgba(214, 27, 135, 0.08);
    color: var(--color-accent);
    border-left: 4px solid var(--color-accent);
}

/* Contact-aside specific */
.site-contact-info { display: flex; flex-direction: column; gap: 14px; }
.site-contact-info__heading {
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0;
}
.site-contact-info__item { display: flex; flex-direction: column; gap: 2px; }
.site-contact-info__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-on-dark-muted);
}
.site-contact-info__value {
    font-size: 15px;
    color: white;
    font-weight: 500;
}
.site-contact-info__value a { color: inherit; }

/* Centered card variant (login) */
.site-page--narrow { max-width: 460px; }

/* Profile content typography */
.site-steps {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}
.site-steps li {
    padding: 10px 14px;
    background: var(--color-bg-page-light);
    border-radius: var(--radius-sm);
    color: var(--color-text);
}
.site-steps strong {
    color: var(--color-accent);
    margin-right: 8px;
    font-weight: 800;
}

.site-section__heading {
    margin: 28px 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-purple-deep);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 6px;
}

.site-card p {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.6;
}

@media (max-width: 700px) {
    .site-card--split { grid-template-columns: 1fr; }
    .site-card { padding: 24px 22px; }
    .site-card__title { font-size: 22px; }
    .site-page { margin-top: -80px; }
}

/* ============================================================
   Icon system — mask-image driven, inherits currentColor.
   ============================================================ */
.ico {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask: var(--ico) no-repeat center / contain;
    mask: var(--ico) no-repeat center / contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.ico-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #e8d3e0;
    vertical-align: middle;
    flex-shrink: 0;
}

.ico-box::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background-color: var(--color-purple-deep);
    -webkit-mask: var(--ico) no-repeat center / contain;
    mask: var(--ico) no-repeat center / contain;
}
.modal-backdrop{
    display: none !important;
}
