/* Gráfica Magro — shared dialog and toast styles */

/* Minimal Bootstrap modal shim — only on pages without full Bootstrap CSS (landings). */
body.gm-dialog-no-bootstrap .modal {
  --bs-modal-zindex: 1400;
  --bs-modal-width: 500px;
  --bs-modal-padding: 1rem;
  --bs-modal-margin: 0.5rem;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--bs-modal-zindex);
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}
body.gm-dialog-no-bootstrap .modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right))
    max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
}
body.gm-dialog-no-bootstrap .modal-dialog {
  position: relative;
  width: 100%;
  max-width: min(var(--bs-modal-width), calc(100vw - 1rem));
  margin: 0;
  pointer-events: none;
}
body.gm-dialog-no-bootstrap .modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}
body.gm-dialog-no-bootstrap .modal.show .modal-dialog {
  transform: none;
}
body.gm-dialog-no-bootstrap .modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: 0;
}
body.gm-dialog-no-bootstrap .modal-dialog-scrollable {
  height: calc(100% - var(--bs-modal-margin) * 2);
}
body.gm-dialog-no-bootstrap .modal-dialog-scrollable .modal-content {
  max-height: 100%;
  overflow: hidden;
}
body.gm-dialog-no-bootstrap .modal-dialog-scrollable .modal-body {
  overflow-y: auto;
}
body.gm-dialog-no-bootstrap .modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-clip: padding-box;
  border-radius: 0.5rem;
  outline: 0;
}
body.gm-dialog-no-bootstrap .modal-content.gm-dialog-modal-content {
  background: var(--gm-dialog-surface);
  border: 1px solid var(--gm-dialog-accent);
  color: var(--gm-dialog-text);
}
body.gm-dialog-no-bootstrap .modal-backdrop {
  --bs-backdrop-zindex: 1390;
  --bs-backdrop-bg: #000;
  --bs-backdrop-opacity: 0.5;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--bs-backdrop-zindex);
  width: 100vw;
  height: 100vh;
  background-color: var(--bs-backdrop-bg);
}
body.gm-dialog-no-bootstrap .modal-backdrop.fade {
  opacity: 0;
}
body.gm-dialog-no-bootstrap .modal-backdrop.show {
  opacity: var(--bs-backdrop-opacity);
}
body.gm-dialog-no-bootstrap .modal-header,
body.gm-dialog-no-bootstrap .modal-footer {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  padding: var(--bs-modal-padding);
}
body.gm-dialog-no-bootstrap .modal-header {
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-top-left-radius: calc(0.5rem - 1px);
  border-top-right-radius: calc(0.5rem - 1px);
}
body.gm-dialog-no-bootstrap .modal-footer {
  justify-content: flex-end;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
body.gm-dialog-no-bootstrap .modal-title {
  margin-bottom: 0;
  line-height: 1.5;
  color: inherit;
}
body.gm-dialog-no-bootstrap .modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: var(--bs-modal-padding);
  color: inherit;
}
body.gm-dialog-no-bootstrap .btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em;
  color: #000;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0;
  border-radius: 0.375rem;
  opacity: 0.5;
  cursor: pointer;
}
body.gm-dialog-no-bootstrap .btn-close-white {
  filter: invert(1) grayscale(100%) brightness(200%);
}
body.gm-dialog-no-bootstrap .btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  cursor: pointer;
}
body.gm-dialog-no-bootstrap .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
}
body.gm-dialog-no-bootstrap .btn-primary {
  color: #fff;
  background-color: #e65297;
  border-color: #e65297;
}
body.gm-dialog-no-bootstrap .btn-danger {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}
body.gm-dialog-no-bootstrap .btn-outline-secondary {
  color: #d1d5db;
  border-color: rgba(255, 255, 255, 0.28);
  background: transparent;
}
body.gm-dialog-no-bootstrap .btn-outline-secondary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
body.gm-dialog-no-bootstrap .form-control,
body.gm-dialog-no-bootstrap .form-select {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}
body.gm-dialog-no-bootstrap .form-label {
  margin-bottom: 0.25rem;
  display: inline-block;
}
body.gm-dialog-no-bootstrap .list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
}
body.gm-dialog-no-bootstrap .list-group-flush {
  border-radius: 0;
}
body.gm-dialog-no-bootstrap .list-group-item {
  position: relative;
  display: block;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.125);
  cursor: pointer;
}
body.gm-dialog-no-bootstrap .list-group-flush .list-group-item {
  border-width: 0 0 1px;
}
body.gm-dialog-no-bootstrap .row.g-2 {
  display: flex;
  flex-wrap: wrap;
  margin: -0.25rem;
}
body.gm-dialog-no-bootstrap .row.g-2 > * {
  padding: 0.25rem;
  flex: 0 0 100%;
  max-width: 100%;
}
body.gm-dialog-no-bootstrap .d-none {
  display: none !important;
}
body.gm-dialog-no-bootstrap .small {
  font-size: 0.875em;
}
body.gm-dialog-no-bootstrap .mb-0 {
  margin-bottom: 0 !important;
}
body.gm-dialog-no-bootstrap .h6 {
  font-size: 1rem;
  font-weight: 500;
}
@media (min-width: 576px) {
  body.gm-dialog-no-bootstrap .modal.show {
    padding: 1.75rem;
  }
  body.gm-dialog-no-bootstrap .modal-dialog {
    max-width: var(--bs-modal-width);
  }
}

