/* ================================================================
   Ernst Beier – Catalogue des biens
   ================================================================ */

:root {
  --ebb-gold:       #b8962e;
  --ebb-gold-light: #d4af5a;
  --ebb-dark:       #1a1a2e;
  --ebb-dark2:      #16213e;
  --ebb-text:       #2d2d2d;
  --ebb-muted:      #6b7280;
  --ebb-border:     #e5e7eb;
  --ebb-bg:         #f8f8f5;
  --ebb-white:      #ffffff;
  --ebb-radius:     12px;
  --ebb-shadow:     0 4px 24px rgba(0,0,0,.10);
  --ebb-shadow-hov: 0 8px 40px rgba(0,0,0,.18);
  --ebb-trans:      .25s ease;
}

/* App wrapper */
.ebb-app {
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--ebb-text);
  background: var(--ebb-bg);
  padding: 24px 0;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.ebb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding: 18px 24px;
  background: var(--ebb-white);
  border-radius: var(--ebb-radius);
  box-shadow: var(--ebb-shadow);
}

.ebb-search-wrap {
  position: relative;
  flex: 1 1 220px;
}
.ebb-icon-search {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  stroke: var(--ebb-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
#ebb-search {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1.5px solid var(--ebb-border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  background: var(--ebb-bg);
  color: var(--ebb-text);
  transition: border-color var(--ebb-trans);
  box-sizing: border-box;
}
#ebb-search:focus {
  outline: none;
  border-color: var(--ebb-gold);
}

.ebb-filters {
  display: flex;
  gap: 8px;
}
.ebb-filter {
  padding: 8px 18px;
  border: 1.5px solid var(--ebb-border);
  border-radius: 50px;
  background: transparent;
  font-family: inherit;
  font-size: .88rem;
  letter-spacing: .04em;
  cursor: pointer;
  color: var(--ebb-muted);
  transition: all var(--ebb-trans);
}
.ebb-filter:hover,
.ebb-filter.active {
  background: var(--ebb-gold);
  border-color: var(--ebb-gold);
  color: var(--ebb-white);
}

.ebb-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  font-size: .82rem;
  color: var(--ebb-muted);
}
#ebb-refresh-status {
  display: flex;
  align-items: center;
  gap: 5px;
}
#ebb-refresh-status::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: ebb-pulse 2s infinite;
}
@keyframes ebb-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* ── Grid ────────────────────────────────────────────────────── */
.ebb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 1024px) { .ebb-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .ebb-grid { grid-template-columns: 1fr; } }

/* ── Card ────────────────────────────────────────────────────── */
.ebb-card {
  background: var(--ebb-white);
  border-radius: var(--ebb-radius);
  box-shadow: var(--ebb-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--ebb-trans), box-shadow var(--ebb-trans);
  display: flex;
  flex-direction: column;
}
.ebb-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ebb-shadow-hov);
}

.ebb-card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #e5e7eb;
}
.ebb-card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
  display: block;
}
.ebb-card:hover .ebb-card-img-wrap img {
  transform: scale(1.06);
}

.ebb-card-badge {
  position: absolute;
  top: 14px; left: 14px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  z-index: 2;
}
.ebb-badge-sale { background: var(--ebb-gold);  color: var(--ebb-white); }
.ebb-badge-rent { background: var(--ebb-dark2); color: var(--ebb-white); }
.ebb-badge-other { background: var(--ebb-muted); color: var(--ebb-white); }

.ebb-card-photo-count {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: .78rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ebb-card-photo-count svg {
  width: 14px; height: 14px;
  fill: none; stroke: #fff; stroke-width: 2;
}

.ebb-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.ebb-card-price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ebb-gold);
  letter-spacing: -.01em;
}

.ebb-card-title {
  font-size: .98rem;
  font-weight: 600;
  color: var(--ebb-dark);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ebb-card-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .84rem;
  color: var(--ebb-muted);
}
.ebb-card-location svg {
  width: 14px; height: 14px;
  fill: none; stroke: var(--ebb-muted); stroke-width: 2;
  flex-shrink: 0;
}

.ebb-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--ebb-border);
}
.ebb-spec {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  color: var(--ebb-muted);
}
.ebb-spec svg {
  width: 15px; height: 15px;
  fill: none; stroke: var(--ebb-muted); stroke-width: 2;
  flex-shrink: 0;
}

/* ── Loading ─────────────────────────────────────────────────── */
.ebb-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 64px;
  color: var(--ebb-muted);
}
.ebb-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--ebb-border);
  border-top-color: var(--ebb-gold);
  border-radius: 50%;
  animation: ebb-spin .8s linear infinite;
}
@keyframes ebb-spin { to { transform: rotate(360deg); } }

.ebb-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px;
  color: var(--ebb-muted);
  font-size: 1.05rem;
}

