/* Estilos base para componentes MGPanel disponibles globalmente */
:root {
  --systemMg-primary: #0056b3;
  --systemMg-primary-hover: #0069d9;
  --systemMg-primary-active: #0062cc;
  --systemMg-secondary: #6c757d;
  --systemMg-success: #28a745;
  --systemMg-danger: #dc3545;
  --systemMg-warning: #ffc107;
  --systemMg-info: #17a2b8;
  --systemMg-light: #fafafa;
  --systemMg-dark: #2d3436;
  --systemMg-white: #ffffff;
  --systemMg-background: #ffffff;
  --systemMg-color-gray-300: #e0e0e0;
  --systemMg-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --systemMg-border-radius: 4px;
  --systemMg-input-padding: 8px 12px;
  --systemMg-input-height: 42px;
  --systemMg-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --systemMg-btn-border-radius: 8px;
  --systemMg-btn-transition: all 0.2s ease-in-out;
}

body {
  font-family: var(--systemMg-font);
}

/* Clases de tamaño de grid */
.mg-grid-12 { 
  grid-column: span 12;
}

.mg-grid-6 { 
  grid-column: span 6;
}

.mg-grid-4 { 
  grid-column: span 4;
}

.mg-grid-3 { 
  grid-column: span 3;
}

/* Botones */
.mg-btn {
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  /* min-width: 180px; */
  display: inline-block; 
  border-radius: var(--systemMg-border-radius); 
  text-decoration: none;  
  transition: var(--systemMg-btn-transition);
  border: none;
  cursor: pointer;
  font-family: var(--systemMg-font);
}
.mg-btn:hover { 
  transform: translateY(-2px); 
  text-decoration: none;
}
.mg-btn-primary:active {
  transform: translateY(0);
}
.mg-btn i {
  margin-right: 8px;
}
.mg-btn-primary {
  background-color: var(--systemMg-primary); 
  color: white; 
}
.mg-btn-primary:hover { 
  color: white;
  background-color: var(--systemMg-primary-hover);
}
.mg-btn-primary:active {
  background-color: var(--systemMg-primary-active);
}
.mg-btn-danger {
  background-color: var(--systemMg-danger); 
  color: white; 
}

/* Formularios */
.mg-form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  width: 100%;
}

.mg-form-grid .mg-form-field {
  width: 100%;
  min-width: 0; 
}

.mg-form-container {
  padding: 2rem 0;
  background-color: var(--systemMg-light);
}

.mg-form {
  background-color: var(--systemMg-white);
  border-radius: 12px;
  padding: 2.5rem;
  margin: 0 auto;
  max-width: 700px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.mg-form-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 2rem 0;
  text-align: center;
  color: var(--systemMg-dark);
  line-height: 1.3;
}

.mg-field-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem 0;
  color: var(--systemMg-dark);
  border-bottom: 2px solid var(--systemMg-primary);
  padding-bottom: 0.5rem;
}

.mg-field-title:first-child {
  margin-top: 0;
}

.mg-field-subtitle {
  margin: 0.5rem 0 1.5rem 0;
  color: var(--systemMg-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

.mg-field-header {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2rem 0 0.8rem 0;
  color: var(--systemMg-dark);
  border-left: 4px solid var(--systemMg-primary);
  padding-left: 1rem;
}

.mg-field-header:first-child {
  margin-top: 0;
}

.mg-field-subheader {
  margin: 0.5rem 0 1rem 0;
  color: var(--systemMg-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  padding-left: 1rem;
}

.mg-field-text {
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--systemMg-info);
  margin: 1rem 0;
}

.mg-field-text strong {
  color: var(--systemMg-dark);
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.mg-field-text p {
  margin: 0;
  color: var(--systemMg-secondary);
  line-height: 1.6;
}

.mg-field-description {
  margin: 0.25rem 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--systemMg-secondary);
  line-height: 1.4;
}

.mg-required {
  color: var(--systemMg-danger);
  font-weight: 700;
  margin-left: 4px;
}

.mg-form-control, .mg-form-select {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--systemMg-dark);
  background-color: var(--systemMg-white);
  background-clip: padding-box;
  border: 2px solid var(--systemMg-color-gray-300);
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  box-sizing: border-box;
  font-family: var(--systemMg-font);
}
.mg-form-control:focus, .mg-form-select:focus {
  color: var(--systemMg-dark);
  background-color: var(--systemMg-white);
  border-color: var(--systemMg-primary);
  outline: 0;
}
.mg-form-control::placeholder, .mg-form-select::placeholder {
  color: var(--systemMg-color-gray-300);
  opacity: 1;
}
.mg-textarea {
  min-height: 120px;
  resize: vertical;
}
.mg-select, .mg-form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 12px;
  appearance: none;
}
.mg-form-control:disabled {
  background-color: var(--systemMg-color-gray-300);
  opacity: 1;
}

.mg-form-label, .mg-field-label {
  font-size: 14px;
  width: 100%;
  margin-bottom: 0.5rem;
  font-weight: 500;
  display: block;
  color: var(--systemMg-dark);
}

/* Radio buttons */
.mg-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mg-radio-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mg-radio-option:hover {
  background-color: #e9ecef;
  border-color: var(--systemMg-primary);
}

.mg-radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0 12px 0 0;
  accent-color: var(--systemMg-primary);
  cursor: pointer;
}

.mg-radio-option label {
  margin: 0;
  cursor: pointer;
  flex: 1;
  font-weight: 500;
  color: var(--systemMg-dark);
}

.mg-radio-option:has(input:checked) {
  background-color: rgba(0, 123, 255, 0.1);
  border-color: var(--systemMg-primary);
}

/* Checkboxes */
.mg-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mg-checkbox-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mg-checkbox-option:hover {
  background-color: #e9ecef;
  border-color: var(--systemMg-primary);
}

.mg-checkbox-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 12px 0 0;
  accent-color: var(--systemMg-primary);
  cursor: pointer;
}

.mg-checkbox-option label {
  margin: 0;
  cursor: pointer;
  flex: 1;
  font-weight: 500;
  color: var(--systemMg-dark);
}

.mg-checkbox-option:has(input:checked) {
  background-color: rgba(0, 123, 255, 0.1);
  border-color: var(--systemMg-primary);
}

/* Acciones del formulario */
.mg-form-actions {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--systemMg-color-gray-300);
  margin-top: 2rem;
}
.mg-form-actions .mg-recaptcha-container {
  padding-bottom: 1.5rem;
}

/* Estados de validación */
.mg-input.mg-invalid,
.mg-textarea.mg-invalid,
.mg-select.mg-invalid {
  border-color: var(--systemMg-danger);
}

.mg-input.mg-invalid:focus,
.mg-textarea.mg-invalid:focus,
.mg-select.mg-invalid:focus {
  border-color: var(--systemMg-danger);
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}











/* PANEL DE PERSONALIZACIÓN ESTILO CANVA */
.mgpanel-customizer {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  pointer-events: none;
}

.mgpanel-customizer * {
  pointer-events: all;
}

/* Botón flotante principal */
.mgpanel-customizer-trigger {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.mgpanel-customizer-trigger:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

.mgpanel-customizer-trigger.active {
  background: #6366f1;
  border-color: #6366f1;
  color: white;
  transform: scale(1.05);
}

.mgpanel-customizer-icon {
  width: 20px;
  height: 20px;
  transition: all 0.2s ease;
  position: relative;
}

.mgpanel-customizer-trigger.active .mgpanel-customizer-icon {
  transform: rotate(45deg);
}

/* Panel lateral estilo Canva */
.mgpanel-customizer-panel {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  transform: translateY(-50%);
  width: 280px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.mgpanel-customizer.open .mgpanel-customizer-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0) scale(1);
}

