/* Modal/bottom-sheet and CTA styles for the mobile tap-to-open experience */
/* Scope: mobile (<=768px). Desktop unaffected. */

/* Full-width elevated CTA rendered inline in #mp-widget on mobile */
@media (max-width: 768px) {
  #mp-widget .mp-cta-button {
    display: block;
    width: 100%;
    min-height: 52px; /* >= 48px touch target */
    padding: 14px 18px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--mp-primary, #1b75ff), var(--mp-primary-2, #4aa3ff));
    box-shadow: 0 8px 20px rgba(27,117,255,0.28);
    cursor: pointer;
  }
  #mp-widget .mp-cta-button:focus-visible { outline: 2px solid var(--mp-primary, #1b75ff); outline-offset: 2px; }
}

/* Body scroll lock while sheet is open */
html.mp-sheet-open,
body.mp-sheet-open { overflow: hidden; touch-action: none; overscroll-behavior: none; }

/* Backdrop */
#mp-sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(9,12,20,0.50);
  backdrop-filter: saturate(120%) blur(10px);
  opacity: 0; transition: opacity 200ms ease; pointer-events: none; z-index: 2147483000; /* above site chrome */
}
#mp-sheet-backdrop.open { opacity: 1; pointer-events: auto; }

/* Full-viewport modal container */
#mp-sheet {
  position: fixed; inset: 0;
  width: 100vw;
  background:
    radial-gradient(100% 60% at 50% 0%, rgba(58,166,255,.06), transparent 50%),
    linear-gradient(180deg, #101a2e 0%, #0f172a 100%);
  background-color: #0f172a; /* ensure fully opaque base */
  border-radius: 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,.55);
  height: 100dvh; /* modern browsers */
  min-height: 100svh; /* mobile safari fallback */
  /* fallback for older browsers below */
  height: 100vh;
  transform: translateY(8%);
  opacity: 0;
  transition: transform 280ms cubic-bezier(.22,.61,.36,1), opacity 220ms ease;
  will-change: transform, opacity;
  z-index: 2147483001; /* above backdrop and any site headers */
  display: grid;
  grid-template-rows: auto 1fr;
  outline: none;
  /* Gutters respect safe areas on modern phones */
  --mp-gutter-l: max(12px, env(safe-area-inset-left, 0px));
  --mp-gutter-r: max(12px, env(safe-area-inset-right, 0px));
}
#mp-sheet.open { transform: translateY(0); opacity: 1; }

/* Header with sticky behavior inside sheet */
#mp-sheet .mp-sheet-header {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px 16px;
  background: linear-gradient(180deg, #101a2e, #0f172a); /* fully opaque to prevent page peeking */
  border-bottom: 1px solid var(--mp-border, #1e293b);
  color: #e6ecff;
}
#mp-sheet .mp-sheet-title { font-weight: 800; font-size: 16px; }
#mp-sheet .mp-sheet-handle {
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: #2a3754;
  opacity: .85;
  margin: 6px auto;
}
#mp-sheet .mp-sheet-close {
  width: 44px; height: 44px; border: 1px solid var(--mp-border, #1e293b); border-radius: 12px;
  background: #0c1427; color: #e6ecff; cursor: pointer;
}
#mp-sheet .mp-sheet-close:active { background: #e7efff; }

/* Content area where mobile widget mounts */
  #mp-sheet .mp-sheet-body {
    /* #mp-sheet already uses 100dvh; ensure child can scroll within grid */
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-left: var(--mp-gutter-l);
    padding-right: var(--mp-gutter-r);
    padding-top: 0;
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
  }

/* Hide internal preview/header bar from widget inside modal */
#mp-sheet #mp-widget .mp-header { display: none !important; }

