/* =============================================================
   Euro Motor Market — v1 design system
   Dark, modern, mobile-first. No frameworks.
   ============================================================= */

:root {
    --bg:          #1a1a2e;
    --bg-2:        #22223b;
    --bg-3:        #2a2a44;
    --surface:     #1f1f36;
    --accent:      #c62828;
    --accent-hover:#b71c1c;
    --highlight:   #ffd700;
    --text:        #f5f5f5;
    --text-muted:  #a0a0b0;
    --border:      #2d2d44;
    --success:     #4ade80;
    --error:       #ef4444;
    --radius:      8px;
    --radius-lg:   14px;
    --shadow-md:   0 4px 12px rgba(0,0,0,.35);
    --shadow-lg:   0 12px 32px rgba(0,0,0,.45);
    --container:   1200px;
    --topbar-h:    40px;
    --mainbar-h:   72px;
    --transition:  180ms ease;
    --font-sans:   system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    min-width: 370px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1 0 auto; }

.skip-link {
    position: absolute;
    left: 1rem;
    top: 1rem;
    transform: translateY(-160%);
    z-index: 1000;
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--highlight);
    border-radius: var(--radius);
    padding: .65rem .9rem;
    font-weight: 700;
}
.skip-link:focus-visible { transform: translateY(0); }

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--text); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { color: var(--highlight); }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

ul { margin: 0 0 1em; padding-left: 1.2em; }

.highlight { color: var(--highlight); }

/* --- layout helpers --- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1rem;
}
.container.narrow { max-width: 760px; }

.section          { padding: 4rem 0; }
.section--alt     { background: var(--bg-2); }
.section--cta     { background: linear-gradient(135deg, var(--bg-2), #2c1414); }
.section__title   { text-align: center; margin-bottom: 2rem; }
.section__cta     { text-align: center; margin-top: 2rem; }

/* --- buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
    font-size: 1rem;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    background: transparent;
    color: var(--text);
}
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover, .btn--primary:focus-visible { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn--ghost   { border-color: var(--border); color: var(--text); }
.btn--ghost:hover, .btn--ghost:focus-visible { border-color: var(--highlight); color: var(--highlight); }
.btn--lg      { padding: 1rem 2rem; font-size: 1.05rem; }

/* --- header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.topbar {
    background: #14142a;
    color: var(--text-muted);
    font-size: .875rem;
    border-bottom: 1px solid var(--border);
}
.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--topbar-h);
    flex-wrap: wrap;
    gap: .5rem;
    padding-top: .25rem;
    padding-bottom: .25rem;
}
.topbar__contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
}
.topbar__link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--text-muted);
    transition: color var(--transition);
}
.topbar__link:hover, .topbar__link:focus-visible { color: var(--highlight); }
.topbar__link .icon { color: var(--accent); }
.topbar__locales { display: flex; gap: .25rem; }
.topbar__locale {
    padding: .15rem .5rem;
    border-radius: 4px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: .8rem;
}
.topbar__locale.is-active { background: var(--accent); color: #fff; }

.mainbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    min-height: var(--mainbar-h);
    gap: 1rem;
}
.logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: .03em;
    color: var(--text);
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
}
.logo__primary   { color: var(--accent); }
.logo__secondary { font-weight: 400; color: var(--text-muted); }

.primary-nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1rem;
}
.logo__primary, .logo__secondary, .primary-nav__link, .nav-dropdown__toggle, .primary-nav__cta { white-space: nowrap; }
.primary-nav__link {
    padding: .5rem .25rem;
    font-weight: 500;
    background: none;
    border: 0;
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}
.primary-nav__link:hover, .primary-nav__link:focus-visible { color: var(--highlight); }
.primary-nav__cta { padding: .55rem 1.1rem; }

.nav-dropdown { position: relative; }
.nav-dropdown__panel {
    position: absolute;
    top: calc(100% + .25rem);
    left: 0;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 250px;
    padding: .5rem;
    display: none;
    box-shadow: var(--shadow-lg);
}
.nav-dropdown__panel a {
    display: block;
    padding: .6rem .8rem;
    border-radius: var(--radius);
    color: var(--text);
}
.nav-dropdown__panel a:hover, .nav-dropdown__panel a:focus-visible { background: var(--bg-3); color: var(--highlight); }
.nav-dropdown.is-open .nav-dropdown__panel { display: block; }

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    width: 44px;
    height: 44px;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    justify-content: space-between;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    transition: transform var(--transition), opacity var(--transition);
}

@media (max-width: 880px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--bg-2);
        padding: 1rem;
        gap: .25rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition);
        border-bottom: 1px solid var(--border);
    }
    .primary-nav.is-open { max-height: 80vh; overflow-y: auto; }
    .nav-dropdown__panel { position: static; box-shadow: none; min-width: 0; background: var(--bg-3); }
}

/* --- hero --- */
.hero {
    padding: 5rem 0 4rem;
    background: linear-gradient(135deg, var(--bg) 0%, #2a1010 100%);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(198,40,40,.18), transparent 60%);
    pointer-events: none;
}
.hero__inner   { position: relative; }
.hero__copy    { max-width: 720px; }
.hero h1       { margin-bottom: .5em; }
.hero__subtitle{ font-size: 1.15rem; color: var(--text-muted); margin-bottom: 2rem; }
.hero__cta     { display: flex; flex-wrap: wrap; gap: 1rem; }

/* --- card grid --- */
.card-grid {
    display: grid;
    gap: 1.5rem;
}
.card-grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }

