/* =============== SUBMIT PANEL OVERLAY (iOS SHEET STYLE) =============== */

.px-submit-panel {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;              /* center vertically on desktop */
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.45);              /* dim map behind */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.px-submit-panel--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
}

/* Main sheet container */
.px-submit-panel-inner {
  position: relative;
  width: min(720px, 100%);
  max-height: min(90vh, 780px);
  background: #f9fafb;                             /* light like iOS sheet */
  border-radius: 28px;
  box-shadow:
    0 20px 45px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(209, 213, 219, 0.9);
  color: #111827;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-2%); /* tiny lift so grabber + title feel optically centered */
}

/* Small grabber bar like the screenshot */
.px-submit-panel-inner::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 4px;
  border-radius: 999px;
  background: #e5e7eb;
  opacity: 0.9;
}

/* Hide time inputs when closed, but keep their space
   so the row height doesn't change when toggling */
.px-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* Mobile: behave more like a bottom sheet */
@media (max-width: 640px) {
  .px-submit-panel {
    align-items: flex-end;
  }

  .px-submit-panel-inner {
    width: 100%;
    max-height: 94vh;
    border-radius: 24px 24px 0 0;
    box-shadow:
      0 -4px 20px rgba(15, 23, 42, 0.4),
      0 0 0 1px rgba(209, 213, 219, 0.9);
    transform: none; /* no vertical offset for bottom sheet */
  }
}

/* Close button (X) */
.px-submit-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(243, 244, 246, 0.95);
  color: #374151;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px rgba(209, 213, 219, 0.9),
    0 6px 14px rgba(15, 23, 42, 0.15);
  transition: background 0.15s ease-out, transform 0.12s ease-out,
              box-shadow 0.12s ease-out;
}

.px-submit-close:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.px-submit-close:active {
  transform: translateY(0);
  box-shadow:
    0 0 0 1px rgba(209, 213, 219, 1),
    0 3px 8px rgba(15, 23, 42, 0.25);
}

/* Scrollable form content */
#px-submit-root {
  padding: 38px 20px 18px; /* extra top for grabber/title spacing */
  padding-right: 16px;     /* slightly narrower on the right for scrollbar */
  overflow-y: auto;
}

/* Keep the whole form centered & constrained (fixes "way off screen") */
#px-submit-root form {
  max-width: 640px;
  margin: 0 auto;
}

/* Thin scrollbar inside panel */
#px-submit-root::-webkit-scrollbar {
  width: 6px;
}
#px-submit-root::-webkit-scrollbar-track {
  background: transparent;
}
#px-submit-root::-webkit-scrollbar-thumb {
  background: rgba(209, 213, 219, 0.9);
  border-radius: 999px;
}

/* =============== TYPOGRAPHY =============== */

.px-submit-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #111827;
  text-align: center;
  margin-bottom: 4px;
}

.px-submit-subtitle {
  font-size: 0.92rem;
  color: #6b7280;
  margin-bottom: 20px;
  text-align: center;
}

.px-submit-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
  margin: 18px 0 8px;
}

/* =============== FIELDS =============== */

.px-submit-field {
  margin-bottom: 16px;
}

.px-submit-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
}

/* Default styling for text inputs/select inside submit */
#px-submit-root input[type="text"],
#px-submit-root input[type="tel"],
#px-submit-root input[type="search"],
#px-submit-root select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  font-size: 0.95rem;
  outline: none;
  box-sizing: border-box;
  box-shadow:
    0 1px 1px rgba(15, 23, 42, 0.02),
    0 8px 18px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out,
    background 0.15s ease-out,
    transform 0.06s ease-out;
}

#px-submit-root input::placeholder {
  color: #d1d5db;
}

#px-submit-root select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #9ca3af 50%),
                    linear-gradient(135deg, #9ca3af 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 3px),
    calc(100% - 8px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

#px-submit-root input:focus,
#px-submit-root select:focus {
  border-color: #4f46e5;
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(79, 70, 229, 0.3),
    0 12px 30px rgba(79, 70, 229, 0.25);
  transform: translateY(-0.5px);
}

/* Small helper text (phone errors, etc.) */
.px-submit-helper,
#px-submit-root .px-submit-helper {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 4px;
}

.px-submit-helper--error {
  color: #b91c1c;
}

/* =============== HOURS BLOCK WRAPPER (card like screenshot) =============== */

.px-submit-hours-block {
  margin-top: 4px;
  padding: 12px 12px 10px;
  border-radius: 22px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  box-shadow:
    0 6px 20px rgba(15, 23, 42, 0.06),
    0 0 0 1px rgba(243, 244, 246, 1);
}

