/* Shared profile geometry for customer, partner and administrator accounts. */
#profileDrawer,
#profileModal > .modal {
  box-sizing: border-box;
  width: 480px;
  max-width: calc(100vw - 32px);
  height: auto;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(24, 26, 48, .2);
  text-align: right;
}

#profileDrawer {
  inset: 50% auto auto 50%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.97);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

#profileDrawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

#profileDrawer .drawer-head,
#profileDrawer .store-drawer-header {
  flex: 0 0 auto;
  gap: 12px;
  padding: 16px 20px;
}

#profileDrawer .drawer-head strong,
#profileDrawer .store-drawer-header h3 {
  margin: 0;
  font-size: 17px;
}

#profileDrawer .drawer-head button,
#profileDrawer .store-drawer-close {
  flex-shrink: 0;
  min-width: 40px;
  min-height: 40px;
}

#profileDrawer .drawer-body,
#profileDrawer .store-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#profileModal { padding: 16px; }
#profileModal > .modal { padding: 20px; overscroll-behavior: contain; }

#profileDrawer input,
#profileDrawer textarea,
#profileModal input {
  min-width: 0;
  max-width: 100%;
}

#profileDrawer textarea { resize: vertical; }

html:has(#profileDrawer.open),
html:has(#profileModal:not(.hidden)),
body:has(#profileDrawer.open),
body:has(#profileModal:not(.hidden)) { overflow: hidden; }

@media (max-width: 640px) {
  #profileDrawer,
  #profileModal > .modal {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }

  #profileModal { padding: 12px; }
  #profileModal > .modal { padding: 16px; }
  #profileModal .grid-2 { grid-template-columns: minmax(0, 1fr); }

  #profileDrawer .drawer-head,
  #profileDrawer .store-drawer-header { padding: 12px 16px; }

  #profileDrawer .drawer-body,
  #profileDrawer .store-drawer-body { padding: 14px 16px 16px; }

  #profileDrawer input,
  #profileDrawer textarea,
  #profileModal input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  #profileDrawer { transition: none; }
}
