/* ==========================================================================
   2. MAID AT HOME WIDGET (ISOLATED DESIGN SYSTEM)
   ========================================================================== */

#mah-widget-root {
  --mah-font: "DM Sans";
  --mah-primary: #5a92b0;
  --mah-primary-hover: color-mix(in srgb, var(--mah-primary) 82%, black);
  /* Derived brand tints — computed from --mah-primary so custom branding
     propagates everywhere without JavaScript changes. */
  --mah-primary-dark: color-mix(in srgb, var(--mah-primary) 78%, #000000);
  --mah-primary-light: color-mix(in srgb, var(--mah-primary) 14%, #ffffff);
  --mah-primary-subtle: color-mix(in srgb, var(--mah-primary) 7%, #ffffff);
  --mah-accent: #7aa9be;
  --mah-secondary: #0f172a;
  --mah-text: #1e293b;
  --mah-text-muted: #64748b;
  --mah-text-light: #94a3b8;
  --mah-bg: #ffffff;
  --mah-surface: #f8fafc;
  --mah-surface-hover: #f1f5f9;
  --mah-border: #e2e8f0;
  --mah-border-hover: #cbd5e1;
  --mah-border-strong: #94a3b8;
  --mah-border-focus: var(--mah-primary);
  --mah-success: #10b981;
  --mah-success-bg: #ecfdf5;
  --mah-error: #ef4444;
  --mah-error-bg: #fef2f2;
  --mah-warning: #f59e0b;
  /* Spacing rhythm scale */
  --mah-space-1: 4px;
  --mah-space-2: 8px;
  --mah-space-3: 12px;
  --mah-space-4: 16px;
  --mah-space-5: 20px;
  --mah-space-6: 24px;
  --mah-space-8: 32px;
  --mah-radius-sm: 8px;
  --mah-radius-md: 12px;
  --mah-radius-lg: 18px;
  --mah-radius-full: 9999px;
  --mah-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --mah-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --mah-shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.12);
  --mah-shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  --mah-shadow-brand: 0 4px 12px color-mix(in srgb, var(--mah-primary) 25%, transparent);
  --mah-shadow-brand-lg: 0 8px 24px color-mix(in srgb, var(--mah-primary) 35%, transparent);
  --mah-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  font-family: var(--mah-font), system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--mah-text);
  box-sizing: border-box;
}

#mah-widget-root,
#mah-widget-root *,
#mah-widget-root *::before,
#mah-widget-root *::after {
  box-sizing: border-box;
}

/* Margin/padding reset uses :where() so it has ZERO specificity.
   Component classes (.mah-*) must always win over the reset, and the
   ID-prefix reset would otherwise nuke every padding in the widget. */
:where(#mah-widget-root) :where(*, *::before, *::after) {
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Floating Booking Bubble
   -------------------------------------------------------------------------- */
.mah-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999990;
  display: inline-flex;
  align-items: center;
  gap: var(--mah-space-3);
  background: linear-gradient(135deg, var(--mah-primary) 0%, var(--mah-primary-hover) 100%);
  color: #ffffff;
  padding: var(--mah-space-4) var(--mah-space-6);
  border-radius: var(--mah-radius-full) !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--mah-shadow-brand-lg), 0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  transition: var(--mah-transition);
  user-select: none;
  outline: none;
  animation: mah-bubble-appear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mah-bubble-appear {
  0% {
    transform: scale(0.6) translateY(20px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.mah-bubble:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--mah-primary) 45%, transparent), 0 4px 10px rgba(0, 0, 0, 0.12);
  filter: brightness(0.92);
}

.mah-bubble:focus-visible {
  outline: 3px solid var(--mah-accent);
  outline-offset: 3px;
}

.mah-bubble:active {
  transform: translateY(0) scale(0.98);
}

.mah-bubble-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mah-bubble-text {
  white-space: nowrap;
}

.mah-bubble-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  padding: 2px var(--mah-space-2);
  border-radius: var(--mah-radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Backdrop & Modal Container
   -------------------------------------------------------------------------- */
.mah-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999995;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--mah-space-4);
}

