:root {
    --bg: #f0f2f5;
    --card: #fff;
    --text: #1a1d23;
    --muted: #5c6470;
    --accent: #1e5a8a;
    --accent-hover: #16456a;
    --border: #d8dde6;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pub-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.pub-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.pub-header__brand-block {
    flex: 1 1 200px;
    min-width: 0;
}

.pub-header__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
}

.pub-lang__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.pub-lang {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.pub-lang li {
    margin: 0;
}

.pub-lang__current {
    display: inline-block;
    min-width: 2rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent);
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    background: #e8eef5;
}

.pub-lang__link {
    display: inline-block;
    min-width: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.pub-lang__link:hover {
    border-color: var(--border);
    background: #f4f6f9;
    color: var(--accent);
}

.pub-header__brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--accent);
    text-decoration: none;
}

.pub-header__brand:hover {
    color: var(--accent-hover);
}

.pub-header__tagline {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    color: var(--muted);
}

.pub-main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2.5rem;
}

.pub-footer {
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 1rem 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

.pub-footer p {
    margin: 0;
}

h1 {
    font-size: 1.45rem;
    margin: 0 0 0.25rem;
}

.lead {
    color: var(--muted);
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
}

.filters {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    margin-bottom: 1.5rem;
}

.filters__title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin: 0 0 0.75rem;
}

.filters__grid {
    display: grid;
    gap: 0.75rem 1rem;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    align-items: end;
}

.filters label span {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--muted);
}

.filters input[type="search"],
.filters input[type="text"],
.filters select {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

.filters__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.3;
    background: var(--accent);
    color: #fff;
}

.btn:hover {
    background: var(--accent-hover);
}

.btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn--ghost:hover {
    background: #eef0f4;
}

.machine-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.machine-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.machine-card__media {
    aspect-ratio: 4 / 3;
    background: #e8ebf0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.machine-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.machine-card__placeholder {
    color: var(--muted);
    font-size: 0.85rem;
    padding: 1rem;
    text-align: center;
}

.machine-card__body {
    padding: 1rem 1.1rem 1.15rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.machine-card__model {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}

.machine-card__meta {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0.25rem 0 0;
}

.machine-card__price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 0.35rem;
}

.machine-card__cats {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.flash-err {
    background: #fce8e6;
    color: #6b1d15;
    border: 1px solid #f0b4ad;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

/* Liens catalogue → fiche */
.machine-card__media-link {
    display: block;
    text-decoration: none;
    color: inherit;
    outline: none;
}

.machine-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.machine-card__title a {
    color: inherit;
    text-decoration: none;
}

.machine-card__title a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.machine-card__cta {
    margin-top: auto;
    width: 100%;
    text-align: center;
    padding-top: 0.5rem;
}

/* ——— Fiche machine (détail) ——— */
.detail-breadcrumb {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.detail-breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.detail-breadcrumb a:hover {
    text-decoration: underline;
}

.detail-breadcrumb__sep {
    margin: 0 0.35rem;
    opacity: 0.6;
}

.detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.detail-title {
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.65rem;
    line-height: 1.2;
}

.detail-title__model {
    font-weight: 600;
    color: var(--muted);
}

.detail-pills {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.detail-pills__item {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: #e8eef5;
    color: var(--accent-hover);
    border: 1px solid #c5d4e3;
}

.detail-header__price {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.detail-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.detail-price--ask {
    font-size: 1.15rem;
    font-weight: 700;
}

.detail-price--muted {
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
}

.detail-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
}

.detail-layout {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: 1fr;
}

@media (min-width: 960px) {
    .detail-layout {
        grid-template-columns: 1fr minmax(300px, 360px);
        align-items: start;
    }

    .detail-side {
        position: sticky;
        top: 1rem;
    }
}

.detail-visual {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-hero {
    border-radius: var(--radius);
    overflow: hidden;
    background: #dfe3ea;
    border: 1px solid var(--border);
    aspect-ratio: 16 / 10;
    max-height: min(70vh, 560px);
}

.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-hero--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    color: var(--muted);
    font-size: 0.95rem;
}

.detail-hero--empty p {
    margin: 0;
    padding: 1.5rem;
    text-align: center;
}

.detail-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-thumb {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--card);
    line-height: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.detail-thumb:hover {
    border-color: #a8b8cc;
}

.detail-thumb.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.detail-thumb img {
    width: 88px;
    height: 66px;
    object-fit: cover;
    display: block;
}

@media (min-width: 600px) {
    .detail-thumb img {
        width: 104px;
        height: 78px;
    }
}

.detail-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 0.75rem;
}

.detail-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    margin-bottom: 1rem;
}

.detail-card--desc {
    margin-bottom: 1rem;
}

.detail-specs {
    margin: 0;
}

.detail-specs__row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0.5rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eef0f4;
    font-size: 0.92rem;
}

.detail-specs__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-specs__row:first-child {
    padding-top: 0;
}

.detail-specs dt {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.detail-specs dd {
    margin: 0;
    font-weight: 500;
}

.detail-description {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #2c323c;
}

.detail-attachments {
    margin-top: 0.5rem;
    padding: 1.15rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.detail-attachments__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-doc-btn {
    text-decoration: none;
}

.detail-video-wrap {
    margin-top: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: #1a1d23;
    border: 1px solid var(--border);
}

.detail-video {
    width: 100%;
    max-height: min(50vh, 420px);
    display: block;
}

.detail-back {
    display: inline-block;
    text-decoration: none;
    margin-top: 0.25rem;
}

.pub-main--wide {
    max-width: 1200px;
}
