:root { --primary: #000; --bg: #f9f9f9; --text: #333; --accent: #27ae60; }
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: var(--bg); color: var(--text); transition: 0.3s; }

body[dir="rtl"] { text-align: right; }
body[dir="rtl"] .lang-switch { right: auto; left: 20px; }
body[dir="rtl"] .btn-back { margin-left: 0; }
body[dir="rtl"] .products-header { flex-direction: row-reverse; }

.top-banner { background: var(--accent); color: white; text-align: center; padding: 10px; font-weight: bold; font-size: 1rem; }
.lang-switch { position: absolute; top: 60px; right: 20px; background: white; color: black; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; font-weight: bold; z-index: 100; box-shadow: 0 2px 5px rgba(0,0,0,0.2); font-family: inherit;}
.lang-switch:hover { background: #eee; }

#hero { height: 50vh; background-size: cover; background-position: center; position: relative; display: flex; align-items: center; justify-content: center; text-align: center; color: white; background-color: #2c3e50; } 
.overlay { background: rgba(0,0,0,0.6); padding: 2rem; border-radius: 10px; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.overlay h1 { font-size: 3.5rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 2px; }
.overlay p { font-size: 1.2rem; }
section { padding: 40px 20px; max-width: 1200px; margin: auto; }
h2 { text-align: center; margin-bottom: 30px; font-size: 2.2rem; text-transform: uppercase; }

.grid-categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.category-card { cursor: pointer; border-radius: 10px; overflow: hidden; position: relative; height: 350px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.category-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.category-card:hover img { transform: scale(1.05); }
.category-title { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.9)); color: white; text-align: center; padding: 30px 10px 20px; font-size: 1.8rem; font-weight: bold; text-transform: uppercase; }

.grid-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1000px) { .grid-products { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-products { grid-template-columns: 1fr; } }

.product-card { background: white; border-radius: 10px; padding: 15px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); text-align: center; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); }
.product-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 5px; margin-bottom: 15px; background-color: #eee; }
.product-card h3 { font-size: 1.1rem; margin-bottom: 10px; flex-grow: 1; }
.product-card .price { font-weight: bold; color: var(--accent); font-size: 1.2rem; margin-bottom: 15px; }
.btn-order { background: var(--primary); color: white; border: none; padding: 12px 20px; width: 100%; cursor: pointer; border-radius: 5px; font-weight: bold; text-transform: uppercase; transition: background 0.3s; margin-top: auto; }
.btn-order:hover { background: #333; }

.products-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.btn-back { background: #eee; border: none; padding: 10px 20px; cursor: pointer; border-radius: 5px; font-weight: bold; }

.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); align-items: center; justify-content: center; }
.modal-content { background: white; padding: 30px; border-radius: 10px; width: 95%; max-width: 900px; position: relative; max-height: 95vh; overflow-y: auto; text-align: left; }
body[dir="rtl"] .modal-content { text-align: right; }
.close { position: absolute; top: 15px; right: 20px; font-size: 1.8rem; cursor: pointer; color: #555; z-index: 10; }
body[dir="rtl"] .close { right: auto; left: 20px; }

.product-page-layout { display: flex; gap: 40px; }
.product-left { flex: 1; min-width: 0; }
.product-right { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; }

body[dir="rtl"] .product-page-layout { flex-direction: row-reverse; }

#modal-gallery { display: flex; flex-direction: column; align-items: center; margin-bottom: 15px; width: 100%; }
#zoom-container { width: 100%; height: 450px; overflow: hidden; position: relative; cursor: zoom-in; background: #f4f4f4; border-radius: 5px; margin-bottom: 15px; }
#modal-main-image { width: 100%; height: 100%; object-fit: contain; transition: transform 0.1s ease; transform-origin: center center; }

.thumbnails-container { display: flex; gap: 10px; overflow-x: auto; max-width: 100%; padding-bottom: 5px; }
.thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 5px; cursor: pointer; opacity: 0.5; border: 2px solid transparent; transition: 0.2s; }
.thumb:hover, .thumb.active { opacity: 1; border-color: var(--accent); }