/* ── Pagination ───────────────────────────────────────────────── */
.ebb-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.ebb-page-btn {
  width: 40px; height: 40px;
  border: 1.5px solid var(--ebb-border);
  border-radius: 8px;
  background: var(--ebb-white);
  font-family: inherit;
  font-size: .92rem;
  cursor: pointer;
  color: var(--ebb-text);
  transition: all var(--ebb-trans);
  display: flex; align-items: center; justify-content: center;
}
.ebb-page-btn:hover { border-color: var(--ebb-gold); color: var(--ebb-gold); }
.ebb-page-btn.active {
  background: var(--ebb-gold);
  border-color: var(--ebb-gold);
  color: var(--ebb-white);
  font-weight: 700;
}
.ebb-page-btn:disabled { opacity: .4; cursor: not-allowed; }
.ebb-page-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ── Modal ───────────────────────────────────────────────────── */
.ebb-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px;
}
.ebb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
}
.ebb-modal-box {
  position: relative;
  background: var(--ebb-white);
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  z-index: 2;
  overflow: hidden;
  margin: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.ebb-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 10;
  width: 38px; height: 38px;
  background: rgba(255,255,255,.92);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--ebb-trans);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.ebb-modal-close:hover { background: var(--ebb-gold); }
.ebb-modal-close:hover svg { stroke: #fff; }
.ebb-modal-close svg { width: 20px; height: 20px; stroke: var(--ebb-dark); stroke-width: 2.5; fill: none; }

/* Detail layout */
.ebb-detail { display: flex; flex-direction: column; }

/* Gallery strip */
.ebb-detail-gallery {
  position: relative;
  background: #111;
}
.ebb-detail-hero {
  position: relative;
  aspect-ratio: 16/8;
  overflow: hidden;
  cursor: zoom-in;
}
.ebb-detail-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
  display: block;
}
.ebb-detail-hero:hover img { transform: scale(1.03); }

.ebb-detail-hero-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  pointer-events: none;
}
.ebb-hero-prev,
.ebb-hero-next {
  pointer-events: all;
  width: 42px; height: 42px;
  background: rgba(255,255,255,.88);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  transition: background var(--ebb-trans);
}
.ebb-hero-prev:hover,
.ebb-hero-next:hover { background: var(--ebb-gold); }
.ebb-hero-prev:hover svg,
.ebb-hero-next:hover svg { stroke: #fff; }
.ebb-hero-prev svg,
.ebb-hero-next svg { width: 20px; height: 20px; fill: none; stroke: var(--ebb-dark); stroke-width: 2.5; }

.ebb-hero-counter {
  position: absolute;
  bottom: 14px; right: 14px;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: .82rem;
}

.ebb-detail-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 8px;
  overflow-x: auto;
  background: #1a1a1a;
  scrollbar-width: thin;
  scrollbar-color: var(--ebb-gold) transparent;
}
.ebb-detail-thumbs::-webkit-scrollbar { height: 4px; }
.ebb-detail-thumbs::-webkit-scrollbar-thumb { background: var(--ebb-gold); }

.ebb-thumb {
  flex-shrink: 0;
  width: 80px; height: 60px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  opacity: .6;
  transition: opacity var(--ebb-trans), transform var(--ebb-trans);
  border: 2px solid transparent;
}
.ebb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ebb-thumb:hover,
.ebb-thumb.active { opacity: 1; transform: scale(1.05); border-color: var(--ebb-gold); }

/* Detail body */
.ebb-detail-body {
  padding: 28px 32px 36px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
}
@media (max-width: 720px) { .ebb-detail-body { grid-template-columns: 1fr; padding: 20px; } }

.ebb-detail-main {}

.ebb-detail-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.ebb-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ebb-dark);
  line-height: 1.3;
  margin: 0 0 8px;
}
.ebb-detail-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ebb-muted);
  font-size: .9rem;
  margin-bottom: 20px;
}
.ebb-detail-location svg { width: 16px; height: 16px; fill: none; stroke: var(--ebb-muted); stroke-width: 2; }

.ebb-detail-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
  padding: 18px;
  background: var(--ebb-bg);
  border-radius: 10px;
  margin-bottom: 20px;
}
.ebb-detail-spec {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--ebb-text);
}
.ebb-detail-spec svg {
  width: 18px; height: 18px;
  fill: none; stroke: var(--ebb-gold); stroke-width: 2;
  flex-shrink: 0;
}
.ebb-detail-spec span { color: var(--ebb-muted); }

.ebb-detail-desc {
  font-size: .9rem;
  line-height: 1.75;
  color: var(--ebb-text);
  white-space: pre-line;
}
.ebb-detail-desc h4 {
  font-size: 1rem;
  color: var(--ebb-dark);
  margin: 0 0 8px;
}