:root {
  --gm-dialog-surface: #1a1a1a;
  --gm-dialog-text: #f5f5f5;
  --gm-dialog-muted: #a3a3a3;
  --gm-dialog-border: rgba(246, 215, 107, 0.35);
  --gm-dialog-accent: rgba(0, 188, 212, 0.35);
}

.gm-dialog-modal-content,
.tg-admin-modal-content.gm-dialog-modal-content {
  background: var(--gm-dialog-surface);
  border: 1px solid var(--gm-dialog-accent);
  color: var(--gm-dialog-text);
}

.gm-dialog-modal-content .modal-header,
.gm-dialog-modal-content .modal-footer {
  border-color: rgba(255, 255, 255, 0.1);
}

.gm-dialog-modal-content .form-control,
.gm-dialog-modal-content .form-select {
  font-size: 0.9375rem;
  min-height: 2.5rem;
  background: #111;
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--gm-dialog-text);
}

.gm-dialog-modal-content .form-control:focus,
.gm-dialog-modal-content .form-select:focus {
  background: #111;
  color: var(--gm-dialog-text);
  border-color: rgba(0, 188, 212, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(0, 188, 212, 0.15);
}

.gm-dialog-modal-content .form-label {
  color: var(--gm-dialog-muted);
}

.gm-dialog-modal-content .list-group-item {
  background: #161616;
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--gm-dialog-text);
}

.gm-dialog-modal-content .list-group-item:hover,
.gm-dialog-modal-content .list-group-item:focus {
  background: rgba(0, 188, 212, 0.12);
  color: #fff;
}

.gm-dialog-modal-content .alert-warning {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

/* Panel GM staff */
body.panel-gm-theme .gm-dialog-modal-content {
  border-color: var(--gm-dialog-border);
}

/* Tienda GM admin — keep existing look */
body.tienda-gm-admin .gm-dialog-modal-content,
body.tienda-gm-admin .tg-admin-modal-content {
  background: var(--tg-admin-surface, var(--gm-dialog-surface));
  border: 1px solid rgba(0, 188, 212, 0.35);
  color: var(--tg-admin-text, var(--gm-dialog-text));
}

body.tienda-gm-admin .gm-dialog-modal-content .modal-header,
body.tienda-gm-admin .gm-dialog-modal-content .modal-footer,
body.tienda-gm-admin .tg-admin-modal-content .modal-header,
body.tienda-gm-admin .tg-admin-modal-content .modal-footer {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Shop / portal / landing — readable dark variant on public pages */
body.gm-shop-body .gm-dialog-modal-content,
.landing-gm .gm-dialog-modal-content,
body.gm-dialog-no-bootstrap.landing-theme-tech .gm-dialog-modal-content,
body.gm-dialog-no-bootstrap.landing-has-home-tabs .gm-dialog-modal-content {
  background: #111;
  border: 1px solid rgba(246, 215, 107, 0.4);
  color: #f5f5f5;
}

/* Toasts */
.gm-toast-host,
.tg-toast-host {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.gm-toast,
.tg-toast {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  background: #222;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  font-size: 0.875rem;
  pointer-events: auto;
  max-width: min(22rem, calc(100vw - 2rem));
}

.gm-toast-show,
.tg-toast-show {
  opacity: 1;
  transform: translateY(0);
}

.gm-toast-ok,
.tg-toast-ok { border-color: rgba(16, 185, 129, 0.5); }
.gm-toast-error,
.tg-toast-error { border-color: rgba(220, 53, 69, 0.5); }
.gm-toast-info,
.tg-toast-info { border-color: rgba(0, 188, 212, 0.5); }

body.portal-theme-grafica .gm-toast,
body.portal-theme-grafica .tg-toast {
  background: linear-gradient(165deg, #141414 0%, #0a0a0a 100%);
  border: 1px solid rgba(230, 82, 151, 0.45);
  color: #f5f5f5;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(230, 82, 151, 0.1);
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.35;
}

body.portal-theme-grafica .gm-toast-ok,
body.portal-theme-grafica .tg-toast-ok {
  border-color: rgba(230, 82, 151, 0.65);
}

body.portal-theme-grafica .gm-toast-info,
body.portal-theme-grafica .tg-toast-info {
  border-color: rgba(246, 215, 107, 0.55);
}

body.portal-theme-grafica .gm-toast-error,
body.portal-theme-grafica .tg-toast-error {
  border-color: rgba(220, 53, 69, 0.55);
}