/* Header del panel */
.mgpanel-customizer-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(249, 250, 251, 0.8);
}

.mgpanel-customizer-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mgpanel-customizer-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin: 2px 0 0 0;
  font-weight: 400;
}

/* Contenido del panel */
.mgpanel-customizer-content {
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
}

/* Sección del panel */
.mgpanel-customizer-section {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mgpanel-customizer-section:last-child {
  border-bottom: none;
}

.mgpanel-customizer-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mgpanel-customizer-section-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* Opciones de idioma */
.mgpanel-lang-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mgpanel-lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
}

.mgpanel-lang-option:hover {
  background: rgba(99, 102, 241, 0.04);
  border-color: rgba(99, 102, 241, 0.1);
  text-decoration: none;
  color: #6366f1;
}

.mgpanel-lang-option.active {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: #6366f1;
  font-weight: 600;
}

.mgpanel-lang-flag {
  width: 20px;
  height: 15px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.mgpanel-lang-flag[data-lang="es"] {
  background-image: url('https://dev.mgpanel.co/media/flags/ES.png');
}
.mgpanel-lang-flag[data-lang="us"] {
  background-image: url('https://dev.mgpanel.co/media/flags/US.png');
}
.mgpanel-lang-flag[data-lang="it"] {
  background-image: url('https://dev.mgpanel.co/media/flags/IT.png');
}
.mgpanel-lang-flag[data-lang="pt"] {
  background-image: url('https://dev.mgpanel.co/media/flags/PT.png');
}
.mgpanel-lang-flag[data-lang="fr"] {
  background-image: url('https://dev.mgpanel.co/media/flags/FR.png');
}

/* Posiciones del panel */
.mgpanel-customizer.position-left {
  left: 20px;
  right: auto;
}

.mgpanel-customizer.position-left .mgpanel-customizer-panel {
  left: calc(100% + 12px);
  right: auto;
  transform: translateY(-50%) translateX(-20px) scale(0.95);
}

.mgpanel-customizer.position-left.open .mgpanel-customizer-panel {
  transform: translateY(-50%) translateX(0) scale(1);
}

.mgpanel-customizer.position-top {
  top: 20px;
  transform: none;
}

.mgpanel-customizer.position-top .mgpanel-customizer-panel {
  top: calc(100% + 12px);
  transform: translateX(-50%) translateY(-20px) scale(0.95);
  left: 50%;
  right: auto;
}

.mgpanel-customizer.position-top.open .mgpanel-customizer-panel {
  transform: translateX(-50%) translateY(0) scale(1);
}

.mgpanel-customizer.position-bottom {
  bottom: 20px;
  top: auto;
  transform: none;
}

.mgpanel-customizer.position-bottom .mgpanel-customizer-panel {
  bottom: calc(100% + 12px);
  top: auto;
  transform: translateX(-50%) translateY(20px) scale(0.95);
  left: 50%;
  right: auto;
}

.mgpanel-customizer.position-bottom.open .mgpanel-customizer-panel {
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Responsive */
@media (max-width: 768px) {
  .mgpanel-customizer {
    right: 16px;
  }
  
  .mgpanel-customizer.position-left {
    left: 16px;
  }
  
  .mgpanel-customizer.position-top {
    top: 16px;
  }
  
  .mgpanel-customizer.position-bottom {
    bottom: 16px;
  }
  
  .mgpanel-customizer-trigger {
    width: 44px;
    height: 44px;
  }
  
  .mgpanel-customizer-icon {
    width: 18px;
    height: 18px;
  }
  
  .mgpanel-customizer-panel {
    width: 260px;
    max-height: 70vh;
  }
  
  .mgpanel-customizer-content {
    max-height: 300px;
  }
}

/* Animaciones */
.mgpanel-customizer {
  animation: mgpanel-fade-in 0.4s ease-out;
}

@keyframes mgpanel-fade-in {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* Estados de carga */
.mgpanel-customizer.loading .mgpanel-customizer-trigger {
  opacity: 0.7;
  pointer-events: none;
}

.mgpanel-customizer.loading .mgpanel-customizer-trigger::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: mgpanel-spin 1s linear infinite;
}

@keyframes mgpanel-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Scrollbar personalizado para el panel */
.mgpanel-customizer-content::-webkit-scrollbar {
  width: 4px;
}

.mgpanel-customizer-content::-webkit-scrollbar-track {
  background: transparent;
}

.mgpanel-customizer-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.mgpanel-customizer-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Los estilos del trigger flotante de carrito viven en mg-store.css (carga condicional) */
/* ── Auth trigger flotante ── */
.mgpanel-auth-trigger {
  position: fixed;
  /* Se posiciona justo debajo del trigger de carrito (48px botón + 8px gap = 56px) */
  top: calc(50% - 148px);
  right: 20px;
  z-index: 99997;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: none;
}
.mgpanel-auth-trigger.position-right {
  right: 20px;
  left: auto;
}
.mgpanel-auth-trigger-btn {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  color: #374151;
  position: relative;
}
.mgpanel-auth-trigger-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: #111827;
}
.mgpanel-auth-trigger-btn i {
  font-size: 18px;
}
/* Avatar con inicial cuando el usuario está autenticado */
.mgpanel-auth-trigger-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--systemMg-primary, #0056b3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Los estilos del icono de carrito inline viven en mg-store.css (carga condicional) */

/* ══════════════════════════════════════════════════════════════════════════
   OFFCANVAS — Base compartida: carrito + autenticación
   Actualizar aquí afecta a ambos componentes (auth puede existir sin tienda,
   por eso esta base NO se mueve a mg-store.css).
   ══════════════════════════════════════════════════════════════════════════ */

/* Contenedor */
.mg-store-offcanvas,
.mg-auth-offcanvas {
  position: fixed;
  inset: 0;
  z-index: 99999;
  visibility: hidden;
  pointer-events: none;
}
.mg-store-offcanvas.open,
.mg-auth-offcanvas.open {
  visibility: visible;
  pointer-events: auto;
}

/* Backdrop */
.mg-store-offcanvas-backdrop,
.mg-auth-offcanvas-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mg-store-offcanvas.open .mg-store-offcanvas-backdrop,
.mg-auth-offcanvas.open .mg-auth-offcanvas-backdrop {
  opacity: 1;
}

/* Panel deslizante */
.mg-store-offcanvas-panel,
.mg-auth-offcanvas-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.mg-store-offcanvas.open .mg-store-offcanvas-panel,
.mg-auth-offcanvas.open .mg-auth-offcanvas-panel {
  transform: translateX(0);
}

/* Header */
.mg-store-offcanvas-header,
.mg-auth-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

/* Título */
.mg-store-offcanvas-title,
.mg-auth-offcanvas-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
}
.mg-store-offcanvas-title {
  font-size: 1.25rem; /* El carrito usa un título ligeramente más grande */
}

/* Botón cerrar */
.mg-store-offcanvas-close,
.mg-auth-offcanvas-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #6b7280;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.mg-store-offcanvas-close:hover,
.mg-auth-offcanvas-close:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Los estilos específicos del carrito (offcanvas y página /cart) viven en mg-store.css (carga condicional) */