/* Sidebar */
.ebb-detail-sidebar {
  background: var(--ebb-bg);
  border-radius: 12px;
  padding: 24px;
  align-self: start;
  border: 1.5px solid var(--ebb-border);
}
.ebb-detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ebb-gold);
  margin-bottom: 4px;
}
.ebb-detail-ref {
  font-size: .78rem;
  color: var(--ebb-muted);
  margin-bottom: 20px;
}
.ebb-detail-contact-btn {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--ebb-gold);
  color: var(--ebb-white);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background var(--ebb-trans);
  margin-bottom: 10px;
  box-sizing: border-box;
}
.ebb-detail-contact-btn:hover { background: #9a7a1e; }

.ebb-detail-info-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ebb-detail-info-item {
  display: flex;
  justify-content: space-between;
  font-size: .84rem;
  border-bottom: 1px solid var(--ebb-border);
  padding-bottom: 8px;
}
.ebb-detail-info-label { color: var(--ebb-muted); }
.ebb-detail-info-value { font-weight: 600; color: var(--ebb-dark); }

/* ── Lightbox ─────────────────────────────────────────────────── */
.ebb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ebb-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.96);
}
.ebb-lightbox-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 95vw;
  max-height: 80vh;
}
.ebb-lb-stage {
  position: relative;
  max-width: 80vw;
  max-height: 80vh;
}
#ebb-lb-img {
  max-width: 80vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  transition: opacity .25s;
}
.ebb-lb-counter {
  position: absolute;
  bottom: -28px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.65);
  font-size: .82rem;
  white-space: nowrap;
}
.ebb-lb-prev,
.ebb-lb-next {
  width: 50px; height: 50px;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--ebb-trans);
}
.ebb-lb-prev:hover,
.ebb-lb-next:hover { background: var(--ebb-gold); border-color: var(--ebb-gold); }
.ebb-lb-prev svg,
.ebb-lb-next svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.5; }
.ebb-lb-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 10;
  width: 44px; height: 44px;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--ebb-trans);
}
.ebb-lb-close:hover { background: var(--ebb-gold); border-color: var(--ebb-gold); }
.ebb-lb-close svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.5; }

.ebb-lb-thumbs {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  max-width: 90vw;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--ebb-gold) transparent;
}
.ebb-lb-thumbs::-webkit-scrollbar { height: 4px; }
.ebb-lb-thumbs::-webkit-scrollbar-thumb { background: var(--ebb-gold); }
.ebb-lb-thumb {
  flex-shrink: 0;
  width: 72px; height: 52px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  opacity: .5;
  border: 2px solid transparent;
  transition: opacity var(--ebb-trans), border-color var(--ebb-trans);
}
.ebb-lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ebb-lb-thumb:hover,
.ebb-lb-thumb.active { opacity: 1; border-color: var(--ebb-gold); }

/* ── Formulaire demande de dossier ───────────────────────────── */
.ebb-contact-modal {
  position: fixed;
  inset: 0;
  z-index: 300000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ebb-contact-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
}
.ebb-contact-box {
  position: relative;
  background: var(--ebb-white);
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  z-index: 2;
  padding: 36px 36px 28px;
  box-shadow: 0 28px 90px rgba(0,0,0,.35);
}
@media (max-width: 600px) { .ebb-contact-box { padding: 24px 18px 20px; } }

.ebb-contact-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  background: var(--ebb-bg);
  border: none; border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--ebb-trans);
}
.ebb-contact-close:hover { background: #fce4e4; }
.ebb-contact-close svg { width: 16px; height: 16px; }

.ebb-cf-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}
.ebb-cf-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--ebb-gold), var(--ebb-gold-light));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.ebb-cf-icon svg { width: 24px; height: 24px; stroke: #fff; }
.ebb-cf-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ebb-dark);
}
.ebb-cf-subtitle {
  margin: 0;
  font-size: .83rem;
  color: var(--ebb-gold);
  font-weight: 600;
}

.ebb-cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 480px) { .ebb-cf-row { grid-template-columns: 1fr; } }

.ebb-cf-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ebb-cf-field label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ebb-text);
  letter-spacing: .02em;
}
.ebb-cf-field label span { color: var(--ebb-gold); }
.ebb-cf-field input {
  padding: 10px 13px;
  border: 1.5px solid var(--ebb-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .92rem;
  color: var(--ebb-text);
  background: var(--ebb-bg);
  transition: border-color var(--ebb-trans), box-shadow var(--ebb-trans);
}
.ebb-cf-field input:focus {
  outline: none;
  border-color: var(--ebb-gold);
  box-shadow: 0 0 0 3px rgba(184,150,46,.12);
}
.ebb-cf-field input::placeholder { color: #bbb; }

.ebb-cf-msg {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 14px;
}
.ebb-cf-success { background: #f0faf4; color: #166534; border: 1px solid #bbf7d0; }
.ebb-cf-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.ebb-cf-submit {
  width: 100%;
  padding: 14px;
  background: var(--ebb-gold);
  color: var(--ebb-white);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .02em;
  transition: background var(--ebb-trans), transform .15s;
  margin-top: 4px;
}
.ebb-cf-submit:hover:not(:disabled) { background: #9a7a1e; transform: translateY(-1px); }
.ebb-cf-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.ebb-cf-legal {
  margin: 14px 0 0;
  font-size: .74rem;
  color: var(--ebb-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Utilities ───────────────────────────────────────────────── */
body.ebb-no-scroll { overflow: hidden; }
.ebb-fade-in { animation: ebb-fadein .35s ease; }
@keyframes ebb-fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