.mah-backdrop.mah-open {
  opacity: 1;
  visibility: visible;
}

.mah-modal {
  background: var(--mah-bg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  border-radius: var(--mah-radius-lg);
  box-shadow: var(--mah-shadow-xl);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transform: scale(0.94) translateY(12px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--mah-border);
}

.mah-backdrop.mah-open .mah-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Modal Header
   -------------------------------------------------------------------------- */
.mah-header {
  padding: var(--mah-space-5) var(--mah-space-6);
  border-bottom: 1px solid var(--mah-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--mah-bg);
  position: relative;
  z-index: 10;
}

.mah-brand {
  display: flex;
  align-items: center;
  gap: var(--mah-space-3);
}

.mah-brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--mah-primary), var(--mah-accent));
  color: #ffffff;
  border-radius: var(--mah-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.mah-brand-info h3 {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--mah-secondary);
  line-height: 1.2;
}

.mah-brand-info p {
  font-size: 0.75rem;
  color: var(--mah-text-muted);
}

.mah-header-actions {
  display: flex;
  align-items: center;
  gap: var(--mah-space-3);
}

.mah-price-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--mah-space-1);
  background: var(--mah-primary-light);
  color: var(--mah-primary-dark);
  padding: var(--mah-space-1) var(--mah-space-3);
  border-radius: var(--mah-radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--mah-primary) 20%, transparent);
  transition: var(--mah-transition);
}

.mah-price-pill.mah-updated {
  animation: mah-pulse-price 0.4s ease;
}

@keyframes mah-pulse-price {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); background: var(--mah-primary-light); }
  100% { transform: scale(1); }
}

.mah-close-btn {
  background: var(--mah-surface);
  border: 1px solid var(--mah-border);
  color: var(--mah-text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--mah-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--mah-transition);
}

.mah-close-btn:hover {
  background: var(--mah-surface-hover);
  color: var(--mah-text);
  border-color: var(--mah-border-hover);
}

.mah-close-btn:focus-visible {
  outline: 2px solid var(--mah-primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Progress Bar
   -------------------------------------------------------------------------- */
.mah-progress-container {
  padding: var(--mah-space-3) var(--mah-space-6) var(--mah-space-2);
  background: var(--mah-surface);
  border-bottom: 1px solid var(--mah-border);
}

.mah-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--mah-text-muted);
  margin-bottom: var(--mah-space-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mah-progress-track {
  width: 100%;
  height: 6px;
  background: var(--mah-border);
  border-radius: var(--mah-radius-full);
  overflow: hidden;
  position: relative;
}

.mah-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mah-primary), var(--mah-accent));
  border-radius: var(--mah-radius-full);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   Modal Body / Steps
   -------------------------------------------------------------------------- */
.mah-body {
  padding: var(--mah-space-6);
  overflow-y: auto;
  flex: 1;
  max-height: calc(90vh - 180px);
  scroll-behavior: smooth;
}

.mah-step {
  display: none;
  animation: mah-step-fade 0.25s ease forwards;
}

.mah-step.mah-active {
  display: block;
}

@keyframes mah-step-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mah-step-heading {
  margin-bottom: var(--mah-space-5);
}

.mah-step-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--mah-secondary);
  letter-spacing: -0.02em;
  margin-bottom: var(--mah-space-1);
}

.mah-step-subtitle {
  font-size: 0.875rem;
  color: var(--mah-text-muted);
}

/* Form Grid & Inputs */
.mah-form-grid {
  display: grid;
  gap: var(--mah-space-4);
}

.mah-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.mah-grid-3 {
  grid-template-columns: 2fr 1fr 1fr;
}

.mah-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--mah-space-2);
}

.mah-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mah-text);
  display: flex;
  align-items: center;
  gap: var(--mah-space-1);
}

.mah-label-optional {
  font-size: 0.75rem;
  color: var(--mah-text-light);
  font-weight: 400;
}

