@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Inter:wght@400;500;600&family=Cairo:wght@600;700&display=swap');

:root {
    --blue-900: #0B2A6B;
    --blue-700: #12409E;
    --blue-600: #1657D6;
    --blue-100: #EAF1FE;
    --blue-50: #F5F9FF;
    --white: #FFFFFF;
    --ink: #10233F;
    --muted: #5C6B85;
    --line: #DCE6FA;
    --radius: 12px;
    --font-display: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-ar: 'Cairo', sans-serif;
}

* { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
.price-display {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    direction: ltr;
    white-space: nowrap;
}
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--white);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.55;
}

a { color: inherit; }

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--white); }
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 40px; width: auto; max-width: 120px; object-fit: contain; }
.brand-names { display: flex; align-items: baseline; gap: 10px; }
.confirmation-topbar { justify-content: center; }
.brand-fr {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--blue-900);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.brand-ar {
    font-family: var(--font-ar);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--blue-600);
}
.delivery-note {
    font-size: 0.78rem;
    color: var(--blue-700);
    background: var(--blue-100);
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 500;
}

/* ---------- Hero ---------- */
.hero {
    padding: 48px 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
}

.gallery-main {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: var(--blue-50);
    width: 100%;
    aspect-ratio: 4/3.2;
    max-height: 460px;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}
.gallery-main { position: relative; }
.zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(11,42,107,0.75);
    color: var(--white);
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 999px;
    pointer-events: none;
}
.gallery-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 0.9rem;
}
.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.thumb {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 2px solid var(--line);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    background: var(--blue-50);
}
.thumb img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: cover; display: block; }
.thumb:hover { border-color: var(--blue-600); }
.thumb-active { border-color: var(--blue-600); }

.eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--blue-600);
    font-weight: 600;
    margin-bottom: 12px;
}
.hero-info h1 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.6vw, 2.6rem);
    line-height: 1.12;
    margin: 0 0 12px;
    color: var(--blue-900);
    font-weight: 700;
}
.tagline {
    color: var(--muted);
    font-size: 1.02rem;
    margin: 0 0 22px;
}
.price-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.price-now {
    font-family: var(--font-display);
    font-size: 1.9rem;
    color: var(--blue-700);
    font-weight: 700;
}
.price-old {
    font-size: 1.05rem;
    color: var(--muted);
}
.price-old .price-number,
.price-old .price-currency {
    text-decoration: line-through;
}
.stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 22px;
}
.stock-pill.en_stock { background: var(--blue-100); color: var(--blue-700); }
.stock-pill.rupture { background: #F3F5FA; color: var(--muted); }
.stock-pill.sur_commande { background: var(--blue-50); color: var(--blue-600); border: 1px solid var(--line); }
.stock-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 26px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.92rem;
    color: var(--ink);
}
.feature-list .check {
    color: var(--blue-600);
    font-weight: 700;
    flex-shrink: 0;
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 13px 22px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.btn-primary { background: var(--blue-600); color: var(--white); }
.btn-primary:hover { background: var(--blue-700); }
.btn-ghost { background: var(--white); color: var(--blue-700); border-color: var(--blue-600); }

/* Le bouton WhatsApp reste toujours vert (couleur de la marque), peu importe la couleur d'accent choisie */
a.btn[href^="https://wa.me/"] {
    background: #25D366;
    border-color: #25D366;
    color: #FFFFFF;
}
a.btn[href^="https://wa.me/"]:hover {
    background: #1EBE5A;
    border-color: #1EBE5A;
}

/* ---------- Description ---------- */
.section-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin: 0 0 8px;
    color: var(--blue-900);
}
.section-sub {
    color: var(--muted);
    margin: 0 0 28px;
    max-width: 66ch;
}
.description-section { padding: 12px 0 8px; }