.card--category { padding: 1.5rem; }
.card--category h3 { color: var(--text); }
.card--category p  { color: var(--text-muted); }
.card--category .card__cta { color: var(--accent); font-weight: 600; }

.card__media {
    background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.card__badge {
    position: absolute;
    top: .75rem; left: .75rem;
    background: var(--accent);
    color: #fff;
    padding: .25rem .65rem;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 600;
}
.card__body  { padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card__title { margin: 0; }
.card__meta  { color: var(--text-muted); font-size: .9rem; margin: 0; }
.card__specs { list-style: none; padding: 0; margin: .5rem 0; font-size: .9rem; }
.card__specs li { color: var(--text-muted); padding: .15rem 0; }
.card__specs strong { color: var(--text); }
.card__price {
    margin: .5rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--highlight);
}

/* --- trust block --- */
.trust { text-align: center; padding: 1.5rem; }
.trust__icon { font-size: 2.5rem; margin-bottom: .75rem; }
.trust h3 { color: var(--text); }
.trust p  { color: var(--text-muted); }

/* --- cta block --- */
.cta-block {
    text-align: center;
    padding: 3rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(198,40,40,.07);
}

/* --- page header --- */
.page-header {
    background: var(--bg-2);
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border);
}
.page-header__lead { color: var(--text-muted); margin-bottom: 0; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: .75rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--highlight); }

/* --- catalog --- */
.catalog__layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 880px) {
    .catalog__layout { grid-template-columns: 1fr; }
}
.catalog__filters {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: sticky;
    top: calc(var(--topbar-h) + var(--mainbar-h) + 1rem);
}
.catalog__filters-title { margin-bottom: 1rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; }
.filter-group { margin-bottom: 1.25rem; }
.filter-group h3 { font-size: .9rem; margin-bottom: .5rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.filter-option { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; cursor: pointer; }
.filter-option input { accent-color: var(--accent); }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

/* --- product detail --- */
.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}
@media (max-width: 880px) {
    .product-detail { grid-template-columns: 1fr; }
}
.product-detail__main-img {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 2rem; font-weight: 700; letter-spacing: .1em;
}
.product-detail__price {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.product-detail__price .label { display: block; color: var(--text-muted); font-size: .85rem; }
.product-detail__price .value { font-size: 1.6rem; color: var(--highlight); font-weight: 700; }
.product-specs {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
}
.product-specs th, .product-specs td {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.product-specs th { color: var(--text-muted); font-weight: 500; width: 40%; }

/* --- forms --- */
.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 2rem;
    align-items: start;
}
@media (max-width: 880px) { .contact-layout { grid-template-columns: 1fr; } }

.contact-info ul { list-style: none; padding: 0; }
.contact-list li { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; }
.contact-list__icon { color: var(--accent); }

.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.field { display: flex; flex-direction: column; gap: .35rem; }
.field span { color: var(--text); font-size: .9rem; font-weight: 500; }
.field span em { color: var(--accent); font-style: normal; }
.field input, .field textarea, .field select {
    background: var(--bg-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .65rem .85rem;
    font: inherit;
    transition: border-color var(--transition), background var(--transition);
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-3);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"], .field select[aria-invalid="true"] {
    border-color: var(--error);
    background: rgba(198,40,40,.08);
}
.field--honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-help { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--text-muted); }
.form-help a { color: inherit; text-decoration: underline; }
.grecaptcha-badge { visibility: hidden !important; pointer-events: none !important; }

.form-status { min-height: 1.5em; margin: 0; font-size: .9rem; }
.form-status.is-success { color: var(--success); }
.form-status.is-error   { color: var(--error); }

/* --- service cards --- */
.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex; flex-direction: column; gap: .75rem;
    transition: border-color var(--transition), transform var(--transition);
}
.service-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.service-card a { margin-top: auto; align-self: flex-start; }

/* --- footer --- */
.site-footer {
    background: #11112a;
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    color: var(--text-muted);
    margin-top: auto;
}
.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 2rem;
}
.footer-col__title { color: var(--text); margin-bottom: .75rem; font-size: 1rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { padding: .25rem 0; }
.footer-col a { color: var(--text-muted); }
.footer-col a:hover { color: var(--highlight); }
.social { display: flex; gap: .5rem; margin-top: .75rem; }
.social a {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
}
.social a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    text-align: center;
    font-size: .85rem;
}

/* --- error page --- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
}
.error-page__code {
    font-size: clamp(5rem, 18vw, 10rem);
    font-weight: 800;
    color: var(--accent);
    margin: 0;
    line-height: 1;
}

/* --- legal pages --- */
.legal h2 { margin-top: 2rem; color: var(--highlight); }
.legal p, .legal ul { color: var(--text-muted); }
.legal strong { color: var(--text); }

/* --- focus visibility --- */
:focus-visible {
    outline: 2px solid var(--highlight);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- prefers reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