/* Tabs container (scrollable pills below header) */
#mp-sheet #mp-widget .mp-tabs {
  position: sticky;
  top: 0;
  z-index: 1;
  display: block;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-bottom: 1px solid var(--mp-border, #1e293b);
  background: linear-gradient(180deg, rgba(16,26,46,.92), rgba(15,23,42,.76));
  margin-left: calc(-1 * var(--mp-gutter-l));
  margin-right: calc(-1 * var(--mp-gutter-r));
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 16px;
  padding-right: 16px;
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(16,24,40,0.3);
}
#mp-sheet #mp-widget .mp-tabs__track {
  display: inline-flex;
  gap: 10px;
  min-width: 100%;
}
#mp-sheet #mp-widget .mp-tabs__track .mp-step,
#mp-sheet #mp-widget .mp-tabs__track .mp-tab {
  flex: 0 0 auto;
  scroll-snap-align: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--mp-border, #1e293b);
  background: #0b1426;
  color: #c9d3e6;
}

/* When mounted inside the sheet, keep mini-cart within the sheet body instead of viewport */
#mp-sheet #mp-widget .mp-mini-cart {
  position: sticky; /* stick to bottom of scrollable sheet body */
  left: auto; right: auto;
  bottom: 0;
  transform: none !important; /* cancel translate trick used for viewport-fixed variant */
  transition: none !important; /* always visible; no slide-in/out animation */
  box-shadow: 0 -8px 24px rgba(16,34,90,0.12);
  z-index: 2; /* above content within sheet body */
  width: 100%;
  margin-left: 0; margin-right: 0;
  border-left: 0; border-right: 0;
}
/* Hide in-sheet mini-cart when fixed layer is active (single CTA visible) */
body.mp-sticky-fixed-active #mp-sheet #mp-widget .mp-mini-cart { display: none !important; }

/* Ensure internal layout leaves space for the sticky mini-cart inside sheet */
#mp-sheet #mp-widget .mp-container {
  padding-bottom: calc(var(--mp-sticky-h, 0) + max(env(safe-area-inset-bottom), 0px)); /* JS updates --mp-sticky-h */
}

/* Safe-area + sticky clearance inside sheet scroll area */
#mp-sheet .mp-sheet-body {
  padding-bottom: calc(var(--mp-sticky-h, 0) + max(env(safe-area-inset-bottom), 12px));
  scroll-padding-bottom: calc(var(--mp-sticky-h, 0) + max(env(safe-area-inset-bottom), 12px) + 16px);
}

/* Demo parity: enforce dark premium theme for content mounted inside the modal sheet */
@media (max-width: 768px) {
  #mp-sheet #mp-widget {
    /* Fixed comfortable gap between drawer and fixed mini-cart */
    --mp-drawer-gap: 16px;
    --mp-bg: #0b1220;
    --mp-card: #0f172a;
    --mp-elev: #0d1324;
    --mp-ink: #e6ecff;
    --mp-text: var(--mp-ink);
    --mp-muted: #93a4c6;
    --mp-primary: #2b8aeb;
    --mp-primary-2: #25c2ff;
    --mp-border: #1e293b;
    --mp-shadow: 0 24px 80px rgba(7,16,35,.65);
    color: var(--mp-ink);
    background: linear-gradient(180deg,#0a1222,#0b1529 40%,#0a1326);
  }
  #mp-sheet #mp-widget .mp-mini-cart {
    background: rgba(12,20,39,.88);
    backdrop-filter: blur(10px) saturate(150%);
    border-top: 1px solid var(--mp-border);
    box-shadow: 0 -8px 24px rgba(7,16,35,.45);
    color: var(--mp-ink);
  }
  #mp-sheet #mp-widget .mp-btn {
    color: #061124;
    font-weight: 900;
    background: linear-gradient(135deg,#79c9ff,#4ea8ff,#2b8aeb);
    box-shadow: 0 10px 30px rgba(43,138,235,.45);
  }
  #mp-sheet #mp-widget .mp-stepper .mp-step[aria-selected="true"] {
    color: var(--mp-ink);
    background: rgba(37,194,255,.12);
    border-color: transparent;
    box-shadow: inset 0 -2px 0 var(--mp-primary);
    font-weight: 800;
  }
  #mp-sheet #mp-widget .mp-row,
  #mp-sheet #mp-widget .mp-card {
    background: linear-gradient(180deg,#0f172a,#0e1629);
    border: 1px solid var(--mp-border);
    color: var(--mp-ink);
    box-shadow: var(--mp-shadow);
    border-radius: 16px;
    padding: 12px;
  }
  #mp-sheet #mp-widget .mp-price-old { color: #8aa0c8; }
  #mp-sheet #mp-widget .mp-price-new { color: #d9e7ff; }
  #mp-sheet #mp-widget .mp-badge-save {
    background: rgba(34,181,115,.14);
    color: #3ddc97;
    border: 1px solid rgba(34,181,115,.35);
    font-size: .82rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
  }
}

