/* ── PILL BUTTONS ── */
.pill-btn {
  border-radius: 20px;
  border: 2px solid #2e1f0a;
  background: transparent;
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 18px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  color: #2e1f0a;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.pill-btn:hover { background: rgba(46,31,10,0.08); }
.pill-btn.active { background: #c9952a; border-color: #a07020; color: #fff; }
.pill-btn.gold { background: #c9952a; border-color: #a07020; color: #fff; }
.pill-btn.gold:hover { background: #e8b84b; }
.pill-btn.teal { background: #1a6e6e; border-color: #145454; color: #fff; font-size: 15px; }
.pill-btn.teal:hover { background: #22908f; }
.pill-btn.red { background: #a83228; border-color: #7a2018; color: #fff; font-size: 15px; }
.pill-btn.red:hover { background: #c93c30; }

/* ── TOOLBAR ── */
.pv-toolbar {
  background: #d4c4a0;
  border-top: 1px solid rgba(201,149,42,0.3);
  border-bottom: 2px dashed rgba(46,31,10,0.2);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.pv-toolbar-spacer { flex: 1; }
.pv-filter-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pv-filter-btns { display: flex; gap: 7px; }

/* ── 3 COLONNES ── */
.pv-grid {
  flex: 1;
  display: grid;
  overflow: hidden;
  min-height: 0;
  grid-template-columns: 44% 1fr 150px;
  background: #e8dcc8;
}

/* ── COL 1 : PHOTO ── */
.pv-photo-col {
  display: flex;
  flex-direction: column;
  padding: 14px 16px 31px 16px;
  border-right: 2px dashed rgba(46,31,10,0.2);
  overflow: hidden;
  gap: 10px;
}
.pv-photo-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}
.pv-photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  max-height: 100%;
  border: 2px solid rgba(46,31,10,0.25);
  border-radius: 4px;
  background: #0e0a04;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pv-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.pv-arrow {
  background: rgba(46,31,10,0.08);
  border: 1px solid rgba(201,149,42,0.3);
  color: #c9952a;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background .15s;
  text-decoration: none;
  flex-shrink: 0;
}
.pv-arrow:hover { background: rgba(201,149,42,0.3); }
.pv-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.pv-counter {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: #c9952a;
  letter-spacing: 1px;
  margin: 0 17px;
}

/* ── COL 2 : INFOS ── */
.pv-info-col {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  border-right: 2px dashed rgba(46,31,10,0.2);
  overflow: hidden;
  gap: 12px;
}
.pv-info-card {
  border: 2px solid rgba(46,31,10,0.25);
  border-radius: 6px;
  background: rgba(255,255,255,0.35);
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.pv-info-header {
  padding: 16px 18px 12px;
  border-bottom: 1.5px dashed rgba(46,31,10,0.15);
  flex-shrink: 0;
}
.pv-info-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 600;
  color: #2e1f0a;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  line-height: 1.25;
}
.pv-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.pv-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #7a5c30;
  font-size: 14.5px;
  font-style: italic;
  font-family: 'Crimson Pro', serif;
}
.pv-info-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}
.pv-info-body p {
  font-size: 16.5px;
  line-height: 1.8;
  color: #3a2a10;
  font-style: italic;
  font-family: 'Crimson Pro', serif;
  overflow-wrap: break-word;
  word-break: break-word;
}
.pv-info-public {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #9e8060;
  text-transform: uppercase;
  padding: 0 18px 12px;
}
.pv-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
.pv-actions .pill-btn {
  flex: 1;
  justify-content: center;
  border-radius: 10px;
  padding: 11px 0;
  gap: 8px;
}
.pv-actions form { flex: 1; display: flex; }
.pv-actions form .pill-btn { width: 100%; }

/* ── COL 3 : CAROUSEL ── */
.pv-carousel {
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  background: #d4c4a0;
  overflow: hidden;
}
.pv-carousel-inner {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.pv-thumbnail {
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid rgba(46,31,10,0.2);
  height: 83px;
  position: relative;
  transition: all .18s;
  opacity: 0.6;
}
.pv-thumbnail:hover { opacity: 0.9; }
.pv-thumbnail.selected {
  border: 2.5px solid #c9952a;
  box-shadow: 0 0 10px rgba(201,149,42,0.35), inset 0 0 0 1px rgba(201,149,42,0.2);
  opacity: 1;
}
.pv-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pv-thumbnail-check {
  display: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(201,149,42,0.3), transparent 60%);
}
.pv-thumbnail-check span {
  position: absolute;
  bottom: 4px;
  right: 6px;
  color: #c9952a;
  font-size: 14px;
  font-weight: 700;
}
.pv-thumbnail.selected .pv-thumbnail-check { display: block; }
.pv-thumbnail-frame {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 2;
}
.pv-thumbnail.is-step-pic .pv-thumbnail-frame { display: block; }

/* ── MOBILE ── */
@media (max-width: 700px) {
  .pv-toolbar {
    flex-wrap: wrap;
    padding: 6px 12px;
    gap: 0;
    row-gap: 0;
  }
  .pv-toolbar-spacer { display: none; }

  /* Groupe 1 : bouton retour — ligne entière */
  .pv-toolbar > .pill-btn:first-child {
    width: 100%;
    justify-content: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(46,31,10,0.2);
    margin-bottom: 8px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  /* Groupe 2 : filtres — ligne entière */
  .pv-filter-zone {
    width: 100%;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(46,31,10,0.2);
    margin-bottom: 8px;
  }
  .pv-filter-btns { flex-wrap: wrap; justify-content: center; gap: 6px; }

  /* Groupe 3 : boutons d'ajout — centrés */
  .pv-toolbar > .pill-btn.gold {
    flex: 1;
    justify-content: center;
  }

  .pv-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .pv-photo-col {
    border-right: none;
    border-bottom: 2px dashed rgba(46,31,10,0.2);
    max-height: 42vh;
    padding: 10px 12px;
  }

  .pv-info-col {
    border-right: none;
    border-bottom: 2px dashed rgba(46,31,10,0.2);
    padding: 12px;
    overflow: visible;
  }

  .pv-info-card {
    flex: none;
    overflow: visible;
  }

  .pv-info-body {
    overflow: visible;
  }

  .pv-carousel {
    flex-direction: row;
    height: 110px;
    padding: 8px 10px;
    overflow: hidden;
  }

  .pv-carousel-inner {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    height: 100%;
  }

  .pv-thumbnail {
    width: 130px;
    height: 100%;
  }
}

/* ── MODAL ── */
#modal:not(:empty) {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: #e8dcc8;
  border: 2px solid rgba(201,149,42,0.4);
  border-radius: 10px;
  padding: 28px;
  width: 420px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: 'Crimson Pro', serif;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-close {
  color: #9e8060;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: #2e1f0a; background: rgba(46,31,10,0.08); }

.modal h2 {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  letter-spacing: 2px;
  color: #2e1f0a;
}
.modal label {
  font-size: 13px;
  color: #7a5c30;
  display: block;
  margin-bottom: 4px;
}
.modal input, .modal textarea, .modal select {
  width: 100%;
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  border: 1.5px solid rgba(46,31,10,0.3);
  border-radius: 6px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.5);
  color: #2e1f0a;
}

.modal textarea {
  padding: 7px 10px;
  min-height: 120px;
}
.modal .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.file-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.file-upload-name {
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  color: #7a5c30;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}