/* Page publique d'une boutique (?page=vendeurs&action=<adresse>). Clair par défaut, thème sombre via [data-theme="dark"]. */
.vs-page {
    --vs-navy: #0B1B34;
    --vs-gold: #C9A24B;
    --vs-gold-soft: #E2C275;
    --vs-card: #fff;
    --vs-bg: #f5f6fa;
    --vs-line: #e5e9f0;
    --vs-text: #1b2230;
    --vs-muted: #64748b;
    --vs-price: #7a5e1c;
    --vs-chip: #eef2f7;
    /* Pleine largeur de la fenêtre : seule une marge latérale proportionnelle subsiste. */
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    padding: 18px clamp(16px, 2.5vw, 40px) 64px;
    color: var(--vs-text);
}

[data-theme="dark"] .vs-page {
    --vs-card: #1a2233;
    --vs-bg: #111827;
    --vs-line: #2a344a;
    --vs-text: #e5e9f2;
    --vs-muted: #9aa7bd;
    --vs-price: #E2C275;
    --vs-chip: #243049;
}

.vs-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 14px;
    font-size: 0.86rem;
    color: var(--vs-muted);
}

.vs-crumb a { color: var(--vs-muted); }
.vs-crumb a:hover { color: var(--vs-gold); }
.vs-crumb [aria-current] { color: var(--vs-text); font-weight: 600; }

/* --- En-tête ------------------------------------------------------------------------------------------ */
.vs-hero {
    overflow: hidden;
    border: 1px solid var(--vs-line);
    border-radius: 20px;
    background: var(--vs-card);
    box-shadow: 0 10px 30px rgba(11, 27, 52, 0.07);
}

.vs-cover { position: relative; height: 260px; background: var(--vs-navy); }
.vs-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

.vs-cover-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 27, 52, 0) 45%, rgba(11, 27, 52, 0.55) 100%);
}

.vs-hero-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0 20px;
    align-items: end;
    padding: 0 26px 22px;
}

.vs-logo {
    position: relative;
    z-index: 2;
    width: 124px;
    height: 124px;
    margin-top: -62px;
    overflow: hidden;
    border: 5px solid var(--vs-card);
    border-radius: 28px;
    background: var(--vs-navy);
    box-shadow: 0 8px 22px rgba(11, 27, 52, 0.25);
}

.vs-logo img { width: 100%; height: 100%; object-fit: cover; }

.vs-id { min-width: 0; padding-top: 14px; }

.vs-id h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.8rem;
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.15;
    color: var(--vs-text);
}

.vs-verified {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

[data-theme="dark"] .vs-verified { color: #86efac; }

.vs-tagline { margin: 6px 0 0; color: var(--vs-muted); font-style: italic; font-size: 1.02rem; }

.vs-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.6rem; margin: 10px 0 0; }

.vs-chip {
    display: inline-block;
    padding: 0.22rem 0.8rem;
    border-radius: 999px;
    background: var(--vs-navy);
    color: var(--vs-gold-soft);
    font-size: 0.78rem;
    font-weight: 600;
}

.vs-chip-soft { background: var(--vs-chip); color: var(--vs-text); }

.vs-loc { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--vs-muted); font-size: 0.9rem; }

.vs-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; padding-top: 14px; }

.vs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border: 1.5px solid var(--vs-navy);
    border-radius: 999px;
    background: var(--vs-navy);
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.vs-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(11, 27, 52, 0.18); color: #fff; }
.vs-btn-wa { border-color: #1f9d55; background: #1f9d55; }
.vs-btn-wa:hover { background: #178a47; }

.vs-btn-ghost { background: transparent; color: var(--vs-text); border-color: var(--vs-line); }
.vs-btn-ghost:hover { color: var(--vs-text); border-color: var(--vs-gold); box-shadow: none; }
.vs-btn-sm { padding: 0.55rem 1rem; font-size: 0.85rem; }

.vs-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--vs-line);
    background: var(--vs-bg);
}

.vs-stats li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 24px;
    border-right: 1px solid var(--vs-line);
}

.vs-stats li:last-child { border-right: 0; }
.vs-stats strong { font-size: 1.15rem; color: var(--vs-text); }
.vs-stats span { font-size: 0.8rem; color: var(--vs-muted); }

/* --- Corps -------------------------------------------------------------------------------------------- */
.vs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
    margin-top: 24px;
}

.vs-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 16px;
    scroll-margin-top: 90px;
}

.vs-toolbar h2 { display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 1.5rem; color: var(--vs-text); }

.vs-count {
    padding: 0.1rem 0.7rem;
    border-radius: 999px;
    background: var(--vs-chip);
    color: var(--vs-muted);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.85rem;
    font-weight: 700;
}

.vs-filter { display: flex; flex-wrap: wrap; gap: 8px; }

.vs-filter input,
.vs-filter select {
    min-width: 0;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--vs-line);
    border-radius: 999px;
    background: var(--vs-card);
    color: var(--vs-text);
    font: inherit;
    font-size: 0.88rem;
}

.vs-filter input { width: 210px; }
.vs-ico { display: inline-flex; width: 18px; margin-top: 2px; color: var(--vs-gold); }
.vs-filter input:focus, .vs-filter select:focus { outline: 2px solid var(--vs-gold); outline-offset: 1px; }