/* Global fixed mini-cart layer appended to <body> (robust across transforms/overflow) */
@media (max-width: 768px) {
  #mp-sticky-fixed {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 2147483647; /* above everything */
    padding: 0 max(env(safe-area-inset-right, 0px), 0px) calc(12px + env(safe-area-inset-bottom, 0px)) max(env(safe-area-inset-left, 0px), 0px);
    pointer-events: none; /* allow only inner elements to receive events */
    display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-left: 16px; padding-right: 16px;
    background: rgba(12,20,39,.92);
    backdrop-filter: blur(14px) saturate(150%);
    box-shadow: 0 -14px 44px rgba(7,16,35,.45);
    border-top: 1px solid var(--mp-border, #1e293b);
  }
  #mp-sticky-fixed > * { pointer-events: auto; }
  #mp-sticky-fixed .mp-mini { display: grid; gap: 4px; }
  #mp-sticky-fixed .mp-mini .mp-mini-sub { color: #b8c4de; font-size: .95rem; font-weight: 600; white-space: nowrap; }
  #mp-sticky-fixed .val-total { font-weight: 900; }
  #mp-sticky-fixed .val-show {
    flex: 0 0 auto;
    white-space: nowrap;
    height: 36px; min-width: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 12px; border-radius: 999px; cursor: pointer; user-select: none;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(12,20,39,.6);
    color: #dbe7ff;
    transition: box-shadow .18s ease, background-color .18s ease, transform .06s ease;
  }
  #mp-sticky-fixed .val-show:hover { background: rgba(12,20,39,.74); box-shadow: 0 0 0 3px rgba(58,166,255,.10) inset; }
  #mp-sticky-fixed .val-show:active { transform: translateY(1px); }
  #mp-sticky-fixed .val-show:focus { outline: none; box-shadow: 0 0 0 3px rgba(58,166,255,.20); }
  #mp-sticky-fixed .val-discount {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .82rem; padding: 2px 8px; border-radius: 999px;
    background: rgba(34,181,115,.16); color: #3ee29b; border: 1px solid rgba(34,181,115,.38);
    font-variant-numeric: tabular-nums;
  }
  #mp-sticky-fixed .val-cta {
    margin-left: auto; padding: 12px 18px; border-radius: 14px; border: none;
    font-weight: 800; color: #001428; background: linear-gradient(90deg, #3aa6ff, #6ee7ff);
    box-shadow: 0 6px 20px rgba(58,166,255,.45); text-decoration: none;
  }
  #mp-sticky-fixed .val-cta:active { transform: translateY(1px); }
}

/* Remove extra step footer buttons when sheet open to avoid duplicate CTA */
@media (max-width: 768px) {
  body.mp-sticky-fixed-active #mp-sheet #mp-widget .mp-step-nav { display: none !important; }
}