/* ---------- Order form ---------- */
.order-section { padding: 24px 0 80px; }
.order-card {
    background: var(--blue-50);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 36px;
}
.order-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 4px;
}
.field[hidden] { display: none !important; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field.full { grid-column: 1 / -1; }
.field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--blue-900);
}
.required-mark {
    color: #C0392B;
    font-weight: 700;
}
.field input, .field textarea, .field select {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.95rem;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: 2px solid var(--blue-600);
    outline-offset: 1px;
    border-color: var(--blue-600);
}
.field textarea { resize: vertical; min-height: 80px; }
.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-row button {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--blue-700);
    font-size: 1rem;
    cursor: pointer;
}
.qty-row input { width: 60px; text-align: center; }
.order-submit {
    margin-top: 10px;
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    justify-content: center;
}
.form-note {
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
}
.alert {
    margin: 20px auto 0;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.92rem;
}
.alert-success {
    background: var(--blue-100);
    border: 1px solid var(--blue-600);
    color: var(--blue-700);
}
.alert-error {
    background: #FCEEEE;
    border: 1px solid #E38B8B;
    color: #B23A3A;
}

footer {
    border-top: 1px solid var(--line);
    padding: 24px 0 40px;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

/* ---------- Page de confirmation ---------- */
.confirmation-wrap {
    display: flex;
    justify-content: center;
    padding: 60px 24px 80px;
}
.confirmation-card {
    background: var(--blue-50);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 40px;
    max-width: 560px;
    width: 100%;
    text-align: center;
}
.confirmation-check {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--blue-600);
    color: var(--white);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.confirmation-card h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--blue-900);
    margin: 0 0 10px;
}
.confirmation-message {
    color: var(--muted);
    margin: 0 0 28px;
}
.confirmation-summary {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
    text-align: start;
    margin-bottom: 28px;
}
.confirmation-summary h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--blue-900);
    margin: 0 0 16px;
}
.confirmation-summary dl { margin: 0; }
.confirmation-summary dt {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-top: 14px;
}
.confirmation-summary dt:first-child { margin-top: 0; }
.confirmation-summary dd {
    margin: 4px 0 0;
    font-size: 0.95rem;
    color: var(--ink);
}
.confirmation-total {
    font-family: var(--font-display);
    font-size: 1.3rem !important;
    font-weight: 700;
    color: var(--blue-700) !important;
}

/* ---------- Lightbox ---------- */
.lightbox[hidden] { display: none; }
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(11,42,107,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}
.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: var(--white);
    color: var(--blue-900);
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
}

/* ---------- Livraison ---------- */
.delivery-block {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.delivery-toggle { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.radio-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--white);
    white-space: nowrap;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.radio-pill input { accent-color: var(--blue-600); }
.radio-pill:has(input:checked) {
    border-color: var(--blue-600);
    background: var(--blue-100);
    color: var(--blue-700);
}
.field-hint {
    font-size: 0.76rem;
    color: var(--muted);
}
#commune_text:disabled, #address:disabled {
    background: #EFEFEF;
    color: var(--muted);
    cursor: not-allowed;
}
.delivery-price-row, .total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--blue-100);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--blue-900);
    margin-top: 16px;
}
.total-row {
    background: var(--blue-700);
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 20px;
}
.total-row strong { font-family: var(--font-display); font-size: 1.15rem; }

@media (max-width: 820px) {
    .hero { grid-template-columns: 1fr; padding-top: 32px; }
    .order-grid { grid-template-columns: 1fr; }
    .order-card { padding: 22px; }
}

@media (max-width: 420px) {
    .price-now { font-size: 1.5rem; }
    .price-old { font-size: 0.88rem; }
    .total-row { font-size: 0.88rem; flex-wrap: wrap; gap: 6px; }
    .total-row strong { font-size: 1rem; }
    .delivery-price-row { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 600px) {
    .topbar-inner { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
    .brand { flex-direction: column; align-items: center; gap: 6px; }
    .brand-names { flex-direction: column; align-items: center; gap: 2px; }
}