.mah-input,
.mah-select {
  width: 100%;
  padding: var(--mah-space-3) var(--mah-space-4);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--mah-text);
  background-color: var(--mah-bg) !important;
  border: 1px solid var(--mah-border) !important;
  border-radius: var(--mah-radius-md) !important;
  transition: var(--mah-transition);
  outline: none;
}

.mah-input:hover,
.mah-select:hover {
  border-color: var(--mah-border-hover);
}

.mah-input:focus,
.mah-select:focus {
  border-color: var(--mah-border-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mah-primary) 15%, transparent);
}

.mah-input.mah-error,
.mah-select.mah-error {
  border-color: var(--mah-error) !important;
  background-color: var(--mah-error-bg) !important;
}

.mah-input.mah-error:focus,
.mah-select.mah-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.mah-field-error {
  font-size: 0.75rem;
  color: var(--mah-error);
  font-weight: 500;
  display: none;
  margin-top: 2px;
}

.mah-field-error.mah-visible {
  display: block;
}

.mah-helper-text {
  font-size: 0.75rem;
  color: var(--mah-text-muted);
}

/* --------------------------------------------------------------------------
   Selection Cards (Property Type, Cleaning Type, Frequency)
   -------------------------------------------------------------------------- */
.mah-cards-grid {
  display: grid;
  gap: var(--mah-space-3);
}

.mah-cards-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.mah-cards-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.mah-option-card {
  border: 1.5px solid var(--mah-border);
  border-radius: var(--mah-radius-md);
  padding: var(--mah-space-3) var(--mah-space-4);
  background: #ffffff;
  cursor: pointer;
  transition: var(--mah-transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  user-select: none;
}

.mah-option-card:hover {
  border-color: var(--mah-border-strong);
  background: var(--mah-surface);
}

.mah-option-card.mah-selected {
  border-color: var(--mah-primary);
  background: var(--mah-primary-subtle);
  box-shadow: 0 0 0 1px var(--mah-primary);
}

.mah-option-info {
  display: flex;
  flex-direction: column;
}

.mah-option-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--mah-text);
}

.mah-option-card.mah-selected .mah-option-title {
  color: var(--mah-primary-dark);
}

.mah-option-desc {
  font-size: 0.75rem;
  color: var(--mah-text-muted);
  margin-top: 2px;
}

.mah-option-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px var(--mah-space-2);
  border-radius: var(--mah-radius-full);
  background: var(--mah-primary-light);
  color: var(--mah-primary-dark);
}

/* --------------------------------------------------------------------------
   Add-ons Cards Grid
   -------------------------------------------------------------------------- */
.mah-addons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--mah-space-3);
}

.mah-addon-card {
  border: 1.5px solid var(--mah-border);
  border-radius: var(--mah-radius-md);
  padding: var(--mah-space-3) var(--mah-space-4);
  background: #ffffff;
  cursor: pointer;
  transition: var(--mah-transition);
  display: flex;
  align-items: flex-start;
  gap: var(--mah-space-3);
  user-select: none;
}

.mah-addon-card:hover {
  border-color: #94a3b8;
  background: var(--mah-surface);
}

.mah-addon-card.mah-selected {
  border-color: var(--mah-primary);
  background: var(--mah-primary-subtle);
}

.mah-addon-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--mah-border);
  border-radius: 4px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--mah-transition);
  flex-shrink: 0;
  background: #ffffff;
}

.mah-addon-card.mah-selected .mah-addon-checkbox {
  background: var(--mah-primary);
  border-color: var(--mah-primary);
  color: #ffffff;
}

.mah-addon-checkbox svg {
  display: none;
  width: 12px;
  height: 12px;
  stroke: #ffffff;
  stroke-width: 3;
}

.mah-addon-card.mah-selected .mah-addon-checkbox svg {
  display: block;
}

.mah-addon-details {
  flex: 1;
}

.mah-addon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--mah-space-2);
}

.mah-addon-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mah-text);
}

.mah-addon-price {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--mah-primary-dark);
  background: var(--mah-primary-light);
  padding: 2px var(--mah-space-2);
  border-radius: 6px;
}