/* Premium mobile bottom-sheet refinements (dark, glossy, immersive) */
@media (max-width: 768px) {
  /* Stronger dim + blur for immersive backdrop */
  #mp-sheet-backdrop {
    background: rgba(9,12,20,0.55);
    backdrop-filter: saturate(140%) blur(16px);
  }

  /* Solid sheet with premium motion */
  #mp-sheet {
    background:
      radial-gradient(120% 70% at 50% 0%, rgba(76,156,255,.08), transparent 52%),
      linear-gradient(180deg, #0e1830 0%, #0d1730 60%, #0c162e 100%);
    transition: transform 320ms cubic-bezier(.22,.9,.24,1), opacity 260ms ease;
  }
  #mp-sheet .mp-sheet-header {
    backdrop-filter: saturate(120%) blur(10px);
  }
  #mp-sheet .mp-sheet-title {
    font-weight: 900;
    letter-spacing: .1px;
  }
  #mp-sheet .mp-sheet-close {
    transition: background-color .15s ease, transform .08s ease;
  }
  #mp-sheet .mp-sheet-close:active {
    transform: translateY(1px);
  }

  /* Tabs: pill shape + subtle underline emphasis */
  #mp-sheet #mp-widget .mp-stepper .mp-step {
    border-radius: 999px;
    padding: 8px 14px;
  }
  #mp-sheet #mp-widget .mp-stepper .mp-step[aria-selected="true"] {
    box-shadow: inset 0 -2px 0 var(--mp-primary);
  }

  /* Cards: dark, slightly glossy with gentle shadows */
  #mp-sheet #mp-widget .mp-row,
  #mp-sheet #mp-widget .mp-card {
    position: relative;
    background: linear-gradient(180deg, #0f172a, #0d1526);
    border: 1px solid var(--mp-border);
    box-shadow: 0 20px 60px rgba(7,16,35,.45);
    border-radius: 16px;
  }
  #mp-sheet #mp-widget .mp-row::before,
  #mp-sheet #mp-widget .mp-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0) 40%);
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: .35;
  }

  /* Price emphasis and savings chip */
  #mp-sheet #mp-widget .mp-price-new {
    color: #eaf2ff;
    text-shadow: 0 1px 0 rgba(255,255,255,.06);
  }
  #mp-sheet #mp-widget .mp-badge-save {
    background: rgba(34,181,115,.16);
    color: #3ee29b;
    border-color: rgba(34,181,115,.38);
  }
  #mp-sheet #mp-widget .mp-discount-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(34,181,115,.16);
    color: #3ee29b;
    border: 1px solid rgba(34,181,115,.38);
    font-variant-numeric: tabular-nums;
  }

  /* Time pill aligns with premium contrasts */
  #mp-sheet #mp-widget .mp-pill.mp-timechip {
    background: #0c1427;
    color: #9db6e8;
    border: 1px solid #2a3a59;
  }

  /* Quantity: comfortable one-handed taps */
  #mp-sheet #mp-widget .mp-qty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: saturate(120%) blur(2px);
  }
  #mp-sheet #mp-widget .mp-qty-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--mp-border);
    background: #0b1426;
    color: #dbe7ff;
    display: grid; place-items: center;
    transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease;
  }
  #mp-sheet #mp-widget .mp-qty-btn:active { transform: translateY(1px); }

  /* Sticky mini-cart: translucent dark with blur */
  #mp-sheet #mp-widget .mp-mini-cart {
    background: rgba(12,20,39,.90);
    backdrop-filter: blur(14px) saturate(150%);
    border-top: 1px solid var(--mp-border);
    padding-left: var(--mp-gutter-l);
    padding-right: var(--mp-gutter-r);
    transition: none !important; /* remain docked; no motion on state changes */
  }
  #mp-sheet #mp-widget #mp-sticky-total {
    font-weight: 1000;
    font-variant-numeric: tabular-nums;
  }
  #mp-sheet #mp-widget #mp-sticky-time,
  #mp-sheet #mp-widget #mp-sticky-count { font-variant-numeric: tabular-nums; }
  #mp-sheet #mp-widget #mp-sticky-discount { /* ensure mini-cart discount chip gets premium style */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(34,181,115,.16);
    color: #3ee29b;
    border: 1px solid rgba(34,181,115,.38);
  }

  /* Drawer polish inside sheet */
  #mp-sheet #mp-widget .mp-drawer {
    box-shadow: 0 -24px 60px rgba(7,16,35,.6);
  }

  /* Focus rings for accessibility */
  #mp-sheet #mp-widget .mp-tab:focus,
  #mp-sheet #mp-widget .mp-step:focus,
  #mp-sheet #mp-widget .mp-qty-btn:focus,
  #mp-sheet .mp-sheet-close:focus,
  #mp-sheet #mp-widget .mp-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(58,166,255,.20);
  }
}

