
/* MM Galería de Cuadros - Front */
.mmgc-wrap { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:#0f172a; }
.mmgc-panel, .mmgc-gallery { max-width: 1400px; margin: 18px auto; padding: 0 14px; }

.mmgc-alert { border:1px solid #e5e7eb; background:#fff; border-radius:12px; padding:12px 14px; margin: 12px 0; }
.mmgc-alert--ok { border-color:#bbf7d0; background:#f0fdf4; }
.mmgc-alert--warn { border-color:#fde68a; background:#fffbeb; }
.mmgc-alert--err { border-color:#fecaca; background:#fef2f2; }
.mmgc-alert ul { margin:0 0 0 18px; }

.mmgc-form label { display:block; font-weight:650; margin-bottom:6px; }
.mmgc-form input, .mmgc-form select { width:100%; padding:10px 12px; border:1px solid #cbd5e1; border-radius:10px; font-size:15px; background:#fff; }
.mmgc-form input:focus, .mmgc-form select:focus { outline: none; border-color:#2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }

.mmgc-btn { display:inline-flex; align-items:center; justify-content:center; border:1px solid #1d4ed8; background:#1d4ed8; color:#fff; padding:10px 14px; border-radius:12px; font-weight:650; cursor:pointer; }
.mmgc-btn:hover { filter: brightness(1.05); }
.mmgc-btn--ghost { background:transparent; color:#1d4ed8; }
.mmgc-hint { font-size:13px; color:#475569; margin-top:8px; }

.mmgc-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
@media (max-width: 780px) { .mmgc-grid { grid-template-columns: 1fr; } }

.mmgc-panel__header { display:flex; gap:12px; align-items:center; margin: 8px 0 12px; }

/* Gallery */
.mmgc-gallery__top { display:flex; gap:14px; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; margin-bottom: 12px; }
.mmgc-gallery__title h2 { margin:0; font-size:28px; letter-spacing:-0.02em; }
.mmgc-gallery__title p { margin:6px 0 0; color:#475569; }
.mmgc-gallery__filters { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.mmgc-gallery__filters select, .mmgc-gallery__filters input { width:auto; min-width: 220px; }

.mmgc-grid-cards { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 980px) { .mmgc-grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .mmgc-grid-cards { grid-template-columns: 1fr; } }

.mmgc-card { background:#fff; border:1px solid #e5e7eb; border-radius:16px; overflow:hidden; box-shadow: 0 8px 30px rgba(2, 6, 23, .05); }
.mmgc-card__btn { padding:0; margin:0; border:0; background:transparent; width:100%; text-align:left; cursor:pointer; }
.mmgc-card__img { width:100%; background:#f1f5f9; display:flex; align-items:center; justify-content:center; padding:10px; }
.mmgc-card__img img { max-width:100%; height:auto; max-height: 340px; object-fit:contain; display:block; }
.mmgc-card__img--ph { font-size:42px; color:#94a3b8; }
.mmgc-card__body { padding: 12px 12px 14px; }
.mmgc-card__head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.mmgc-card__head h3 { margin:0; font-size:18px; line-height:1.2; }
.mmgc-card__meta { margin:6px 0 0; color:#475569; font-size:14px; }
.mmgc-card__price { margin:10px 0 0; color:#0f172a; font-size:14px; }

.mmgc-dot { width:12px; height:12px; border-radius:50%; display:inline-block; border:2px solid rgba(15,23,42,.15); }
.mmgc-dot--disponible { background:#22c55e; border-color:#22c55e; }
.mmgc-dot--vendido { background:#ef4444; border-color:#ef4444; }
/* Compat: antiguo estado reservado -> disponible */
.mmgc-dot--reservado { background:#22c55e; border-color:#22c55e; }

/* Modal */
.mmgc-modal { position:fixed; inset:0; display:none; z-index:9999; }
.mmgc-modal.is-open { display:block; }
.mmgc-modal__backdrop { position:absolute; inset:0; background: rgba(2,6,23,.65); }
.mmgc-modal__dialog {
  position: relative;
  width: min(980px, calc(100% - 28px));
  margin: 14px auto;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  /* Prevent the modal from being taller than the viewport on mobile/tablet */
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
}
.mmgc-modal__close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827; /* ensure the X is visible even if theme styles buttons */
  font-size: 34px; /* big X */
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.mmgc-modal__close:hover { filter: brightness(0.98); }
.mmgc-modal__close:focus { outline: 2px solid rgba(33,83,135,.35); outline-offset: 2px; }
.mmgc-modal__content {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 0;
  /* Allow internal scrolling when content exceeds viewport height */
  overflow: auto;
}
@media (max-width: 860px) { .mmgc-modal__content { grid-template-columns: 1fr; } }

.mmgc-modal__img { background:#0b1220; display:flex; align-items:center; justify-content:center; }
.mmgc-modal__img img {
  width: 100%;
  height: auto;
  max-height: 74vh;
  object-fit: contain;
  display: block;
}

@media (max-width: 860px) {
  .mmgc-modal__dialog { width: calc(100% - 18px); margin: 9px auto; max-height: calc(100vh - 18px); }
  .mmgc-modal__img img { max-height: 48vh; }
}
.mmgc-modal__info { padding: 16px 16px 18px; }
.mmgc-modal__info h3 { margin:0 0 10px; font-size:22px; }
.mmgc-modal__row { display:flex; justify-content:space-between; gap:12px; padding:10px 0; border-top:1px solid #eef2f7; }
.mmgc-modal__row:first-of-type { border-top:0; }
.mmgc-label { color:#475569; font-weight:650; }
.mmgc-pill { display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px; background:#f1f5f9; font-weight:650; }
.mmgc-modal__price { }


/* Internal list table */
.mmgc-table-wrap { overflow:auto; border:1px solid #e5e7eb; border-radius:14px; background:#fff; }
.mmgc-table { width:100%; border-collapse:collapse; min-width: 1250px; }
.mmgc-table th, .mmgc-table td { padding:10px 10px; border-bottom:1px solid #eef2f7; vertical-align:middle; font-size:14px; }
.mmgc-table th { text-align:left; background:#f8fafc; position:sticky; top:0; z-index:1; }
.mmgc-table tr:hover td { background:#fbfdff; }

/* Keep important columns on one line (avoid ugly wraps like "1380" + "€" below) */
.mmgc-table th:nth-child(4), .mmgc-table td:nth-child(4),
.mmgc-table th:nth-child(6), .mmgc-table td:nth-child(6),
.mmgc-table th:nth-child(7), .mmgc-table td:nth-child(7),
.mmgc-table th:nth-child(8), .mmgc-table td:nth-child(8),
.mmgc-table th:nth-child(10), .mmgc-table td:nth-child(10) {
  white-space: nowrap;
}


.mmgc-btn--danger { border-color:#b91c1c; background:#b91c1c; color:#fff; }
.mmgc-btn--danger:hover { filter: brightness(1.05); }


/* Clean gallery card (image + title only) */
.mmgc-card__title { margin: 0; padding: 10px 12px 12px; font-size: 16px; line-height: 1.2; }
.mmgc-card__body { padding: 0; }


/* Edit row */
.mmgc-edit-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.mmgc-edit-grid label { display:block; font-weight:650; margin-bottom:6px; }
.mmgc-edit-grid input, .mmgc-edit-grid select { width:100%; padding:10px 12px; border:1px solid #cbd5e1; border-radius:10px; font-size:14px; background:#fff; }
@media (max-width: 980px) { .mmgc-edit-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .mmgc-edit-grid { grid-template-columns: 1fr; } }