.mah-addon-desc {
  font-size: 0.75rem;
  color: var(--mah-text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Step 7: Review Summary Card
   -------------------------------------------------------------------------- */
.mah-summary-card {
  background: var(--mah-surface);
  border: 1px solid var(--mah-border);
  border-radius: var(--mah-radius-md);
  padding: var(--mah-space-4);
  margin-bottom: var(--mah-space-5);
}

.mah-summary-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mah-text-muted);
  margin-bottom: var(--mah-space-3);
  border-bottom: 1px solid var(--mah-border);
  padding-bottom: var(--mah-space-2);
}

.mah-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: var(--mah-space-2);
}

.mah-summary-label {
  color: var(--mah-text-muted);
}

.mah-summary-value {
  font-weight: 600;
  color: var(--mah-text);
  text-align: right;
  max-width: 60%;
}

.mah-summary-total-row {
  margin-top: var(--mah-space-3);
  padding-top: var(--mah-space-3);
  border-top: 1.5px dashed var(--mah-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mah-summary-total-label {
  font-size: 1rem;
  font-weight: 800;
  color: var(--mah-secondary);
}

.mah-summary-total-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--mah-primary-dark);
}

/* Terms Checkbox */
.mah-terms-group {
  margin-bottom: var(--mah-space-4);
}

.mah-terms-label {
  display: flex;
  align-items: flex-start;
  gap: var(--mah-space-3);
  font-size: 0.825rem;
  color: var(--mah-text-muted);
  cursor: pointer;
  user-select: none;
}

.mah-terms-checkbox {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--mah-primary);
  cursor: pointer;
}

.mah-terms-label a {
  color: var(--mah-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Turnstile Container */
.mah-turnstile-wrap {
  min-height: 65px;
  margin-bottom: var(--mah-space-4);
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--mah-surface);
  border-radius: var(--mah-radius-md);
  padding: var(--mah-space-2);
  border: 1px dashed var(--mah-border);
}

/* Alert Notification Banner */
.mah-alert {
  padding: var(--mah-space-3) var(--mah-space-4);
  border-radius: var(--mah-radius-md);
  font-size: 0.85rem;
  margin-bottom: var(--mah-space-4);
  display: none;
  align-items: flex-start;
  gap: var(--mah-space-3);
  line-height: 1.4;
}

.mah-alert.mah-visible {
  display: flex;
}

.mah-alert-error {
  background: var(--mah-error-bg);
  border: 1px solid color-mix(in srgb, var(--mah-error) 40%, transparent);
  color: color-mix(in srgb, var(--mah-error) 78%, #000000);
}

.mah-alert-success {
  background: var(--mah-success-bg);
  border: 1px solid color-mix(in srgb, var(--mah-success) 40%, transparent);
  color: color-mix(in srgb, var(--mah-success) 72%, #000000);
}

/* --------------------------------------------------------------------------
   Modal Footer / Navigation
   -------------------------------------------------------------------------- */
.mah-footer {
  padding: var(--mah-space-4) var(--mah-space-6);
  border-top: 1px solid var(--mah-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--mah-bg);
}

.mah-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mah-space-2);
  padding: var(--mah-space-3) var(--mah-space-5);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--mah-radius-md) !important;
  cursor: pointer;
  transition: var(--mah-transition);
  outline: none;
  border: none;
  user-select: none;
  min-height: 44px;
}

.mah-btn:focus-visible {
  outline: 2px solid var(--mah-primary);
  outline-offset: 2px;
}

.mah-btn-secondary {
  background: var(--mah-surface);
  border: 1px solid var(--mah-border);
  color: var(--mah-text);
}

.mah-btn-secondary:hover {
  background: var(--mah-surface-hover);
  border-color: var(--mah-border-hover);
}

.mah-btn-primary {
  background: linear-gradient(135deg, var(--mah-primary), var(--mah-primary-hover));
  color: #ffffff;
  box-shadow: var(--mah-shadow-brand);
  margin-left: auto;
}