/* Polished breakdown drawer styling */
@media (max-width: 768px) {
  #mp-sheet #mp-widget .mp-drawer {
    background: linear-gradient(180deg, #0f172a, #0d162c);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-top: 1px solid rgba(255,255,255,.06);
  }
  #mp-sheet #mp-widget .mp-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px 6px;
    color: #e6ecff;
  }
  #mp-sheet #mp-widget .mp-drawer-title { font-weight: 900; font-size: 14px; }
  #mp-sheet #mp-widget .mp-drawer-close {
    appearance: none; border: 0; width: 36px; height: 36px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    background: #0c1427; color: #e6ecff;
    transition: background-color .15s ease, transform .06s ease;
  }
  #mp-sheet #mp-widget .mp-drawer-close:active { transform: translateY(1px); }

  /* Compact, colorful summary block */
  #mp-sheet #mp-widget .mp-drawer-body { padding: 10px 12px 12px; }
  #mp-sheet #mp-widget .mp-breakdown {
    margin: 6px 0 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(37,194,255,.10), rgba(100,190,255,.06));
    border: 1px solid rgba(80,120,200,.22);
  }
  #mp-sheet #mp-widget .mp-breakdown .mp-break-row {
    display: grid; grid-template-columns: 1fr auto; align-items: center;
    padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.06);
  }
  #mp-sheet #mp-widget .mp-breakdown .mp-break-row:last-child { border-bottom: 0; }
  /* Left label chip for first row (Brutto) */
  #mp-sheet #mp-widget .mp-breakdown .mp-break-row:first-child span:first-child {
    display: inline-flex; align-items: center; height: 20px; line-height: 20px; padding: 0 8px; border-radius: 999px;
    background: rgba(37,194,255,.14); color: #bfe3ff; border: 1px solid rgba(37,194,255,.25);
    font-size: 12px; font-weight: 700;
  }
  /* Green chip for discount value */
  #mp-sheet #mp-widget .mp-breakdown .mp-break-row:nth-child(2) span:last-child {
    display: inline-flex; align-items: center; height: 22px; line-height: 22px; padding: 0 8px; border-radius: 999px;
    background: rgba(34,181,115,.16); color: #3ee29b; border: 1px solid rgba(34,181,115,.38);
    font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
  }

  /* Lines list */
  #mp-sheet #mp-widget .mp-lines { display: grid; gap: 8px; }
  #mp-sheet #mp-widget .mp-line {
    display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: 12px; background: #0f182c; border: 1px solid rgba(255,255,255,.06);
  }
  #mp-sheet #mp-widget .mp-qtyx {
    display: inline-flex; align-items: center; height: 18px; line-height: 18px; padding: 0 6px; border-radius: 999px;
    font-size: 11px; margin-left: 6px; background: #0c1427; color: #9db6e8; border: 1px solid #2a3a59;
  }
  #mp-sheet #mp-widget .mp-mins {
    display: inline-flex; align-items: center; height: 20px; line-height: 20px; padding: 0 8px; border-radius: 999px;
    font-size: 12px; background: #0c1427; color: #9db6e8; border: 1px solid #2a3a59;
  }
  #mp-sheet #mp-widget .mp-line-total { font-weight: 900; font-variant-numeric: tabular-nums; }
}

