/* Boutique en ligne — vitrine publique (mobile d'abord). */
:root {
    --os-bg: #f5f6f8;
    --os-surface: #ffffff;
    --os-text: #1f2933;
    --os-muted: #616e7c;
    --os-border: #dde2e8;
    --os-primary: #1f5fbf;
    --os-primary-text: #ffffff;
    --os-success: #1e7b45;
    --os-danger: #b42318;
    --os-radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    /* 16px mini : évite le zoom automatique d'iOS sur les champs */
    font-size: 16px;
    line-height: 1.45;
    background: var(--os-bg);
    color: var(--os-text);
    padding-bottom: 88px;
}

.os-wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.os-header { background: var(--os-surface); border-bottom: 1px solid var(--os-border); }
.os-header-inner { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.os-logo { max-height: 44px; max-width: 140px; object-fit: contain; }
.os-title { font-size: 20px; margin: 0; }

.os-main { padding-top: 16px; }
.os-welcome { color: var(--os-muted); margin: 0 0 16px; }

.os-toolbar { position: sticky; top: 0; z-index: 5; background: var(--os-bg); padding: 8px 0 12px; }

.os-input {
    width: 100%;
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--os-border);
    border-radius: 8px;
    background: var(--os-surface);
    color: var(--os-text);
}
.os-input:focus { outline: 2px solid var(--os-primary); outline-offset: 1px; }

.os-chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
.os-chip {
    flex: 0 0 auto;
    font: inherit;
    font-size: 14px;
    padding: 8px 14px;
    min-height: 40px;
    border-radius: 999px;
    border: 1px solid var(--os-border);
    background: var(--os-surface);
    color: var(--os-text);
    cursor: pointer;
}
.os-chip.is-active { background: var(--os-primary); border-color: var(--os-primary); color: var(--os-primary-text); }

.os-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .os-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .os-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.os-card {
    background: var(--os-surface);
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.os-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #eef1f4; display: block; }
.os-card-body { padding: 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.os-card-name { font-size: 15px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.os-card-desc { font-size: 13px; color: var(--os-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.os-card-price { font-weight: 700; font-size: 16px; margin-top: auto; }
.os-card-stock { font-size: 12px; color: var(--os-success); }
.os-card-stock.is-out { color: var(--os-danger); }
.os-card .os-btn, .os-card .os-stepper { margin-top: 8px; }

.os-btn {
    font: inherit;
    font-weight: 600;
    border: 1px solid var(--os-border);
    background: var(--os-surface);
    color: var(--os-text);
    border-radius: 8px;
    min-height: 44px;
    padding: 8px 12px;
    cursor: pointer;
}
.os-btn:disabled { opacity: .5; cursor: not-allowed; }
.os-btn-primary { background: var(--os-primary); border-color: var(--os-primary); color: var(--os-primary-text); }
.os-btn-block { width: 100%; }

.os-stepper { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--os-border); border-radius: 8px; }
.os-stepper button { font: inherit; font-size: 20px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--os-primary); cursor: pointer; }
.os-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.os-stepper span { font-weight: 700; min-width: 2ch; text-align: center; }

.os-empty { text-align: center; color: var(--os-muted); padding: 32px 0; }

.os-cart-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font: inherit;
    padding: 14px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--os-primary);
    color: var(--os-primary-text);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
    cursor: pointer;
    z-index: 10;
}
.os-cart-bar[hidden] { display: none; }
.os-cart-bar-cta { font-weight: 600; }

.os-sheet { position: fixed; inset: 0; z-index: 20; }
.os-sheet[hidden] { display: none; }
.os-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.os-sheet-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background: var(--os-surface);
    overflow-y: auto;
    padding: 16px;
}
.os-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.os-sheet-head h2 { margin: 0; font-size: 20px; }
.os-close { font-size: 28px; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; color: var(--os-text); }

.os-cart-lines { margin: 12px 0; border-top: 1px solid var(--os-border); }
.os-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--os-border); }
.os-line img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.os-line-info { flex: 1; min-width: 0; }
.os-line-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.os-line-price { color: var(--os-muted); font-size: 13px; }
.os-line .os-stepper { flex: 0 0 auto; }
.os-line .os-stepper button { width: 36px; height: 36px; }

.os-form h3 { font-size: 16px; margin: 20px 0 8px; }
.os-form label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.os-form label .os-input { margin-top: 4px; font-weight: 400; }
.os-form small { display: block; color: var(--os-muted); font-weight: 400; margin-top: 4px; }
.os-radios { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.os-radio { display: flex !important; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--os-border); border-radius: 8px; font-weight: 400 !important; margin: 0 !important; cursor: pointer; }
.os-radio input { width: 20px; height: 20px; }
.os-hint { font-size: 13px; color: var(--os-muted); margin: 4px 0 12px; }
.os-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.os-totals { border-top: 1px solid var(--os-border); margin: 16px 0; padding-top: 12px; }
.os-totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.os-totals div[hidden] { display: none; }
.os-total { font-weight: 700; font-size: 18px; }
.os-error { color: var(--os-danger); font-weight: 600; }