.vs-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.vs-product {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 10px 14px;
    border: 1px solid var(--vs-line);
    border-radius: 16px;
    background: var(--vs-card);
    color: var(--vs-text);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.vs-product:hover { transform: translateY(-3px); border-color: var(--vs-gold); box-shadow: 0 14px 28px rgba(11, 27, 52, 0.12); color: var(--vs-text); }

.vs-product-img { position: relative; display: block; overflow: hidden; border-radius: 11px; background: var(--vs-bg); aspect-ratio: 1; }
.vs-product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.vs-product:hover .vs-product-img img { transform: scale(1.06); }

.vs-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.vs-badge-promo { background: #dc2626; }
.vs-badge-new { background: var(--vs-gold); color: #1b1b1b; }

.vs-product-name {
    display: -webkit-box;
    overflow: hidden;
    padding: 2px 4px 0;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.vs-product-price { padding: 0 4px; color: var(--vs-price); font-weight: 800; }
.vs-product-price del { margin-left: 0.3rem; color: var(--vs-muted); font-size: 0.82em; font-weight: 400; }

.vs-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 26px; }

.vs-pages a {
    min-width: 40px;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--vs-line);
    border-radius: 999px;
    background: var(--vs-card);
    color: var(--vs-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.vs-pages a:hover { border-color: var(--vs-gold); color: var(--vs-text); }
.vs-pages a.is-current { border-color: var(--vs-navy); background: var(--vs-navy); color: #fff; }

.vs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 48px 20px;
    border: 1.5px dashed var(--vs-line);
    border-radius: 18px;
    background: var(--vs-card);
    text-align: center;
}

.vs-empty > span { font-size: 2.2rem; }
.vs-empty p { max-width: 42ch; margin: 0; color: var(--vs-muted); }
.vs-empty a { color: var(--vs-price); font-weight: 700; text-decoration: underline; }

/* --- Colonne d'informations -------------------------------------------------------------------------- */
.vs-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }

.vs-card {
    padding: 18px 20px;
    border: 1px solid var(--vs-line);
    border-radius: 18px;
    background: var(--vs-card);
}

.vs-card h2 { margin: 0 0 10px; font-size: 1.1rem; color: var(--vs-text); }
.vs-lead { margin: 0 0 8px; font-size: 0.98rem; line-height: 1.6; }
.vs-long { color: var(--vs-muted); font-size: 0.92rem; line-height: 1.65; }
.vs-more summary { color: var(--vs-price); font-size: 0.88rem; font-weight: 700; cursor: pointer; }
.vs-more[open] summary { margin-bottom: 8px; }
.vs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }

.vs-contacts { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; font-size: 0.93rem; line-height: 1.5; }
.vs-contacts li { display: flex; gap: 10px; }
.vs-contacts li > span { flex: none; }
.vs-contacts li > .vs-ico { margin-top: 3px; }
.vs-contacts a { color: var(--vs-price); font-weight: 600; word-break: break-all; }
.vs-contacts small { color: var(--vs-muted); }

.vs-social { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }

.vs-social a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--vs-line);
    border-radius: 999px;
    color: var(--vs-text);
    font-size: 0.86rem;
    font-weight: 600;
}

.vs-social a:hover { border-color: var(--vs-gold); color: var(--vs-text); }

.vs-trust {
    border-color: transparent;
    background: linear-gradient(160deg, #0B1B34 0%, #14305c 100%);
    color: #e2e8f0;
}

.vs-trust strong { color: var(--vs-gold-soft); }
.vs-trust p { margin: 6px 0 0; font-size: 0.86rem; line-height: 1.55; color: #c3cde0; }

/* --- Adaptation écrans ------------------------------------------------------------------------------ */
@media (max-width: 1020px) {
    .vs-layout { grid-template-columns: minmax(0, 1fr); }
    .vs-side { position: static; }
    .vs-hero-body { grid-template-columns: auto minmax(0, 1fr); }
    .vs-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 16px; }
}

@media (max-width: 640px) {
    .vs-cover { height: 170px; }
    .vs-hero-body { grid-template-columns: minmax(0, 1fr); padding: 0 16px 18px; }
    .vs-logo { width: 96px; height: 96px; margin-top: -48px; border-radius: 22px; }
    .vs-id { padding-top: 10px; }
    .vs-actions .vs-btn-wa { flex: 1 1 100%; }
    .vs-actions .vs-btn-ghost { flex: 1 1 calc(50% - 0.3rem); }
    .vs-stats li { padding: 12px 16px; }
    .vs-filter, .vs-filter input { width: 100%; }
    .vs-filter select, .vs-filter .vs-btn { flex: 1 1 auto; }
    .vs-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .vs-product { padding: 8px 8px 12px; }
}

/* --- Résultats rechargés en AJAX ------------------------------------------------------------------------ */
#vs-results { position: relative; transition: opacity 0.18s; }
#vs-results.is-loading { opacity: 0.45; pointer-events: none; }

#vs-results.is-loading::after {
    content: '';
    position: absolute;
    top: 40px;
    left: 50%;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border: 3px solid var(--vs-line);
    border-top-color: var(--vs-gold);
    border-radius: 50%;
    animation: vs-spin 0.7s linear infinite;
}

@keyframes vs-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    #vs-results.is-loading::after { animation: none; }
}