/* Slim, compact service cards inside mobile sheet */
@media (max-width: 768px) {
  /* Tight vertical rhythm between cards */
  #mp-sheet #mp-widget .mp-grid.mp-grid-1col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    grid-auto-flow: row;
    grid-auto-rows: max-content;
  }

  /* Slim row: flat, compact, two-column layout */
  #mp-sheet #mp-widget .mp-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px; /* 8–12px tight padding */
    border-radius: 12px; /* slightly rounded 12–16px */
    background: #0f172a; /* flat dark surface */
    border: 1px solid var(--mp-border);
    box-shadow: none; /* flat, professional */
    min-height: 64px; /* compact but comfortable */
  }
  /* Remove glossy overlay for a flatter look */
  #mp-sheet #mp-widget .mp-row::before { content: none !important; }

  /* Left: title above, meta below */
  #mp-sheet #mp-widget .mp-title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
    margin: 0 0 4px 0; /* small space above meta line */
    color: var(--mp-ink);
  }
  #mp-sheet #mp-widget .mp-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap; /* wrap gracefully if space gets tight */
    color: var(--mp-muted);
  }
  /* Base price renders as plain text on dark theme (no pill background) */
  #mp-sheet #mp-widget .mp-pricechip {
    font-weight: 900;
    color: #eaf2ff;
    background: transparent;
    border: 0;
    padding: 0;
  }
  /* Price line: old (muted/struck), new (bold/bright), save chip */
  #mp-sheet #mp-widget .mp-price-old {
    color: #8aa0c8;
    text-decoration: line-through;
    font-weight: 600;
    font-size: 12px;
  }
  #mp-sheet #mp-widget .mp-price-new {
    color: #eaf2ff;
    font-weight: 900;
    font-size: 15px;
  }
  #mp-sheet #mp-widget .mp-badge-save {
    height: 20px;
    line-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
  }
  #mp-sheet #mp-widget .mp-pill.mp-timechip {
    height: 20px;
    line-height: 20px;
    padding: 0 8px;
    font-size: 12px;
  }
  /* Optional phase badge: keep small so it doesn't increase card height */
  #mp-sheet #mp-widget .mp-badge-phase {
    height: 20px;
    line-height: 20px;
    padding: 0 8px;
    font-size: 11px;
  }

  /* Right: large thumb-friendly +/- with compact center value */
  #mp-sheet #mp-widget .mp-qty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    min-height: 32px; /* slim pill height */
    border-radius: 999px;
    border: 1px solid var(--mp-border);
    background: #0b1426;
    white-space: nowrap;
    transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
  }
  #mp-sheet #mp-widget .mp-qty.active {
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 2px rgba(37,194,255,.14);
    background: linear-gradient(180deg, #0b1529, #0b1326);
  }
  #mp-sheet #mp-widget .mp-qty.pulse { animation: mp-qty-pulse 180ms ease-out; }
  @keyframes mp-qty-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37,194,255,0); }
    50% { box-shadow: 0 0 0 3px rgba(37,194,255,.18); }
    100% { box-shadow: 0 0 0 0 rgba(37,194,255,0); }
  }
  #mp-sheet #mp-widget .mp-qty-btn {
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: #dbe7ff;
    display: grid; place-items: center;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: transform .06s ease, background-color .15s ease, color .15s ease;
  }
  #mp-sheet #mp-widget .mp-qty-btn:hover { background: rgba(255,255,255,.04); }
  #mp-sheet #mp-widget .mp-qty-btn:active { transform: translateY(1px); }
  #mp-sheet #mp-widget .mp-qty-btn[disabled] {
    opacity: .45;
    cursor: default;
    background: transparent;
  }
  #mp-sheet #mp-widget .mp-qty-input {
    width: 36px;
    font-size: 14px;
    font-weight: 800;
    color: var(--mp-ink);
    background: transparent;
    border: 0;
    text-align: center;
    padding: 0;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  /* Hide number input spinners */
  #mp-sheet #mp-widget .mp-qty-input::-webkit-outer-spin-button,
  #mp-sheet #mp-widget .mp-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
  }
  #mp-sheet #mp-widget .mp-qty-input[type=number] { -moz-appearance: textfield; }

  /* If hint exists, render as tiny pill so it doesn't bloat height */
  #mp-sheet #mp-widget .mp-hint {
    display: inline-flex;
    align-items: center;
    height: 18px;
    line-height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 10px;
    margin-top: 4px;
    background: #0c1427;
    border: 1px solid #2a3a59;
    color: #9db6e8;
  }
}