.price-display { font-size: 1.4rem; color: var(--accent); font-weight: bold; margin-bottom: 5px; }
.delivery-note { font-size: 0.95rem; color: #e67e22; font-weight: bold; margin-bottom: 15px; }

form { display: flex; flex-direction: column; gap: 12px; }
label { font-weight: bold; font-size: 0.95rem; color: #444; }
input, select, textarea { padding: 12px; border: 1px solid #ddd; border-radius: 5px; width: 100%; font-size: 1rem; font-family: inherit; }
.btn-submit { background: var(--accent); color: white; border: none; padding: 16px; font-size: 1.1rem; font-weight: bold; border-radius: 5px; cursor: pointer; margin-top: 10px; text-transform: uppercase; transition: 0.3s; }
.btn-submit:hover:not(:disabled) { background: #219653; }
.btn-submit:disabled { background: #95a5a6; cursor: not-allowed; }

@media (max-width: 768px) {
    .product-page-layout { flex-direction: column; gap: 20px; padding: 20px; }
    body[dir="rtl"] .product-page-layout { flex-direction: column; }
    #zoom-container { height: 350px; }
    .close { top: 10px; right: 10px; background: white; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
    body[dir="rtl"] .close { right: auto; left: 10px; }
}

#wa-float { position: fixed; bottom: 20px; right: 20px; width: 58px; height: 58px; background: #25d366; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 900; transition: transform 0.2s; }
#wa-float:hover { transform: scale(1.1); }
body[dir="rtl"] #wa-float { right: auto; left: 20px; }
#site-footer { background: #111; color: #ddd; text-align: center; padding: 30px 20px 90px; margin-top: 40px; line-height: 1.8; }
#site-footer a { color: #25d366; font-weight: bold; text-decoration: none; }


/* ---------- Choix de la ville + frais de livraison ---------- */
.city-picker { position: relative; }
.city-picker input { padding-right: 38px; }
body[dir="rtl"] .city-picker input { padding-right: 12px; padding-left: 38px; }
.city-arrow { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: #777; cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 6px; }
body[dir="rtl"] .city-arrow { right: auto; left: 14px; }
.city-suggestions { position: absolute; z-index: 50; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border: 1px solid #ddd; border-radius: 5px; box-shadow: 0 8px 20px rgba(0,0,0,0.15); max-height: 260px; overflow-y: auto; list-style: none; -webkit-overflow-scrolling: touch; }
.city-option { display: flex; align-items: baseline; gap: 10px; padding: 11px 12px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.city-option:last-child { border-bottom: none; }
.city-option:hover, .city-option.active { background: #f1f8f4; }
.city-option.selected { background: #e8f5ee; }
.co-main { font-weight: bold; color: #222; }
.co-other { color: #888; font-size: 0.85rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-fee { color: var(--accent); font-weight: bold; font-size: 0.9rem; white-space: nowrap; }
.city-empty { padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; color: #555; }
.city-empty a { color: #25a244; font-weight: bold; text-decoration: underline; }
.city-help { font-size: 0.9rem; color: #666; margin-top: -4px; }
.city-help a { color: #25a244; font-weight: bold; text-decoration: underline; }

.price-summary { background: #f6faf7; border: 1px solid #d7eadf; border-radius: 8px; padding: 12px 14px; margin-bottom: 15px; }
.ps-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 0.98rem; color: #444; }
.ps-row span:last-child { font-weight: bold; white-space: nowrap; }
.ps-total { border-top: 1px solid #cfe3d8; margin-top: 6px; padding-top: 10px; font-size: 1.15rem; color: #222; }
.ps-total span:last-child { color: var(--accent); font-size: 1.3rem; }
.co-fee, .ps-row span:last-child { direction: ltr; unicode-bidi: isolate; }


/* ---------- Écran de choix de langue ---------- */
.lang-splash { position: fixed; inset: 0; z-index: 2000; background: #111; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lang-splash-box { background: #fff; border-radius: 12px; padding: 36px 28px; width: 100%; max-width: 420px; text-align: center; }
.ls-title { font-size: 1.5rem; text-transform: none; margin-bottom: 6px; color: #222; }
.ls-ar { margin-bottom: 26px; }
.ls-buttons { display: flex; gap: 14px; }
.ls-btn { flex: 1; padding: 16px 10px; font-size: 1.25rem; font-weight: bold; border: 2px solid #000; background: #000; color: #fff; border-radius: 8px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.ls-btn:hover, .ls-btn:focus-visible { background: var(--accent); border-color: var(--accent); outline: none; }


/* ---------- Infos livraison, réassurance, total au-dessus du bouton ---------- */
.ps-info { font-size: 0.9rem; color: #555; margin-top: 8px; line-height: 1.5; }
.cod-note { font-size: 0.92rem; color: #2e6b45; background: #eef8f1; border-radius: 6px; padding: 10px 12px; line-height: 1.5; margin-top: 4px; }
.submit-total { background: #f6faf7; border: 1px solid #d7eadf; border-radius: 8px; padding: 10px 14px; }
.submit-total .ps-total { margin-top: 4px; padding-top: 8px; }

/* ---------- Page de confirmation ---------- */
.success-overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; padding: 16px; }
.success-box { background: #fff; border-radius: 12px; width: 100%; max-width: 480px; max-height: 94vh; overflow-y: auto; padding: 28px 22px; text-align: center; }
.success-check { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 2.2rem; line-height: 64px; font-weight: bold; }
.os-title { font-size: 1.6rem; text-transform: none; margin-bottom: 10px; color: #222; }
.os-msg { color: #555; line-height: 1.6; margin-bottom: 18px; }
.os-recap { background: #f6faf7; border: 1px solid #d7eadf; border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; text-align: left; }
body[dir="rtl"] .os-recap { text-align: right; }
.os-row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid #e3efe8; font-size: 0.95rem; }
.os-row:last-child { border-bottom: none; }
.os-row span:first-child { color: #666; }
.os-row span:last-child { font-weight: bold; text-align: right; }
body[dir="rtl"] .os-row span:last-child { text-align: left; }
.os-total { font-size: 1.1rem; }
.os-total span:last-child { color: var(--accent); }
.os-actions { display: flex; gap: 10px; }
.os-wa { flex: 1; display: block; background: #25d366; color: #fff; text-decoration: none; font-weight: bold; padding: 14px 10px; border-radius: 5px; text-align: center; font-size: 1rem; }
.os-close { flex: 1; background: #444; color: #fff; border: none; border-radius: 5px; padding: 14px 10px; font-size: 1rem; font-weight: bold; cursor: pointer; }
.os-close:hover { background: #222; }


/* ---------- Sections d'accueil (activables dans l'admin) ---------- */
.hero-btn { align-self: center; margin-top: 22px; background: var(--accent); color: #fff; border: none; padding: 14px 32px; font-size: 1.1rem; font-weight: bold; border-radius: 6px; cursor: pointer; text-transform: uppercase; transition: background 0.2s; }
.hero-btn:hover { background: #219653; }

.trust-section { max-width: 1200px; margin: auto; padding: 22px 20px 0; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.trust-item { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 2px 6px rgba(0,0,0,0.06); font-weight: bold; font-size: 0.98rem; }
.trust-icon { font-size: 1.6rem; line-height: 1; }

.product-card .img-wrap { position: relative; margin-bottom: 15px; }
.product-card .img-wrap img { margin-bottom: 0; display: block; }
.pct-badge, .tag-badge { position: absolute; top: 8px; inset-inline-start: 8px; background: #e74c3c; color: #fff; font-weight: bold; font-size: 0.85rem; padding: 4px 9px; border-radius: 4px; }
.tag-badge { background: #111; }
.pct-badge + .tag-badge { top: 38px; }
.old-price { color: #999; font-weight: normal; font-size: 0.85em; margin-inline-end: 4px; }

.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.review-card { background: #fff; border-radius: 10px; padding: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.06); display: flex; flex-direction: column; gap: 10px; }
.review-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: #eee; }
.review-card p { line-height: 1.5; color: #444; }
.review-card strong { color: #222; }

.faq-list { max-width: 800px; margin: auto; display: flex; flex-direction: column; gap: 10px; }
.faq-list details { background: #fff; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); padding: 14px 16px; }
.faq-list summary { cursor: pointer; font-weight: bold; }
.faq-list details p { margin-top: 10px; color: #555; line-height: 1.6; }