.mah-btn-primary:hover {
  background: linear-gradient(135deg, var(--mah-primary-hover), color-mix(in srgb, var(--mah-primary-hover) 82%, #000000));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--mah-primary) 35%, transparent);
  transform: translateY(-1px);
}

.mah-btn-primary:active {
  transform: translateY(0);
}

.mah-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.mah-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: mah-spin 0.8s linear infinite;
  display: none;
}

.mah-submitting .mah-spinner {
  display: inline-block;
}

.mah-submitting .mah-btn-text {
  opacity: 0.8;
}

@keyframes mah-spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Success View
   -------------------------------------------------------------------------- */
.mah-success-view {
  text-align: center;
  padding: var(--mah-space-6) var(--mah-space-2);
  display: none;
}

.mah-success-view.mah-active {
  display: block;
}

.mah-success-icon-wrap {
  width: 70px;
  height: 70px;
  background: var(--mah-success-bg);
  border: 2px solid color-mix(in srgb, var(--mah-success) 45%, transparent);
  border-radius: 50%;
  color: var(--mah-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
  animation: mah-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes mah-pop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.mah-success-view h3 {
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  color: var(--mah-secondary);
  margin-bottom: var(--mah-space-2);
}

.mah-success-view p {
  color: var(--mah-text-muted);
  font-size: 0.95rem;
  max-width: 400px;
  margin: 0 auto 24px;
}

/* --------------------------------------------------------------------------
   Responsive Layout (Mobile, Tablet, Desktop)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .mah-bubble {
    bottom: 16px;
    right: 16px;
    padding: var(--mah-space-3) var(--mah-space-4);
    font-size: 0.9rem;
  }

  .mah-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .mah-modal {
    max-width: 100%;
    max-height: 94vh;
    border-radius: var(--mah-radius-lg) var(--mah-radius-lg) 0 0;
    border-bottom: none;
    transform: translateY(100%);
  }

  .mah-backdrop.mah-open .mah-modal {
    transform: translateY(0);
  }

  .mah-header {
    padding: var(--mah-space-4) var(--mah-space-5);
  }

  .mah-body {
    padding: var(--mah-space-5);
    max-height: calc(94vh - 160px);
  }

  .mah-footer {
    padding: var(--mah-space-4) var(--mah-space-5);
    gap: var(--mah-space-3);
  }

  .mah-footer .mah-btn {
    flex: 1;
    min-width: 0;
  }

  .mah-grid-2,
  .mah-grid-3 {
    grid-template-columns: 1fr;
  }

  .mah-cards-grid-2,
  .mah-cards-grid-3,
  .mah-addons-grid {
    grid-template-columns: 1fr;
  }

  .mah-step-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 380px) {
  .mah-bubble-text {
    font-size: 0.85rem;
  }
  .mah-bubble {
    gap: var(--mah-space-2);
    padding: var(--mah-space-3) var(--mah-space-4);
  }
  .mah-brand-info p {
    display: none;
  }
  .mah-body {
    padding: var(--mah-space-4);
  }
  .mah-header {
    padding: var(--mah-space-3) var(--mah-space-4);
  }
  .mah-footer {
    padding: var(--mah-space-3) var(--mah-space-4);
  }
}

/* --------------------------------------------------------------------------
   Hostile Host CSS Defense (scoped, minimal !important)
   Guarantees core structure survives aggressive host element selectors.
   -------------------------------------------------------------------------- */
#mah-widget-root p {
  margin: 0 !important;
}

.mah-success-view p {
  margin: 0 auto 24px !important;
}

.mah-brand-info p {
  margin: 0 !important;
}

#mah-widget-root h3 {
  margin: 0;
}

.mah-success-view h3 {
  margin: 0 0 8px !important;
}

#mah-widget-root a {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .mah-bubble,
  .mah-step,
  .mah-success-icon-wrap {
    animation: none !important;
  }

  .mah-backdrop,
  .mah-modal,
  .mah-btn,
  .mah-option-card,
  .mah-addon-card,
  .mah-input,
  .mah-select,
  .mah-progress-fill,
  .mah-bubble {
    transition: none !important;
  }

  .mah-backdrop.mah-open .mah-modal {
    transform: none;
  }

  .mah-spinner {
    animation-duration: 1.5s;
  }
}