/* Flatten outer section card so each service row is the visual "card" */
@media (max-width: 768px) {
  #mp-sheet #mp-widget .mp-card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  #mp-sheet #mp-widget .mp-card::before { content: none !important; }
  /* Phase label compact, does not add excess height */
  #mp-sheet #mp-widget .mp-phase {
    color: var(--mp-muted);
    font-weight: 700;
    font-size: 12px;
    margin: 6px 0;
  }
}
/* Permanent control-center bar: keep mini-cart always above content and drawer */
@media (max-width: 768px) {
  /* Mini-cart stays pinned on top of everything inside the sheet scroll area */
  #mp-sheet #mp-widget .mp-mini-cart {
    position: sticky;
    bottom: 0;
    z-index: 100; /* above drawer and its backdrop */
  }

  /* Drawer leaves space for the fixed bar and a comfortable gap */
  #mp-sheet #mp-widget .mp-drawer {
    bottom: calc(var(--mp-sticky-h, 0) + var(--mp-drawer-gap, 10px));
    z-index: 90;
  }
  /* Drawer body padding respects sticky height + safe-area + gap */
  #mp-sheet #mp-widget .mp-drawer-body {
    padding-bottom: calc(var(--mp-sticky-h, 0) + max(env(safe-area-inset-bottom), 12px) + var(--mp-drawer-gap, 16px));
    scroll-padding-bottom: calc(var(--mp-sticky-h, 0) + max(env(safe-area-inset-bottom), 12px) + var(--mp-drawer-gap, 16px));
  }
  #mp-sheet #mp-widget .mp-drawer-body { padding-bottom: calc(var(--mp-sticky-h, 0) + max(env(safe-area-inset-bottom), 12px)); }

  /* Backdrop also leaves the bottom bar unobstructed */
  #mp-sheet #mp-widget .mp-drawer-backdrop,
  #mp-sheet #mp-widget #mp-drawer-backdrop {
    position: fixed;
    left: 0; right: 0; top: 0;
    bottom: 0;
    z-index: 80;
  }
}

/* Edge-to-edge layout overrides when widget is mounted inside modal sheet */
@media (max-width: 768px) {
  /* Remove boxed width/padding from inner widget; gutters are on the sheet body */
  #mp-sheet #mp-widget {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Avoid double side padding inside the container (sheet body already provides gutters) */
  #mp-sheet #mp-widget .mp-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Align core sections to sheet gutters */
  #mp-sheet .mp-sheet-body > #mp-widget > .mp-header,
  #mp-sheet .mp-sheet-body > #mp-widget > .mp-tabs,
  #mp-sheet .mp-sheet-body > #mp-widget > .mp-container,
  #mp-sheet .mp-sheet-body > #mp-widget > .mp-mini-cart {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Modern calendar/time styles inside the mobile sheet */
@media (max-width: 768px) {
  /* Time & Date inside modal: modern dark calendar */
  #mp-sheet #mp-widget .mp-cal {
    background: linear-gradient(180deg, rgba(15,23,42,.92), rgba(15,23,42,.76));
    border: 1px solid var(--mp-border);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(7,16,35,.45);
    padding: 12px;
  }
  #mp-sheet #mp-widget .mp-cal-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  #mp-sheet #mp-widget .mp-cal-hdr .mon { font-weight: 900; color: var(--mp-ink); }
  #mp-sheet #mp-widget .mp-cal-nav { display: flex; gap: 8px; }
  #mp-sheet #mp-widget .mp-cal-nav button {
    border: 1px solid var(--mp-border);
    background: #0c1427;
    color: var(--mp-ink);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background-color .15s ease, transform .06s ease, box-shadow .18s ease;
  }
  #mp-sheet #mp-widget .mp-cal-nav button:hover { background: #0f1b33; box-shadow: 0 0 0 3px rgba(58,166,255,.10) inset; }
  #mp-sheet #mp-widget .mp-cal-nav button:active { transform: translateY(1px); }
  #mp-sheet #mp-widget .mp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
  #mp-sheet #mp-widget .mp-cal-day {
    display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center;
    height: 64px;
    border: 1px solid var(--mp-border);
    border-radius: 12px;
    background: #0f172a;
    color: var(--mp-ink);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .2s ease, transform .06s ease;
  }
  #mp-sheet #mp-widget .mp-cal-day .dow { font-size: 12px; color: #9db6e8; opacity: .9; }
  #mp-sheet #mp-widget .mp-cal-day .d { font-weight: 900; font-variant-numeric: tabular-nums; }
  #mp-sheet #mp-widget .mp-cal-day.today:not(.selected) { background: linear-gradient(180deg, rgba(76,156,255,.10), rgba(76,156,255,.06)); box-shadow: inset 0 0 0 1px rgba(76,156,255,.30); }
  #mp-sheet #mp-widget .mp-cal-day:hover:not(.disabled):not(.selected) { background: #0f1b2f; border-color: #2a3a59; box-shadow: 0 10px 28px rgba(7,16,35,.45); }
  #mp-sheet #mp-widget .mp-cal-day:active:not(.disabled) { transform: translateY(1px); }
  #mp-sheet #mp-widget .mp-cal-day.selected { background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-2)); color: #061124; border-color: transparent; box-shadow: 0 10px 32px rgba(43,138,235,.50), 0 0 0 2px rgba(43,138,235,.35) inset; font-weight: 900; }
  #mp-sheet #mp-widget .mp-cal-day.disabled { opacity: .5; cursor: not-allowed; background: #0c1427; }

  /* Time slots segmented pills */
  #mp-sheet #mp-widget .mp-seg { display: flex; gap: 8px; margin-top: 12px; }
  #mp-sheet #mp-widget .mp-seg .seg {
    flex: 1 1 0;
    text-align: center;
    border: 1px solid var(--mp-border);
    border-radius: 999px;
    padding: 10px 12px;
    cursor: pointer;
    background: #0c1427;
    color: var(--mp-ink);
    transition: background-color .15s ease, border-color .15s ease, box-shadow .2s ease, transform .06s ease;
  }
  #mp-sheet #mp-widget .mp-seg .seg:hover { background: #0f1b33; border-color: #2a3a59; }
  #mp-sheet #mp-widget .mp-seg .seg:active { transform: translateY(1px); }
  #mp-sheet #mp-widget .mp-seg .seg[aria-checked="true"] { background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-2)); color: #061124; border-color: transparent; box-shadow: 0 8px 24px rgba(43,138,235,.35); font-weight: 900; }
  #mp-sheet #mp-widget .mp-seg .seg[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
}