/* Grid inside hours card */
.px-hours-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* === ROW: 3 columns: Day | Toggle | Pill + Times === */
.px-hours-row {
  display: grid;
  grid-template-columns: 72px auto 1fr;
  align-items: center;
  column-gap: 10px;
  padding: 8px 12px;
  border-radius: 18px;
  background: #f9fafb;
  box-shadow:
    0 1px 1px rgba(15, 23, 42, 0.02),
    0 4px 10px rgba(15, 23, 42, 0.03);
  min-height: 48px; /* keep height stable when toggling */
}

.px-hours-row:last-child {
  margin-bottom: 0;
}

/* Day name */
.px-hours-day {
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
  min-width: 60px;
}

/* Toggle area (column 2) */
.px-hours-toggle {
  display: inline-flex;
  align-items: center;
  position: relative;
}

/* Hide the native checkbox; use pill instead */
.px-hours-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* iOS-style switch track */
.px-hours-toggle-pill {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: #e5e7eb;
  box-shadow:
    inset 0 0 0 1px rgba(209, 213, 219, 0.9),
    0 1px 2px rgba(15, 23, 42, 0.15);
  transition:
    background 0.16s ease-out,
    box-shadow 0.16s ease-out;
}

/* Switch thumb */
.px-hours-toggle-pill::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.25),
    0 0 0 0.5px rgba(209, 213, 219, 0.9);
  transition:
    transform 0.16s ease-out,
    background 0.16s ease-out;
}

/* ON state */
.px-hours-toggle input:checked + .px-hours-toggle-pill {
  background: #22c55e;
  box-shadow:
    inset 0 0 0 1px rgba(22, 163, 74, 0.9),
    0 1px 4px rgba(21, 128, 61, 0.35);
}

.px-hours-toggle input:checked + .px-hours-toggle-pill::after {
  transform: translateX(24px);
}

/* Closed pill (column 3, before times) */
.px-submit-closed-pill {
  display: inline-flex;
  align-items: center;      /* center vertically */
  justify-content: center;  /* center horizontally inside the pill */
  height: 28px;             /* same as toggle track */
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  white-space: nowrap;
  margin-right: 6px;        /* spacing before first time chip */
  opacity: 1;
  transition: opacity 0.18s ease-out;
}

/* Change hidden state for closed pill */
.px-submit-closed-pill.px-closed-pill--hidden {
  opacity: 0;
  width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Times (3rd column – pill + time chips) */
.px-hours-times {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  justify-self: end;
}

/* Time chips */
.px-hours-time {
  width: 104px;
  max-width: 110px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #6b7280;
  font-size: 0.8rem;
  box-sizing: border-box;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.08),
    0 0 0 0.5px rgba(243, 244, 246, 1);
}

/* Disabled times (when closed) */
.px-hours-time:disabled {
  background: #f3f4f6;
  color: #9ca3af;
}

/* Mobile – times under toggle, toggle stays in its column */
@media (max-width: 480px) {
  .px-hours-row {
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto;
  }

  .px-hours-day {
    grid-row: 1 / 3;
  }

  .px-hours-times {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    margin-top: 4px;
  }
}
/* =============== MAP BLOCK =============== */

.px-submit-map-block {
  margin-top: 12px;
}

.px-submit-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.px-submit-map-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.px-submit-map-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 6px;
}

.px-submit-map {
  height: 260px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(243, 244, 246, 1);
}

/* "Use my location" button */
.px-submit-ghost-btn {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.15s ease-out,
    box-shadow 0.15s ease-out,
    transform 0.06s ease-out,
    border-color 0.15s ease-out;
}

.px-submit-ghost-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow:
    0 8px 20px rgba(59, 130, 246, 0.28),
    0 0 0 1px rgba(243, 244, 246, 1);
  transform: translateY(-0.5px);
}

/* Lat/Lng text */
.px-submit-coords {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #6b7280;
}

/* =============== ACTIONS / SUBMIT BUTTON =============== */

.px-submit-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.px-submit-primary {
  min-width: 120px;
  height: 44px;
  border-radius: 999px;
  border: none;
  padding: 0 18px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  background: radial-gradient(circle at top left, #4f46e5, #3b82f6);
  color: #f9fafb;
  box-shadow:
    0 14px 32px rgba(59, 130, 246, 0.55),
    0 0 0 1px rgba(209, 213, 219, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease-out,
    box-shadow 0.15s ease-out,
    transform 0.08s ease-out,
    filter 0.12s ease-out;
}

.px-submit-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow:
    0 16px 40px rgba(59, 130, 246, 0.65),
    0 0 0 1px rgba(209, 213, 219, 1);
}

.px-submit-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow:
    0 10px 24px rgba(37, 99, 235, 0.75),
    0 0 0 1px rgba(209, 213, 219, 1);
}

.px-submit-primary:disabled {
  cursor: default;
  opacity: 0.55;
  filter: grayscale(0.2);
  box-shadow:
    0 0 0 1px rgba(229, 231, 235, 1),
    0 4px 12px rgba(15, 23, 42, 0.08);
}