/* Pages de statut */
.os-status-card { background: var(--os-surface); border: 1px solid var(--os-border); border-radius: var(--os-radius); padding: 20px; margin: 16px 0; }
.os-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #e8edf3; color: var(--os-text); }
.os-badge-pending { background: #fff4d6; color: #7a5200; }
.os-badge-validated { background: #dcebff; color: #164a94; }
.os-badge-paid, .os-badge-delivered { background: #dcf3e5; color: #155d34; }
.os-badge-cancelled { background: #fde2e1; color: #8f1d15; }
.os-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.os-table td, .os-table th { padding: 8px 4px; border-bottom: 1px solid var(--os-border); text-align: left; }
.os-table .num { text-align: right; white-space: nowrap; }
.os-success-box { background: #dcf3e5; color: #155d34; border-radius: var(--os-radius); padding: 14px 16px; font-weight: 600; }

/* Demande de proforma (produits en rupture) */
.os-btn-proforma { background: #fff4d6; border-color: #e0b54a; color: #7a5200; }
.os-proforma-banner { background: #fff4d6; color: #7a5200; border-radius: 8px; padding: 10px 12px; margin: 12px 0 0; font-size: 14px; }
.os-proforma-banner[hidden] { display: none; }
.os-line-tag { display: inline-block; margin-top: 2px; font-size: 12px; font-weight: 600; color: #7a5200; background: #fff4d6; border-radius: 999px; padding: 1px 8px; }
.os-badge-quoted { background: #dcebff; color: #164a94; }
.os-badge-accepted { background: #dcf3e5; color: #155d34; }
.os-badge-declined { background: #fde2e1; color: #8f1d15; }

/* KENMORE 2026-10-01 — fiche produit agrandie (clic sur l'image ou le nom) */
.os-card-media { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.os-card-media:focus-visible, .os-card-link:focus-visible { outline: 2px solid var(--os-primary); outline-offset: 2px; }
.os-card-photos { position: absolute; top: 8px; right: 8px; background: rgba(15, 23, 42, .72); color: #fff; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 8px; }
.os-card-zoom { position: absolute; left: 8px; bottom: 8px; background: rgba(255, 255, 255, .92); color: var(--os-text); font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; opacity: 0; transition: opacity .15s; }
.os-card-media:hover .os-card-zoom, .os-card-media:focus-visible .os-card-zoom { opacity: 1; }
@media (hover: none) { .os-card-zoom { opacity: 1; } }
.os-card-link { font: inherit; color: inherit; text-align: left; padding: 0; border: 0; background: none; cursor: pointer; }
.os-card-link:hover { color: var(--os-primary); text-decoration: underline; }

.os-product { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 24px; }
.os-product[hidden] { display: none; }
.os-product-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.os-product-panel {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--os-surface);
    border-radius: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.os-product-close { position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--os-surface); border-radius: 50%; }
.os-product-stage { position: relative; background: #f1f4f7; border-radius: 10px; overflow: hidden; touch-action: pan-y; }
.os-product-stage img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; cursor: zoom-in; }
.os-gallery-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .92); color: var(--os-text);
    font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.os-gallery-nav[hidden] { display: none; }
.os-gallery-prev { left: 10px; }
.os-gallery-next { right: 10px; }
.os-gallery-count { position: absolute; bottom: 10px; right: 10px; background: rgba(15, 23, 42, .72); color: #fff; font-size: 12px; border-radius: 999px; padding: 2px 10px; }
.os-gallery-count[hidden], .os-gallery-thumbs[hidden] { display: none; }
.os-gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.os-gallery-thumb { flex: 0 0 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #f1f4f7; cursor: pointer; }
.os-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.os-gallery-thumb.is-active { border-color: var(--os-primary); }

.os-product-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.os-product-name { font-size: 22px; margin: 0; padding-right: 40px; overflow-wrap: anywhere; }
.os-product-price-value { font-size: 24px; font-weight: 700; }
.os-product-components[hidden], .os-product-desc[hidden] { display: none; }
.os-product-components h3 { font-size: 15px; margin: 4px 0 6px; }
.os-product-components ul { margin: 0; padding-left: 18px; }
.os-product-components li { margin: 2px 0; }
/* Description complète : retours à la ligne conservés, texte brut (pas de HTML). */
.os-product-desc { white-space: pre-line; color: var(--os-text); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; border-top: 1px solid var(--os-border); padding-top: 10px; }
.os-product-actions { margin-top: auto; position: sticky; bottom: 0; background: var(--os-surface); padding-top: 10px; }
.os-product-actions .os-btn { width: 100%; }

.os-zoom { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.os-zoom[hidden] { display: none; }
.os-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }
.os-zoom-close { position: absolute; top: 10px; right: 10px; color: #fff; }

/* Mobile : plein écran, une seule colonne. */
@media (max-width: 720px) {
    .os-product { padding: 0; align-items: stretch; }
    .os-product-panel { max-width: none; max-height: none; height: 100%; border-radius: 0; grid-template-columns: 1fr; gap: 14px; padding: 16px 16px 0; }
    .os-product-actions { padding-bottom: 16px; }
    .os-product-name { font-size: 19px; }
}