/* Forms inside modal: clean, modern dark styling */
@media (max-width: 768px) {
  #mp-sheet #mp-widget .mp-form { display: grid; gap: 12px; }
  #mp-sheet #mp-widget .mp-field { display: grid; gap: 6px; }
  #mp-sheet #mp-widget .mp-field label { font-weight: 700; color: var(--mp-muted); }
  #mp-sheet #mp-widget .mp-field input[type="text"],
  #mp-sheet #mp-widget .mp-field input[type="email"],
  #mp-sheet #mp-widget .mp-field input[type="tel"],
  #mp-sheet #mp-widget .mp-field input[type="date"],
  #mp-sheet #mp-widget .mp-field textarea {
    background: #0c1427;
    color: var(--mp-ink);
    border: 1px solid var(--mp-border);
    border-radius: 12px;
    padding: 12px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  }
  #mp-sheet #mp-widget .mp-field ::placeholder { color: #8aa0c8; opacity: .8; }
  #mp-sheet #mp-widget .mp-field input:focus,
  #mp-sheet #mp-widget .mp-field textarea:focus { border-color: var(--mp-primary); box-shadow: 0 0 0 3px rgba(43,138,235,.25); }
  #mp-sheet #mp-widget .mp-field input[disabled],
  #mp-sheet #mp-widget .mp-field textarea[disabled] { opacity: .6; cursor: not-allowed; }

  #mp-sheet #mp-widget .mp-consent { display: flex; align-items: flex-start; gap: 10px; }
  #mp-sheet #mp-widget .mp-consent input[type="checkbox"] { accent-color: var(--mp-primary); transform: translateY(3px); }

  #mp-sheet #mp-widget .mp-radio-group { display: grid; gap: 10px; margin: 6px 0 6px; }
  #mp-sheet #mp-widget .mp-radio-option {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--mp-border);
    border-radius: 12px;
    background: #0c1427;
    color: var(--mp-ink);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .2s ease, transform .06s ease;
  }
  #mp-sheet #mp-widget .mp-radio-option:hover { background: #0f1b33; border-color: #2a3a59; }
  #mp-sheet #mp-widget .mp-radio-option:active { transform: translateY(1px); }
  #mp-sheet #mp-widget .mp-radio-option input { accent-color: var(--mp-primary); }
  #mp-sheet #mp-widget .mp-radio-option:has(input:checked) {
    background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-2));
    color: #061124;
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(43,138,235,.40);
    font-weight: 900;
  }
}
