/*
 * E-Catalogue : styles neutres. Le thème peut tout ajuster via ces variables :
 * --ecat-accent, --ecat-accent-ink, --ecat-ink, --ecat-muted, --ecat-line, --ecat-bg, --ecat-radius, --ecat-font, --ecat-title-font
 */
:root {
	--ecat-accent: #1e1e1e; --ecat-accent-ink: #fff; --ecat-ink: #1e1e1e; --ecat-muted: #6b6b6b;
	--ecat-line: #e2e2e2; --ecat-bg: #fff; --ecat-soft: #f4f4f4; --ecat-radius: 999px; --ecat-font: inherit; --ecat-title-font: inherit;
}
.ecat-lock, .ecat-lock body { overflow: hidden; }
.ecat-hidden { display: none !important; }

/* Bouton d'ajout + quantité */
.ecat-add { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.ecat-add__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px; border-radius: var(--ecat-radius); background: var(--ecat-accent); color: var(--ecat-accent-ink); font: 600 16px/1 var(--ecat-font); text-decoration: none; cursor: pointer; transition: opacity .2s, transform .2s; flex: 1; }
.ecat-add__btn:hover { opacity: .9; }
.ecat-add__btn.is-busy { opacity: .6; pointer-events: none; }
.ecat-add__btn.is-added::after { content: "✓"; }
.ecat-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--ecat-line); border-radius: var(--ecat-radius); background: var(--ecat-bg); }
.ecat-qty button { width: 40px; height: 48px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--ecat-ink); cursor: pointer; }
.ecat-qty input { width: 40px; border: 0; background: none; text-align: center; font: 600 16px var(--ecat-font); color: var(--ecat-ink); -moz-appearance: textfield; appearance: textfield; padding: 0; }
.ecat-qty input::-webkit-outer-spin-button, .ecat-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ecat-qty--sm button { width: 30px; height: 34px; font-size: 17px; }
.ecat-qty--sm input { width: 30px; font-size: 14px; }

/* Tiroir */
.ecat-scrim { position: fixed; inset: 0; z-index: 9990; background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .3s; }
.ecat-scrim.is-open { opacity: 1; }
.ecat-drawer { position: fixed; z-index: 9991; top: 0; bottom: 0; inset-inline-end: 0; width: min(440px, 100%); background: var(--ecat-bg); color: var(--ecat-ink); display: flex; flex-direction: column; padding: calc(18px + env(safe-area-inset-top, 0px)) 24px calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(100%); transition: transform .35s cubic-bezier(.2, .7, .2, 1); font-family: var(--ecat-font); box-shadow: -20px 0 50px -30px rgba(0, 0, 0, .4); }
[dir="rtl"] .ecat-drawer { transform: translateX(-100%); }
.ecat-drawer.is-open { transform: none; }
.ecat-drawer__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block-end: 16px; border-block-end: 1px solid var(--ecat-line); }
.ecat-drawer__head h2 { margin: 0; font: 400 26px/1.15 var(--ecat-title-font); color: var(--ecat-ink); }
.ecat-drawer__x { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--ecat-line); background: var(--ecat-bg); color: var(--ecat-ink); font-size: 24px; line-height: 1; cursor: pointer; }
.ecat-drawer__ok { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--ecat-soft); font-weight: 600; font-size: 14px; }
.ecat-drawer__ok::before { content: "✓ "; }
.ecat-drawer__list { flex: 1; overflow-y: auto; padding-block: 16px; overscroll-behavior: contain; }
.ecat-empty { color: var(--ecat-muted); text-align: center; padding: 40px 10px; margin: 0; }
.ecat-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.ecat-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: start; transition: opacity .2s; }
.ecat-item.is-busy { opacity: .45; pointer-events: none; }
.ecat-item__img img { width: 72px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--ecat-soft); display: block; }
.ecat-item__body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.ecat-item__name { font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--ecat-ink); text-decoration: none; }
.ecat-item__body small { color: var(--ecat-muted); font-size: 13px; }
.ecat-item__remove { border: 0; background: none; padding: 0; margin-block-start: 4px; color: var(--ecat-muted); font-size: 12.5px; text-decoration: underline; cursor: pointer; }
.ecat-drawer__foot { display: grid; gap: 10px; padding-block-start: 16px; border-block-start: 1px solid var(--ecat-line); }
.ecat-btn { display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: var(--ecat-radius); font: 600 16px var(--ecat-font); text-decoration: none; cursor: pointer; border: 1.5px solid var(--ecat-accent); }
.ecat-btn--primary { background: var(--ecat-accent); color: var(--ecat-accent-ink); }
.ecat-btn--primary[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.ecat-btn--ghost { background: var(--ecat-bg); color: var(--ecat-accent); }
.ecat-drawer__extra { text-align: center; font-size: 14px; color: var(--ecat-accent); }
.ecat-drawer__note { margin: 0; text-align: center; font-size: 13px; color: var(--ecat-muted); }

/* Confirmation */
.ecat-extra { list-style: none; padding: 0; margin: 16px 0 0; }

@media (prefers-reduced-motion: reduce) { .ecat-drawer, .ecat-scrim { transition: none; } }
