/* ── Miledis — design minimal, fond blanc ─────────────────────────────────── */

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #767676;
  --border: #e6e6e6;
  --accent: #b3401f;
  --accent-dark: #8f3118;
  --sold: #a3a3a3;
  --radius: 6px;
  --max-width: 1100px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; display: block; }

/* ── Navigation ─────────────────────────────────────────────────────────── */

.navbar {
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
}

.nav-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: block;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 12px 0 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: 15px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.lang-select {
  width: auto;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.lang-select:hover { color: var(--text); border-color: var(--text); }

/* ── Contenu ────────────────────────────────────────────────────────────── */

.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
}

.page-intro {
  color: var(--text-muted);
  margin: 0 0 28px;
  max-width: 60ch;
}

/* ── Filtres catégories & tags ─────────────────────────────────────────── */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-pill {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-muted);
}

.filter-pill:hover {
  border-color: var(--text);
  color: var(--text);
}

.filter-pill.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.tag-filters {
  margin-bottom: 28px;
}

.tag-pill {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-block;
}

.tag-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Grille d'articles ─────────────────────────────────────────────────── */

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px 20px;
}

.item-card {
  display: block;
}

.item-card-img {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f4f4f4;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.item-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 2px;
}

.item-card-price {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

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

/* ── Page article ───────────────────────────────────────────────────────── */

.item-detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
}

@media (max-width: 760px) {
  .item-detail { grid-template-columns: 1fr; }
}

.item-gallery-main {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f4f4f4;
  margin-bottom: 10px;
}

.item-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-gallery-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.item-gallery-thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.item-category-tag {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.item-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 10px;
}

.item-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.item-condition {
  display: inline-block;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.item-description {
  white-space: pre-line;
  margin-bottom: 20px;
}

.item-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.sold-banner {
  display: inline-block;
  background: var(--sold);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  margin-bottom: 18px;
}

/* ── Boutons / formulaires ─────────────────────────────────────────────── */

.btn {
  display: inline-block;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover { background: #000; }

.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }

.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover { border-color: var(--text); }

.btn-small { padding: 7px 14px; font-size: 13px; }

.btn-danger { background: #b3401f; }

form { margin: 0; }

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

textarea { resize: vertical; min-height: 110px; }

input[type="file"] {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  width: 100%;
  font-size: 14px;
}

.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 160px; }

.error-box {
  background: #fbeae6;
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 14px;
}

/* ── Login admin ────────────────────────────────────────────────────────── */

.login-box {
  max-width: 340px;
  margin: 60px auto;
}

/* ── Admin ──────────────────────────────────────────────────────────────── */

.admin-bar {
  background: #1a1a1a;
  color: #fff;
}

.admin-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-bar a { color: #fff; opacity: 0.85; font-size: 14px; margin-right: 20px; }
.admin-bar a:hover { opacity: 1; }
.admin-bar a.active { opacity: 1; font-weight: 600; }

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #f4f4f4;
}

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.badge-sold { background: #eee; color: var(--text-muted); }
.badge-live { background: #e8f5e9; color: #2e7d32; }
.badge-pending { background: #fff3e0; color: #e67e22; }
.badge-paid { background: #e8f5e9; color: #2e7d32; }
.badge-shipped { background: #e3f2fd; color: #1565c0; }
.badge-cancelled { background: #fbeae6; color: var(--accent-dark); }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.photo-manager {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.photo-manager-item {
  position: relative;
  width: 90px;
}

.photo-manager-item img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.photo-manager-item form {
  margin-top: 4px;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-nav a { margin-left: 16px; }
.footer-nav a:hover { color: var(--text); }

/* ── Confirmation ───────────────────────────────────────────────────────── */

.confirmation-box {
  text-align: center;
  padding: 60px 20px;
}

.confirmation-icon {
  font-size: 42px;
  margin-bottom: 16px;
}
