/* -------------------------------------------------------
   PMG Graphique — Unified CSS (Cards + Categories + Modal)
   Goal: clean, no conflicts, stable layout
-------------------------------------------------------- */

/* ---------- Base wrapper ---------- */
.pmg-reservation-wrap{
  max-width:1200px;
  margin:24px auto;
  padding:16px;
  background:#fff;
  border-radius:18px;
  border:1px solid #e9edf3;
  box-shadow:0 10px 28px rgba(0,0,0,.05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  color:#0f172a;
}

.pmg-title{
  margin:6px 0 14px;
  font-size:22px;
  font-weight:900;
  color:#0f172a;
  letter-spacing:-.2px;
}

.pmg-loader{
  padding:18px;
  text-align:center;
  color:#475569;
  font-weight:800;
}

/* ---------- Responsive container tweaks ---------- */
@media (max-width: 640px){
  .pmg-reservation-wrap{ padding:14px; margin:14px auto; }
  .pmg-title{ font-size:20px; }
}

/* -------------------------------------------------------
   CATEGORIES VIEW (renderTarifsGrouped)
-------------------------------------------------------- */

.pmg-services{
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* Category block */
.pmg-cat-block{
  border:1px solid #e6edf5;
  background:#fff;
  border-radius:16px;
  padding:12px;
  box-shadow:0 6px 18px rgba(0,0,0,.04);
}

/* Header (image + titles) */
.pmg-cat-head{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:10px;
}

.pmg-cat-img{
  width:64px;
  height:64px;
  border-radius:14px;
  background-size:cover;
  background-position:center;
  border:1px solid #e6edf5;
  flex:0 0 auto;
  background-color:#f8fafc;
}

.pmg-cat-meta{
  min-width:0;
  display:flex;
  flex-direction:column;
}

.pmg-cat-title{
  font-weight:1000;
  color:#0f172a;
  font-size:16px;
  line-height:1.2;
}

.pmg-cat-sub{
  color:#64748b;
  font-weight:800;
  font-size:12px;
  margin-top:2px;
}

/* Grid of service cards inside a category */
.pmg-cat-grid{
  display:grid;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:10px;
  align-items:stretch;
}

@media (max-width: 1100px){
  .pmg-cat-grid{ grid-template-columns:repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px){
  .pmg-cat-grid{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .pmg-cat-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

/* -------------------------------------------------------
   SERVICE CARD (used inside category grid)
-------------------------------------------------------- */

.pmg-service-card{
  position:relative;
  padding:12px;
  border-radius:14px;
  background:#f7f9fc;
  border:1px solid #e6edf5;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  overflow:hidden;
  min-height:138px;
  display:flex;
  flex-direction:column;
}

.pmg-service-card::before{
  content:"";
  position:absolute;
  left:0;
  top:10px;
  bottom:10px;
  width:4px;
  border-radius:999px;
  background:#22c55e;
  opacity:.18;
}

.pmg-service-card:hover{
  transform: translateY(-2px);
  border-color:#d7e3ef;
  box-shadow:0 12px 24px rgba(0,0,0,.07);
}

.pmg-service-card.is-selected{
  border-color: rgba(34,197,94,.55);
  box-shadow:0 0 0 3px rgba(34,197,94,.12);
}

.pmg-service-card h3{
  margin:0 0 6px;
  font-size:13px;
  font-weight:900;
  color:#0f172a;
  line-height:1.25;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.pmg-service-card p{
  margin:0 0 8px;
  color:#334155;
  font-size:12px;
  line-height:1.45;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* Price pill */
.pmg-price{
  margin-top:auto;
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:900;
  color:#0f172a;
  padding:7px 10px;
  border-radius:999px;
  background:#ffffff;
  border:1px solid #e6edf5;
  width:fit-content;
}

.pmg-price::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:999px;
  background:#22c55e;
  opacity:.9;
}

/* Buttons */
.pmg-btn-primary{
  margin-top:10px;
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid #dbe7f3;
  background:#ffffff;
  color:#0f172a;
  font-weight:900;
  font-size:12px;
  cursor:pointer;
  transition:transform .12s ease, opacity .2s ease, background .2s ease;
}

.pmg-btn-primary:hover{
  opacity:.95;
  transform: translateY(-1px);
}

.pmg-btn-primary:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
}

.pmg-btn-secondary{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #dbe7f3;
  background:#f8fafc;
  color:#0f172a;
  font-weight:900;
  cursor:pointer;
}

.pmg-btn-danger{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(239,68,68,.35);
  background: rgba(239,68,68,.12);
  color:#7f1d1d;
  font-weight:900;
  cursor:pointer;
}

.pmg-btn-danger-outline{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(239,68,68,.35);
  background:#fff;
  color:#7f1d1d;
  font-weight:900;
  cursor:pointer;
}

.pmg-btn-secondary:hover{ background:#eef2f7; }
.pmg-btn-danger:hover{ background: rgba(239,68,68,.16); }
.pmg-btn-danger-outline:hover{ background: rgba(239,68,68,.08); }

/* -------------------------------------------------------
   MODAL
-------------------------------------------------------- */

body.pmg-modal-open{ overflow:hidden; }

.pmg-modal{ display:none; }
.pmg-modal.is-open{ display:block; }

.pmg-modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  z-index:9998;
}

.pmg-modal-card{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  width:min(780px, calc(100% - 26px));
  max-height:calc(100% - 26px);
  overflow:auto;
  background:#ffffff;
  border-radius:18px;
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  z-index:9999;
}

/* Use only ONE header style: .pmg-modal-head */
.pmg-modal-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  padding:16px 16px 10px;
  border-bottom:1px solid #eef2f7;
}

.pmg-modal-title{
  margin:0;
  font-size:18px;
  font-weight:1000;
  color:#0f172a;
}

.pmg-modal-sub{
  margin-top:6px;
  color:#334155;
  font-weight:800;
  font-size:13px;
}

.pmg-modal-x{
  border:none;
  background:transparent;
  font-size:18px;
  cursor:pointer;
  color:#0f172a;
  padding:6px 8px;
  border-radius:10px;
}

.pmg-modal-x:hover{ background:#f1f5f9; }

.pmg-modal-body{
  padding:14px 16px 10px;
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

/* Selected bar (top helper text) */
.pmg-selected-bar{
  border:1px solid #e6edf5;
  background:#fff;
  border-radius:14px;
  padding:10px 12px;
  font-weight:900;
  color:#0f172a;
}

/* Selected list */
.pmg-selected-list{
  border:1px solid #e6edf5;
  background:#f8fafc;
  border-radius:14px;
  padding:12px;
}

.pmg-empty-selected{
  color:#475569;
  font-weight:800;
  padding:10px 0;
}

.pmg-selected-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px;
  border-radius:12px;
  border:1px solid #e6edf5;
  background:#fff;
  margin-bottom:8px;
}

.pmg-selected-row.is-current{
  border-color: rgba(34,197,94,.55);
  box-shadow:0 0 0 3px rgba(34,197,94,.10);
}

.pmg-selected-name{
  font-weight:1000;
  color:#0f172a;
  font-size:13px;
}

.pmg-selected-price{
  color:#334155;
  font-weight:900;
  font-size:12px;
  margin-top:3px;
}

.pmg-mini-btn{
  border:1px solid #dbe7f3;
  background:#f8fafc;
  color:#0f172a;
  font-weight:900;
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}

.pmg-mini-btn:hover{ background:#eef2f7; }

/* Total row */
.pmg-total-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid #e6edf5;
  background:#fff;
  border-radius:14px;
}

#pmg-total{
  font-weight:1000;
  color:#0f172a;
}

/* Modal actions */
.pmg-modal-actions{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:12px 0 0;
}

@media (max-width: 640px){
  .pmg-modal-actions{ flex-direction:column; }
  .pmg-btn-secondary,
  .pmg-btn-danger,
  .pmg-btn-danger-outline{ width:100%; }
}

/* -------------------------------------------------------
   FORM (inside modal)
-------------------------------------------------------- */

.pmg-form{
  border:1px solid #e6edf5;
  background:#ffffff;
  border-radius:14px;
  padding:12px;
}

.pmg-required{ color:#ef4444; }

.pmg-form label{
  display:block;
  margin-top:10px;
  font-weight:900;
  font-size:12px;
  color:#0f172a;
}

.pmg-form input,
.pmg-form textarea{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid #e6edf5;
  margin-top:6px;
  background:#f8fafc;
  color:#0f172a;
  outline:none;
}

.pmg-form input::placeholder,
.pmg-form textarea::placeholder{ color:#64748b; }

.pmg-form input:focus,
.pmg-form textarea:focus{
  border-color: rgba(34,197,94,.55);
  box-shadow:0 0 0 4px rgba(34,197,94,.12);
  background:#ffffff;
}

.pmg-form textarea{
  min-height:90px;
  resize:vertical;
}

.pmg-note{
  margin-top:10px;
  font-size:12px;
  color:#475569;
  opacity:.95;
}

/* Submit button (specific override for #pmg-submit only) */
#pmg-submit.pmg-btn-primary{
  margin-top:14px;
  border:none;
  background:#22c55e;
  color:#08210f;
  font-size:14px;
  font-weight:1000;
  padding:12px 14px;
  border-radius:14px;
}

#pmg-submit.pmg-btn-primary:hover{ background:#16a34a; }

/* -------------------------------------------------------
   UPLOAD PER LINE
-------------------------------------------------------- */

.pmg-upload-per-line{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:8px;
}

.pmg-upload-line{
  border:1px solid #e6edf5;
  background:#f8fafc;
  border-radius:12px;
  padding:10px;
}

.pmg-upload-line-title{
  font-weight:1000;
  color:#0f172a;
  font-size:12px;
  margin-bottom:8px;
}