/* Estilos base para shortcodes */
.mg-shortcode-blog {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Blog shortcode */
.mg-shortcode-blog h3 {
  margin: 0 0 16px 0;
  color: #111827;
  font-size: 20px;
  font-weight: 600;
}

.mg-shortcode-blog p {
  margin: 0 0 16px 0;
  color: #6b7280;
  font-size: 14px;
}

.blog-posts {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.blog-post {
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #374151;
  font-size: 14px;
  transition: all 0.15s ease;
}

.blog-post:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Variantes de estilo */
.mg-shortcode-form.style-modern {
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25);
}

.mg-shortcode-form.style-modern input,
.mg-shortcode-form.style-modern textarea {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #374151;
}

.mg-shortcode-form.style-modern input:focus,
.mg-shortcode-form.style-modern textarea:focus {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.mg-shortcode-form.style-modern button {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.mg-shortcode-form.style-modern button:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Estilo minimalista */
.mg-shortcode-form.style-minimal {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.mg-shortcode-form.style-minimal input,
.mg-shortcode-form.style-minimal textarea {
  border: none;
  border-bottom: 2px solid #e5e7eb;
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
}

.mg-shortcode-form.style-minimal input:focus,
.mg-shortcode-form.style-minimal textarea:focus {
  border-bottom-color: #6366f1;
  box-shadow: none;
}

/* Estilos adicionales para campos de formulario */
.mg-shortcode-form .mg-form-field {
  margin-bottom: 20px;
}

.mg-shortcode-form .mg-field-description {
  margin: 4px 0 8px 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

.mg-shortcode-form .mg-required {
  color: #ef4444;
  margin-left: 2px;
}

.mg-shortcode-form .mg-radio-group,
.mg-shortcode-form .mg-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.mg-shortcode-form .mg-radio-option,
.mg-shortcode-form .mg-checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mg-shortcode-form .mg-radio-option input,
.mg-shortcode-form .mg-checkbox-option input {
  margin: 0;
  width: auto;
}

.mg-shortcode-form .mg-radio-option label,
.mg-shortcode-form .mg-checkbox-option label {
  margin: 0;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
}

.mg-shortcode-form fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.mg-shortcode-form legend {
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
  font-size: 14px;
  padding: 0;
}

.mg-shortcode-form .mg-field-title {
  margin: 0 0 16px 0;
  color: #111827;
  font-size: 24px;
  font-weight: 700;
}

.mg-shortcode-form .mg-field-subtitle {
  margin: 8px 0 16px 0;
  color: #6b7280;
  font-size: 16px;
  line-height: 1.5;
}

.mg-shortcode-form .mg-field-header {
  margin: 0 0 12px 0;
  color: #111827;
  font-size: 18px;
  font-weight: 600;
}

.mg-shortcode-form .mg-field-subheader {
  margin: 4px 0 12px 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

.mg-shortcode-form .mg-field-text {
  padding: 12px 0;
}

.mg-shortcode-form .mg-field-text strong {
  color: #111827;
  font-size: 16px;
}

.mg-shortcode-form .mg-field-text p {
  margin: 8px 0 0 0;
  color: #6b7280;
  line-height: 1.5;
}

/* ---------------------------------- */
/* Estilos para blog */
/* ---------------------------------- */
.mg-shortcode-blog {
  margin: 2rem 0;
}

.mg-shortcode-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.mg-shortcode-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.mg-blog-card {
  background-color: var(--systemMg-white);
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  position: relative;
}

.mg-blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.mg-blog-card:hover .mg-img-responsive {
  transform: scale(1.05);
}

.mg-shortcode-blog-empty {
  text-align: center;
  padding: 3rem 2rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  color: var(--systemMg-secondary);
  font-size: 1.1rem;
  margin: 2rem 0;
}

/* Scroll infinito (blog) */
.mg-blog-infinite-sentinel{
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 0;
}

.mg-blog-infinite-loading{
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 1;
}

.mg-blog-infinite-loading span{
  font-size: 0.95rem;
}

/* Botón "Ver más" (blog shortcode) */
.mg-blog-more-wrap{
  display: flex;
  justify-content: center;
  align-items: center;
}

.mg-blog-more-spinner{
  width: 1rem;
  height: 1rem;
}

/* Títulos de shortcode más compactos */
.mg-shortcode-blog .mg-blog-title-container {
  padding: 2rem 0 1.5rem 0;
  margin-bottom: 1.5rem;
}

.mg-shortcode-blog .mg-blog-title {
  font-size: 2rem;
}

/* Cards más compactos para shortcodes */
.mg-shortcode-blog .mg-card-image {
  height: 180px;
}

.mg-shortcode-blog .mg-card-body {
  padding: 1.5rem;
}

.mg-shortcode-blog .mg-card-title {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.mg-shortcode-blog .mg-card-meta {
  margin-bottom: 0.75rem;
}

.mg-shortcode-blog .mg-card-excerpt {
  margin-bottom: 1rem;
}

/* Variantes de estilo */
.mg-shortcode-blog.style-list .mg-shortcode-blog-grid {
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.mg-shortcode-blog.style-list .mg-blog-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.mg-shortcode-blog.style-list .mg-card-image {
  width: 200px;
  flex-shrink: 0;
}

.mg-shortcode-blog.style-list .mg-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mg-shortcode-blog.style-compact .mg-shortcode-blog-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.mg-shortcode-blog.style-compact .mg-card-image {
  height: 140px;
}

.mg-shortcode-blog.style-compact .mg-card-body {
  padding: 1rem;
}

.mg-shortcode-blog.style-compact .mg-card-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* Badges de categorías (blog: artículo y cards) */

.mg-badge-success { 
  color: white; 
  background-color: rgba(40,167,69,1); 
}

.mg-badge-danger {
  color: white; 
  background-color: rgba(220, 53, 69, 1); 
}
.mg-badge-warning {
  color: white; 
  background-color: rgba(255, 193, 7, 1); 
}
.mg-badge-info {
  color: white; 
  background-color: rgba(9, 132, 227, 1); 
}
.mg-badge-primary {
  color: white; 
  background-color: rgba(0, 86, 179, 1); 
}
.mg-badge-secondary {
  color: white; 
  background-color: rgba(108, 117, 125, 1); 
}
.mg-badge-dark {
  color: white; 
  background-color: rgba(33, 37, 41, 1); 
}

.mg-badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  color: white;
  background-color: var(--systemMg-primary);
  border: none;
  border-radius: 4px;
  text-decoration: none;
}
.mg-badge:hover,
.mg-badge:focus {
  color: #fff;
  background-color: var(--systemMg-primary);
  text-decoration: none;
}

.mg-article-categories,
.mg-card-category {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.mg-article-categories {
  margin-bottom: 1rem;
}

.mg-alert {
  position: relative;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  border-left-width: 4px;
  border-left-style: solid;
  background-color: #f8f9fa;
  line-height: 1.5;
}

.mg-alert i {
  margin-right: 12px;
  font-size: 20px;
  margin-top: 2px;
}

.mg-alert p {
  margin: 0;
  flex: 1;
  font-size: 0.95em;
}

.mg-alert-warning {
  border-left-color: var(--systemMg-warning);
  background-color: rgba(255, 193, 7, 0.1);
}

.mg-alert-warning i {
  color: var(--systemMg-warning);
}

.mg-alert-danger {
  border-left-color: var(--systemMg-danger);
  background-color: rgba(220, 53, 69, 0.1);
}

.mg-alert-danger i {
  color: var(--systemMg-danger);
}

.mg-alert-success {
  border-left-color: var(--systemMg-success);
  background-color: rgba(40, 167, 69, 0.1);
}

.mg-alert-success i {
  color: var(--systemMg-success);
}

.mg-alert-info {
  border-left-color: var(--systemMg-info);
  background-color: rgba(23, 162, 184, 0.1);
}

.mg-alert-info i {
  color: var(--systemMg-info);
}

.mg-alert-warning-custom {
  flex-direction: column;
}

.mg-alert-warning-custom .mg-alert-title {
  margin: 0 0 10px;
}

.mg-alert-warning-custom .mg-alert-message {
  margin: 0;
}

.mg-input.mg-invalid,
.mg-textarea.mg-invalid,
.mg-select.mg-invalid {
  border-color: var(--systemMg-danger);
}

.mg-input.mg-invalid:focus,
.mg-textarea.mg-invalid:focus,
.mg-select.mg-invalid:focus {
  border-color: var(--systemMg-danger);
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Los estilos del grid/cards de tienda viven en mg-store.css (carga condicional) */

/* =====================================
   MÓDULO E-LEARNING (CURSOS)
   Catálogo, detalle, aula y mis cursos.
   Diseñado para verse pulido sin ajustes
   adicionales (estilo Platzi/Coursera).
   ===================================== */

/* ---- Catálogo ---- */
.mg-courses-container {
    padding: 1.5rem 0 3rem;
    font-family: var(--systemMg-font);
    color: var(--systemMg-dark);
}
.mg-courses-title-container { margin-bottom: 1.5rem; }
.mg-courses-title {
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0;
}
.mg-courses-subtitle { color: var(--systemMg-color-gray-500, #6b7280); margin: 0.35rem 0 0; }
.mg-courses-filters {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
  background: var(--systemMg-white, #fff); padding: 1rem 1.25rem; border-radius: 14px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05); margin: 0 20px 2rem;
}
.mg-courses-filter { display: flex; flex-direction: column; }
.mg-courses-filter-search { flex: 1; min-width: 220px; }
.mg-courses-filters input[type="text"],
.mg-courses-filters select {
  padding: 0.7rem 0.9rem; border: 1px solid var(--systemMg-color-gray-200, #e5e7eb);
  border-radius: 10px; font-size: 0.95rem; background: #fff; min-width: 160px;
}
.mg-courses-filter-actions { margin-left: auto; }
.mg-courses-empty { text-align: center; padding: 3rem 1rem; color: var(--systemMg-color-gray-500, #6b7280); }
.mg-courses-empty .mg-btn { margin-top: 1rem; }

.mg-courses-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem; padding: 0 20px;
}
.mg-course-card {
  background: var(--systemMg-white, #fff); border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: all 0.3s ease;
  display: flex; flex-direction: column; position: relative;
}
.mg-course-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.mg-course-card-image-link { display: block; text-decoration: none; }
.mg-course-card-image { height: 180px; position: relative; overflow: hidden; background: var(--systemMg-light, #f3f4f6); }
.mg-course-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.mg-course-card:hover .mg-course-card-image img { transform: scale(1.05); }
.mg-course-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--systemMg-color-gray-300, #d1d5db); font-size: 3rem; }
.mg-course-badge {
  position: absolute; top: 12px; font-size: 0.72rem; font-weight: 700; padding: 0.3rem 0.6rem;
  border-radius: 999px; color: #fff; backdrop-filter: blur(4px);
}
.mg-course-badge-free { left: 12px; background: #16a34a; }
.mg-course-badge-request { left: 12px; background: #6366f1; }
.mg-course-badge-featured { right: 12px; background: rgba(17,24,39,0.85); }
.mg-course-badge-status { left: 12px; background: rgba(17,24,39,0.85); }
.mg-course-badge-status.status-completed { background: #16a34a; }
.mg-course-badge-status.status-pending_payment,
.mg-course-badge-status.status-pending_approval { background: #d97706; }
.mg-course-card-body { padding: 1.25rem 1.4rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.mg-course-card-cat { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--systemMg-primary, #2563eb); }
.mg-course-card-title { font-size: 1.15rem; font-weight: 700; line-height: 1.35; margin: 0.4rem 0 0.5rem; }
.mg-course-card-title a { color: var(--systemMg-dark, #111827); text-decoration: none; }
.mg-course-card-title a:hover { color: var(--systemMg-primary, #2563eb); }
.mg-course-card-summary { font-size: 0.88rem; color: var(--systemMg-color-gray-500, #6b7280); margin: 0 0 0.75rem; line-height: 1.5; }
.mg-course-card-instructor { font-size: 0.82rem; color: var(--systemMg-color-gray-600, #4b5563); margin: 0 0 0.75rem; }
.mg-course-card-instructor i { color: var(--systemMg-primary, #2563eb); margin-right: 4px; }
.mg-course-card-meta { display: flex; flex-wrap: wrap; gap: 0.85rem; font-size: 0.78rem; color: var(--systemMg-color-gray-500, #6b7280); margin-bottom: 1rem; }
.mg-course-card-meta i { margin-right: 3px; }
.mg-course-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 0.5rem; }
.mg-course-card-price { font-size: 1.2rem; font-weight: 800; color: var(--systemMg-primary, #2563eb); }
.mg-course-card-btn { white-space: nowrap; }

/* ---- Detalle ---- */
.mg-course-hero { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: #fff; padding: 2.5rem 0 3rem; }
.mg-course-hero-inner { display: grid; grid-template-columns: 1fr 360px; gap: 2.5rem; align-items: start; }
.mg-course-breadcrumb { font-size: 0.85rem; opacity: 0.7; margin-bottom: 1rem; }
.mg-course-breadcrumb a { color: #fff; text-decoration: none; }
.mg-course-breadcrumb span { margin: 0 0.4rem; }
.mg-course-hero-title { font-size: 2.2rem; font-weight: 700; line-height: 1.2; margin: 0 0 0.85rem; }
.mg-course-hero-summary { font-size: 1.05rem; opacity: 0.85; line-height: 1.6; margin: 0 0 1.25rem; max-width: 640px; }
.mg-course-hero-meta { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 0.9rem; margin-bottom: 1.25rem; }
.mg-course-hero-meta i { margin-right: 5px; opacity: 0.8; }
.mg-course-rating { color: #fbbf24; font-weight: 700; }
.mg-course-rating small { color: #fff; opacity: 0.7; font-weight: 400; }
.mg-course-hero-instructor { display: flex; align-items: center; gap: 0.75rem; }
.mg-course-hero-instructor img, .mg-course-instructor-initial {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center; background: var(--systemMg-primary, #2563eb); font-weight: 700; font-size: 1.2rem;
}
.mg-course-hero-instructor small { display: block; opacity: 0.65; font-size: 0.75rem; }
.mg-course-hero-instructor strong { font-size: 0.95rem; }

.mg-course-enroll-card {
  background: var(--systemMg-white, #fff); color: var(--systemMg-dark, #111827);
  border-radius: 16px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  position: sticky; top: 20px;
}
.mg-course-enroll-media { position: relative; height: 200px; background: var(--systemMg-light, #f3f4f6); }
.mg-course-enroll-media img { width: 100%; height: 100%; object-fit: cover; }
.mg-course-enroll-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--systemMg-color-gray-300, #d1d5db); }
.mg-course-preview-play {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.92); color: var(--systemMg-primary, #2563eb);
  font-size: 1.4rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); transition: transform 0.2s ease;
}
.mg-course-preview-play:hover { transform: scale(1.08); }
.mg-course-enroll-body { padding: 1.5rem; }
.mg-course-enroll-price { font-size: 1.9rem; font-weight: 800; color: var(--systemMg-dark, #111827); margin-bottom: 1rem; }
.mg-course-enroll-price small { font-size: 0.9rem; font-weight: 600; color: var(--systemMg-color-gray-500, #6b7280); }
.mg-course-enroll-btn {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 0.85rem 1rem;
    text-align: center;
    box-sizing: border-box;
}
.mg-course-enroll-note { font-size: 0.85rem; color: var(--systemMg-color-gray-500, #6b7280); margin: 0.75rem 0 0; text-align: center; }
.mg-course-enroll-note i { color: #16a34a; }
.mg-course-enroll-features { list-style: none; padding: 1.25rem 0 0; margin: 1.25rem 0 0; border-top: 1px solid var(--systemMg-color-gray-200, #e5e7eb); display: grid; gap: 0.6rem; }
.mg-course-enroll-features li { font-size: 0.88rem; color: var(--systemMg-color-gray-600, #4b5563); }
.mg-course-enroll-features i { width: 20px; color: var(--systemMg-primary, #2563eb); }

.mg-course-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-top: 2.5rem; padding-bottom: 3rem; max-width: 820px; }
.mg-course-section { margin-bottom: 2.5rem; }
.mg-course-section h2 { font-size: 1.4rem; font-weight: 700; margin: 0 0 1rem; }
.mg-course-outcomes ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.mg-course-outcomes li { font-size: 0.92rem; line-height: 1.5; }
.mg-course-outcomes i { color: #16a34a; margin-right: 8px; }
.mg-course-curriculum-meta { color: var(--systemMg-color-gray-500, #6b7280); font-size: 0.88rem; margin: -0.5rem 0 1rem; }

/* Acordeón de currículo */
.mg-course-accordion { border: 1px solid var(--systemMg-color-gray-200, #e5e7eb); border-radius: 12px; overflow: hidden; }
.mg-course-acc-item + .mg-course-acc-item { border-top: 1px solid var(--systemMg-color-gray-200, #e5e7eb); }
.mg-course-acc-head {
  width: 100%; display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem;
  background: var(--systemMg-light, #f9fafb); border: none; cursor: pointer; text-align: left; font-size: 0.98rem; font-weight: 700;
}
.mg-course-acc-title { flex: 1; }
.mg-course-acc-count { font-size: 0.8rem; font-weight: 500; color: var(--systemMg-color-gray-500, #6b7280); }
.mg-course-acc-chevron { transition: transform 0.25s ease; color: var(--systemMg-color-gray-500, #6b7280); }
.mg-course-acc-item.open .mg-course-acc-chevron { transform: rotate(180deg); }
.mg-course-acc-body { display: none; padding: 0.5rem 0; }
.mg-course-acc-item.open .mg-course-acc-body { display: block; }
.mg-course-lesson-list { list-style: none; padding: 0; margin: 0; }
.mg-course-lesson { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1.25rem; font-size: 0.92rem; }
.mg-course-lesson + .mg-course-lesson { border-top: 1px solid var(--systemMg-color-gray-100, #f3f4f6); }
.mg-course-lesson-icon { color: var(--systemMg-primary, #2563eb); width: 18px; text-align: center; }
.mg-course-lesson.is-locked .mg-course-lesson-icon { color: var(--systemMg-color-gray-300, #d1d5db); }
.mg-course-lesson-title { flex: 1; color: var(--systemMg-dark, #111827); text-decoration: none; }
a.mg-course-lesson-title:hover { color: var(--systemMg-primary, #2563eb); }
.mg-course-lesson-preview { font-size: 0.7rem; font-weight: 700; color: #16a34a; border: 1px solid #16a34a; border-radius: 6px; padding: 0.1rem 0.4rem; }
.mg-course-lesson-lock { color: var(--systemMg-color-gray-300, #d1d5db); }
.mg-course-lesson-dur { font-size: 0.78rem; color: var(--systemMg-color-gray-500, #6b7280); }
.mg-course-requirements ul, .mg-course-description-content { font-size: 0.95rem; line-height: 1.7; }
.mg-course-description-content img { max-width: 100%; height: auto; }

/* Modal de vista previa */
.mg-course-preview-modal { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; }
.mg-course-preview-modal.open { display: flex; }
.mg-course-preview-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.8); }
.mg-course-preview-dialog { position: relative; width: min(900px, 92vw); z-index: 1; }
.mg-course-preview-video { position: relative; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; }
.mg-course-preview-video iframe, .mg-course-preview-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mg-course-preview-close { position: absolute; top: -42px; right: 0; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* ---- Aula (classroom) ---- */
.mg-classroom { display: grid; grid-template-columns: 340px 1fr; min-height: 70vh; background: var(--systemMg-light, #f9fafb); }
.mg-classroom-sidebar { background: var(--systemMg-white, #fff); border-right: 1px solid var(--systemMg-color-gray-200, #e5e7eb); max-height: 100vh; overflow-y: auto; position: sticky; top: 0; }
.mg-classroom-sidebar-head { padding: 1.25rem; border-bottom: 1px solid var(--systemMg-color-gray-200, #e5e7eb); }
.mg-classroom-back { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.95rem; color: var(--systemMg-dark, #111827); text-decoration: none; margin-bottom: 0.85rem; }
.mg-classroom-back i { color: var(--systemMg-primary, #2563eb); }
.mg-classroom-progress-bar { height: 8px; background: var(--systemMg-color-gray-200, #e5e7eb); border-radius: 999px; overflow: hidden; }
.mg-classroom-progress-bar span { display: block; height: 100%; background: #16a34a; transition: width 0.4s ease; }
.mg-classroom-progress small { display: block; margin-top: 0.4rem; font-size: 0.78rem; color: var(--systemMg-color-gray-500, #6b7280); }
.mg-classroom-sec { padding: 0.5rem 0; }
.mg-classroom-sec-title { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--systemMg-color-gray-500, #6b7280); padding: 0.75rem 1.25rem 0.4rem; }
.mg-classroom-sec ul { list-style: none; margin: 0; padding: 0; }
.mg-classroom-lesson a, .mg-classroom-lesson > span { display: flex; align-items: center; gap: 0.65rem; padding: 0.65rem 1.25rem; text-decoration: none; color: var(--systemMg-dark, #111827); font-size: 0.88rem; }
.mg-classroom-lesson.active { background: rgba(37,99,235,0.08); border-left: 3px solid var(--systemMg-primary, #2563eb); }
.mg-classroom-lesson.locked > span { color: var(--systemMg-color-gray-400, #9ca3af); cursor: not-allowed; }
.mg-classroom-lesson:hover a { background: var(--systemMg-light, #f3f4f6); }
.mg-classroom-lesson-status { width: 18px; text-align: center; color: var(--systemMg-color-gray-400, #9ca3af); }
.mg-classroom-lesson.done .mg-classroom-lesson-status { color: #16a34a; }
.mg-classroom-lesson.active .mg-classroom-lesson-status { color: var(--systemMg-primary, #2563eb); }
.mg-classroom-lesson-title { flex: 1; }
.mg-classroom-lesson-dur { font-size: 0.72rem; color: var(--systemMg-color-gray-400, #9ca3af); }

.mg-classroom-main { padding: 1.5rem; max-width: 960px; margin: 0 auto; width: calc(100% - 50px); }
.mg-classroom-toggle { display: none; align-items: center; gap: 0.5rem; background: var(--systemMg-white, #fff); border: 1px solid var(--systemMg-color-gray-200, #e5e7eb); border-radius: 10px; padding: 0.6rem 1rem; font-weight: 700; cursor: pointer; margin-bottom: 1rem; }
.mg-classroom-player { background: #000; border-radius: 14px; overflow: hidden; margin-bottom: 1.25rem; }
.mg-classroom-video-wrap { position: relative; padding-top: 56.25%; }
.mg-classroom-video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mg-classroom-video { width: 100%; display: block; max-height: 70vh; }
.mg-classroom-text-lesson, .mg-classroom-doc, .mg-classroom-live { background: var(--systemMg-white, #fff); padding: 2rem; border-radius: 14px; line-height: 1.7; }
.mg-classroom-doc, .mg-classroom-live { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.mg-classroom-doc i, .mg-classroom-live i { font-size: 2.5rem; color: var(--systemMg-primary, #2563eb); }
.mg-classroom-lesson-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.mg-classroom-lesson-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.mg-classroom-resources, .mg-classroom-notes { background: var(--systemMg-white, #fff); padding: 1.25rem 1.5rem; border-radius: 12px; margin-top: 1rem; }
.mg-classroom-resources h3 { font-size: 1rem; margin: 0 0 0.75rem; }
.mg-classroom-resources ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.mg-classroom-resources a { color: var(--systemMg-primary, #2563eb); text-decoration: none; }

/* Examen */
.mg-classroom-exam { background: var(--systemMg-white, #fff); padding: 2rem; border-radius: 14px; }
.mg-classroom-exam h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.5rem; }
.mg-classroom-exam-desc { color: var(--systemMg-color-gray-600, #4b5563); }
.mg-classroom-exam-meta { display: flex; gap: 1.25rem; font-size: 0.85rem; color: var(--systemMg-color-gray-500, #6b7280); margin-bottom: 1.5rem; }
.mg-exam-question { padding: 1.25rem 0; border-top: 1px solid var(--systemMg-color-gray-100, #f3f4f6); }
.mg-exam-question-text { font-weight: 700; margin: 0 0 0.85rem; }
.mg-exam-options { display: grid; gap: 0.5rem; }
.mg-exam-option { display: flex; align-items: center; gap: 0.65rem; padding: 0.7rem 0.9rem; border: 1px solid var(--systemMg-color-gray-200, #e5e7eb); border-radius: 10px; cursor: pointer; transition: all 0.15s ease; }
.mg-exam-option:hover { border-color: var(--systemMg-primary, #2563eb); background: rgba(37,99,235,0.04); }
.mg-exam-result { margin-top: 1.25rem; padding: 1rem 1.25rem; border-radius: 10px; font-size: 0.95rem; }
.mg-exam-result.passed { background: #dcfce7; color: #166534; }
.mg-exam-result.failed { background: #fee2e2; color: #991b1b; }
#mg-exam-submit { margin-top: 1.5rem; }

/* Gate */
.mg-classroom-gate { padding: 4rem 0; }
.mg-classroom-gate-card { max-width: 460px; margin: 0 auto; text-align: center; background: var(--systemMg-white, #fff); padding: 2.5rem 2rem; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.mg-classroom-gate-card i { font-size: 2.5rem; color: var(--systemMg-color-gray-400, #9ca3af); margin-bottom: 1rem; }
.mg-classroom-gate-card h2 { font-size: 1.3rem; margin: 0 0 0.5rem; }
.mg-classroom-gate-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }

/* Mis cursos */
.mg-my-course-progress { margin: 0.5rem 0 1rem; }
.mg-my-course-progress small { display: block; margin-top: 0.35rem; font-size: 0.78rem; color: var(--systemMg-color-gray-500, #6b7280); }

/* Shortcode */
.mg-shortcode-courses .mg-courses-container { padding: 1rem 0; }
.mg-shortcode-courses .mg-shortcode-container { max-width: 100%; padding: 0; }

/* Responsive */
@media (max-width: 992px) {
  .mg-course-hero-inner { grid-template-columns: 1fr; }
  .mg-course-enroll-card { position: relative; max-width: 420px; }
  .mg-classroom { grid-template-columns: 1fr; }
  .mg-classroom-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 300px; z-index: 1200; transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: 0 0 40px rgba(0,0,0,0.2); }
  .mg-classroom-sidebar.open { transform: translateX(0); }
  .mg-classroom-toggle { display: inline-flex; }
}
/* Pantallas grandes: aprovechar el ancho disponible (el main estaba limitado a 960px) */
@media (min-width: 1200px) {
  .mg-classroom { grid-template-columns: 380px 1fr; }
  .mg-classroom-main { max-width: 1100px; }
}
@media (min-width: 1600px) {
  .mg-classroom { grid-template-columns: 420px 1fr; }
  .mg-classroom-main { max-width: 1280px; padding: 2rem 2.5rem; }
}
@media (max-width: 768px) {
  .mg-courses-grid { grid-template-columns: 1fr; gap: 1.5rem; padding: 0 15px; }
  .mg-course-hero-title { font-size: 1.6rem; }
  .mg-course-outcomes ul { grid-template-columns: 1fr; }
  .mg-courses-filters { flex-direction: column; align-items: stretch; }
  .mg-courses-filter-actions { margin-left: 0; }
}

/* =====================================
   MÓDULO ADS (PUBLICIDAD)
   Contenedores y elementos reutilizables
   ===================================== */

.mg-ads-container {
  margin: 2rem 0;
  text-align: center;
}

.mg-ads-container.mg-ads-top,
.mg-ads-container.mg-ads-bottom {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.mg-ads-container.mg-ads-middle {
  margin: 2.5rem 0;
  padding: 1.25rem 0;
}

.mg-ads-container.mg-ads-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mg-ads-container.mg-shortcode-ads {
  margin: 1.5rem 0;
}

.mg-ad-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.mg-ad-link {
  display: inline-block;
}

.mg-ad-video {
  margin: 1.25rem 0;
}

.mg-ad-video iframe,
.mg-ad-video video {
  width: 100%;
  max-width: 100%;
  border-radius: 6px;
}

.mg-ad-google-ads {
  display: block;
  max-width: 100%;
  overflow: hidden;
  margin: 1.25rem 0;
}

/* Popups de publicidad (módulo Ads) */

.mg-ads-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.7);
}

.mg-ads-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.mg-ads-popup-content {
  position: relative;
  background: var(--systemMg-white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  overflow: auto;
}

.mg-ads-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 30px;
  cursor: pointer;
  color: #333;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  z-index: 10002;
}

.mg-ads-popup-close:hover {
  color: #000;
}

/* ==========================================================================
   MÓDULO DE AUTENTICACIÓN PÚBLICA — mg-auth
   Página /login + Offcanvas global
   ========================================================================== */

/* ── Página /login ─────────────────────────────────────────────────────────── */

body.page-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background-color: var(--systemMg-light);
}

.mg-auth-page {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.mg-auth-card {
  width: 100%;
  background: var(--systemMg-white);
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  padding: 36px 32px 28px;
}

/* Logo */
.mg-auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.mg-auth-logo-img {
  max-height: 56px;
  max-width: 180px;
  object-fit: contain;
}

.mg-auth-logo-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--systemMg-dark);
  letter-spacing: -0.01em;
}

/* Tabs */
/* Título por vista (reemplaza las pestañas: el cambio de vista se hace con los
   enlaces de footer data-mg-auth-goto) */
.mg-auth-view-title {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--systemMg-dark);
}

/* Vistas */
.mg-auth-view {
  animation: mgAuthFadeIn 0.18s ease;
}

@keyframes mgAuthFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Footer de formulario (links) */
.mg-auth-footer {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--systemMg-secondary);
  text-align: center;
}

.mg-auth-footer a {
  color: var(--systemMg-primary);
  text-decoration: none;
}

.mg-auth-footer a:hover {
  text-decoration: underline;
}

/* Mensajes de error / éxito */
.mg-auth-msg {
  border-radius: var(--systemMg-border-radius);
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.mg-auth-msg--error {
  background-color: #fff5f5;
  border: 1px solid #fed7d7;
  color: #c53030;
}

.mg-auth-msg--success {
  background-color: #f0fff4;
  border: 1px solid #c6f6d5;
  color: #276749;
}


/* ── Auth offcanvas: específico ──────────────────────────────────────────── */

/* Título por vista en el offcanvas (un poco más pequeño que en /login) */
.mg-auth-offcanvas-body .mg-auth-view-title {
  font-size: 1.1rem;
  margin-bottom: 18px;
}

/* Cuerpo y vistas */
.mg-auth-offcanvas-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
}

.mg-auth-offcanvas-view {
  animation: mgAuthFadeIn 0.15s ease;
}

.mg-auth-offcanvas-hint {
  font-size: 0.875rem;
  color: var(--systemMg-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.mg-auth-offcanvas-footer {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--systemMg-secondary);
  text-align: center;
}

.mg-auth-offcanvas-footer a {
  color: var(--systemMg-primary);
  text-decoration: none;
}

.mg-auth-offcanvas-footer a:hover {
  text-decoration: underline;
}

/* Vista de perfil autenticado */
.mg-auth-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--systemMg-color-gray-300);
}

.mg-auth-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--systemMg-primary);
  color: var(--systemMg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.mg-auth-profile-info {
  min-width: 0;
}

.mg-auth-profile-name {
  margin: 0 0 2px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--systemMg-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-auth-profile-email {
  margin: 0;
  font-size: 0.8rem;
  color: var(--systemMg-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-auth-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}


/* RESPONSIVE */
@media ( min-width: 1600px ) {

  

}

@media screen and (max-width: 1366px) {



}

@media screen and (max-width: 1290px) {



}

@media screen and (max-width: 1220px) {



}

@media screen and (max-width: 990px) {

  .mg-grid-6,
  .mg-grid-4,
  .mg-grid-3 {
    grid-column: span 12; 
  }

  .mg-form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

}

@media screen and (max-width: 768px) {

  .mg-shortcode-form,
  .mg-shortcode-blog {
    padding: 16px;
    margin: 16px 0;
  }
  
  .mg-shortcode-form form {
    gap: 12px;
  }
  
  .mg-shortcode-form .mg-radio-group,
  .mg-shortcode-form .mg-checkbox-group {
    gap: 12px;
  }

  /* Shortcodes de blog responsive */
  .mg-shortcode-blog .mg-blog-title-container {
    padding: 1.5rem 0 1rem 0;
    margin-bottom: 1rem;
  }
  
  .mg-shortcode-blog .mg-blog-title {
    font-size: 1.6rem;
  }
  
  .mg-shortcode-blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
  }
  
  .mg-shortcode-blog .mg-card-image {
    height: 160px;
  }
  
  .mg-shortcode-blog .mg-card-body {
    padding: 1.25rem;
  }
  
  .mg-shortcode-blog .mg-card-title {
    font-size: 1.1rem;
  }
  
  /* Estilo lista responsive */
  .mg-shortcode-blog.style-list .mg-blog-card {
    flex-direction: column;
  }
  
  .mg-shortcode-blog.style-list .mg-card-image {
    width: 100%;
    height: 160px;
  }
  
  /* Estilo compacto responsive */
  .mg-shortcode-blog.style-compact .mg-shortcode-blog-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .mg-shortcode-blog.style-compact .mg-card-image {
    height: 120px;
  }
  
  .mg-shortcode-blog.style-compact .mg-card-body {
    padding: 0.875rem;
  }

}

@media screen and (max-width: 585px) {

  .mg-auth-card {
    padding: 28px 20px 20px;
    border-radius: 10px;
  }

  .mg-store-offcanvas-panel,
  .mg-auth-offcanvas-panel {
    max-width: 100%;
  }

}

@media (max-width: 585px) and (orientation: landscape) {



}


@media screen and (max-width: 390px) {



}

@media screen and (max-width: 340px) {



}

@media screen and (min-width:0\0) { 
/* Tus estilos CSS para IE9, IE10, IE11  */


}

@supports (-ms-ime-align:auto) { 
/* Tus estilos CSS para EDGE */


}

@-moz-document url-prefix() {
/* Tus estilos CSS para Mozilla */


}

/* ===================================================================== */
/* ===== Real-Estate / Properties Module =============================== */
/* ===================================================================== */

.mg-property-container {
  padding: 1.5rem 0 3rem;
  font-family: var(--systemMg-font);
  color: var(--systemMg-dark);
}
.mg-property-title-container {
  padding: 0 20px 1rem;
}
.mg-property-title {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0;
}
.mg-property-empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--systemMg-secondary);
}

/* ----- Barra de filtros ----- */
.mg-property-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  padding: 1rem 20px 1.5rem;
}
.mg-property-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 150px;
  min-width: 140px;
}
.mg-property-filter label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--systemMg-secondary);
}
.mg-property-filter select,
.mg-property-filter input {
  box-sizing: border-box;
  width: 100%;
  height: var(--systemMg-input-height);
  padding: var(--systemMg-input-padding);
  border: 1px solid var(--systemMg-color-gray-300);
  border-radius: var(--systemMg-border-radius);
  font-family: var(--systemMg-font);
  font-size: 0.95rem;
  line-height: normal;
  background: var(--systemMg-white);
  appearance: auto;
}
.mg-property-filter-actions {
  flex: 0 0 auto;
}

/* ----- Grid + tarjetas ----- */
.mg-property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  padding: 0 20px;
}
.mg-property-card {
  background-color: var(--systemMg-white);
  border: 1px solid var(--systemMg-color-gray-300);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--systemMg-box-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.mg-property-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}
.mg-property-card-image-link {
  display: block;
  text-decoration: none;
}
.mg-property-card-image {
  position: relative;
  width: 100%;
  height: 230px;
  overflow: hidden;
  background: var(--systemMg-light);
}
.mg-property-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.mg-property-card:hover .mg-property-card-image img {
  transform: scale(1.07);
}
.mg-property-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--systemMg-color-gray-300);
}
.mg-property-badge {
  position: absolute;
  top: 12px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--systemMg-white);
  letter-spacing: 0.2px;
}
.mg-property-badge-operation {
  left: 12px;
  background: var(--systemMg-primary);
}
.mg-property-badge-featured {
  right: 12px;
  background: var(--systemMg-warning);
  color: var(--systemMg-dark);
}
.mg-property-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.mg-property-card-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--systemMg-secondary);
  font-weight: 600;
}
.mg-property-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}
.mg-property-card-title a {
  color: inherit;
  text-decoration: none;
}
.mg-property-card-title a:hover {
  color: var(--systemMg-primary);
}
.mg-property-card-location {
  font-size: 0.88rem;
  color: var(--systemMg-secondary);
  margin: 0;
}
.mg-property-card-location i {
  margin-right: 4px;
  color: var(--systemMg-primary);
}
.mg-property-card-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--systemMg-primary);
  margin: 0.25rem 0 0;
}
.mg-property-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  border-top: 1px solid var(--systemMg-color-gray-300);
  margin-top: 0.75rem;
  padding-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--systemMg-dark);
}
.mg-property-card-feature {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.mg-property-card-feature-icon {
  color: var(--systemMg-primary);
}
.mg-property-card-btn {
  margin-top: 0.9rem;
  text-align: center;
  text-decoration: none;
}

/* ----- Detalle ----- */
.mg-property-breadcrumb {
  font-size: 0.85rem;
  color: var(--systemMg-secondary);
  padding: 0 0 1rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.mg-property-breadcrumb a {
  color: var(--systemMg-primary);
  text-decoration: none;
}
.mg-property-detail-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: start;
}
.mg-property-main-image {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--systemMg-light);
}
.mg-property-main-image img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  display: block;
}
.mg-property-placeholder {
  width: 100%;
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--systemMg-color-gray-300);
}
.mg-property-zoom {
  display: block;
  position: relative;
  cursor: zoom-in;
}
.mg-property-zoom-icon {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mg-property-thumbnails {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.mg-property-thumb {
  width: 84px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: var(--systemMg-light);
}
.mg-property-thumb.active {
  border-color: var(--systemMg-primary);
}
.mg-property-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mg-property-info-badges {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.mg-property-availability {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}
.mg-property-availability.is-available {
  background: rgba(40, 167, 69, 0.12);
  color: var(--systemMg-success);
}
.mg-property-availability.is-unavailable {
  background: rgba(108, 117, 125, 0.15);
  color: var(--systemMg-secondary);
}
.mg-property-type-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--systemMg-light);
  color: var(--systemMg-secondary);
}
.mg-property-detail-title {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  line-height: 1.25;
}
.mg-property-detail-location {
  color: var(--systemMg-secondary);
  margin: 0 0 0.75rem;
}
.mg-property-detail-location i {
  color: var(--systemMg-primary);
  margin-right: 5px;
}
.mg-property-detail-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--systemMg-primary);
}
.mg-property-negotiable {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--systemMg-success);
  font-weight: 600;
  margin-top: 0.2rem;
}
.mg-property-code {
  font-size: 0.82rem;
  color: var(--systemMg-secondary);
  margin: 0.4rem 0 0;
}
.mg-property-quick-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--systemMg-color-gray-300);
  border-bottom: 1px solid var(--systemMg-color-gray-300);
}
.mg-property-quick-spec {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-align: center;
}
.mg-property-quick-spec i {
  color: var(--systemMg-primary);
  font-size: 1.15rem;
}
.mg-property-quick-spec strong {
  font-size: 1.05rem;
}
.mg-property-quick-spec span {
  font-size: 0.78rem;
  color: var(--systemMg-secondary);
}
.mg-property-detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.mg-property-detail-actions .mg-btn {
  text-decoration: none;
}
.mg-property-whatsapp {
  background: #25d366 !important;
  border-color: #25d366 !important;
  color: #fff !important;
}
.mg-property-share {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--systemMg-secondary);
}
.mg-property-share a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--systemMg-secondary);
  color: var(--systemMg-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--systemMg-btn-transition);
}
.mg-property-share a:hover {
  background: var(--systemMg-primary);
  color: #fff;
}

/* ----- Tabs ----- */
.mg-property-tabs {
  margin-top: 2.5rem;
}
.mg-property-tab-list {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 2px solid var(--systemMg-color-gray-300);
  flex-wrap: wrap;
}
.mg-property-tab {
  background: none;
  border: none;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--systemMg-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: var(--systemMg-font);
}
.mg-property-tab.active {
  color: var(--systemMg-primary);
  border-bottom-color: var(--systemMg-primary);
}
.mg-property-tab-content {
  display: none;
  padding: 1.5rem 0;
  line-height: 1.7;
}
.mg-property-tab-content.active {
  display: block;
}
.mg-property-highlights {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 1rem;
}
.mg-property-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}
.mg-property-spec {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--systemMg-white);
  border: 1px solid var(--systemMg-color-gray-300);
  border-radius: 10px;
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mg-property-spec:hover {
  border-color: var(--systemMg-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.mg-property-spec-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 86, 179, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mg-property-spec-icon i {
  color: var(--systemMg-primary);
  font-size: 0.95rem;
}
.mg-property-spec-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  overflow-wrap: break-word;
}
.mg-property-spec-label {
  color: var(--systemMg-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.3;
}
.mg-property-spec-value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--systemMg-dark);
  line-height: 1.3;
  word-break: break-word;
}
.mg-property-amenities-title {
  font-size: 1.2rem;
  margin: 1.75rem 0 1rem;
}
.mg-property-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.mg-property-amenity {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  background: var(--systemMg-light);
  border: 1px solid var(--systemMg-color-gray-300);
  border-radius: 20px;
  font-size: 0.88rem;
}
.mg-property-amenity i {
  color: var(--systemMg-primary);
}
.mg-property-address {
  font-size: 1rem;
  margin: 0 0 1rem;
}
.mg-property-address i {
  color: var(--systemMg-primary);
  margin-right: 6px;
}
.mg-property-map {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}
.mg-property-map iframe {
  display: block;
  width: 100%;
  min-height: 380px;
  border: 0;
}

/* ----- Contacto / Lead ----- */
.mg-property-contact {
    margin-top: 1rem;
    padding: 2rem;
    background: var(--systemMg-light);
    border-radius: 14px;
}
.mg-property-contact-title {
    font-size: 1.4rem;
    margin: 0 0 0.4rem;
    text-align: center;
}
.mg-property-contact-subtitle {
    color: var(--systemMg-secondary);
    margin: 0 0 1.5rem;
    text-align: center;
}
.mg-property-contact-fallback {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.mg-property-contact-fallback .mg-btn {
  text-decoration: none;
}

/* ----- Relacionadas ----- */
.mg-property-related {
  margin-top: 3rem;
}
.mg-property-related-title {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
  padding: 0 20px;
}

/* ----- Responsive ----- */
@media screen and (max-width: 900px) {
  .mg-property-detail-layout {
    grid-template-columns: 1fr;
  }
  .mg-property-main-image img,
  .mg-property-placeholder {
    height: 320px;
  }
}
@media screen and (max-width: 600px) {
  .mg-property-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .mg-property-card-image {
    height: 200px;
  }
  .mg-property-detail-title {
    font-size: 1.4rem;
  }
  .mg-property-detail-price {
    font-size: 1.5rem;
  }
  .mg-property-contact {
    padding: 1.25rem;
  }
}
/* FIN CSS */