/* /embed-app/styles/admin.css
   Admin-only styles for the booking UI.
   Guard everything with html.admin-embed so the customer-side
   widget stays untouched.
*/

/* -------------------- Global admin embed layout -------------------- */

/* Reduce map height in admin so whole HUD fits better on screen */
html.admin-embed #map {
  height: 260px !important;
}

/* Use grid so both columns share the same row height */
html.admin-embed .hud-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  column-gap: 24px;
  align-items: stretch; /* both grid items same height */
  overflow-x: hidden !important; /* prevent horizontal scroll from columns */
}

/* Left column: form card */
html.admin-embed #sheet {
  display: flex;           /* so sheet-inner can stretch */
  margin-top: 0;
  margin-bottom: 0;
}

/* Left grey card itself */
html.admin-embed #sheet .sheet-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;          /* fill entire column height */
  padding-bottom: 20px;
}

/* Make sure the step block doesn’t fight the height */
html.admin-embed #sheet .sheet-inner > .step,
html.admin-embed #sheet .sheet-inner > .step-admin {
  flex: 0 0 auto;
}

/* Right column container */
html.admin-embed .side {
  display: flex;
  flex-direction: column;
  margin-top: 0;
  margin-bottom: 0;
}

/* Right panel wrapper */
html.admin-embed .side .panel.car-info,
html.admin-embed .side .panel.trip-summary {
  flex: 1 1 auto;
  margin-top: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

/* Right grey card itself */
html.admin-embed #carInfo .desk-quote.dq.car-card {
  width: 100%;
  flex: 1 1 auto;           /* stretch to full panel height */
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* -------------------- One-step form layout -------------------- */

/* 50/50 columns for ride & contact rows */
html.admin-embed .row.two,
html.admin-embed .row.two.mini {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: stretch;
}

/* Allow children to shrink instead of forcing overflow */
html.admin-embed .row.two > *,
html.admin-embed .row.two.mini > * {
  min-width: 0 !important;
}

/* Pills span full width of their grid cell, and include padding in width */
html.admin-embed .row.two .pill,
html.admin-embed .row.two.mini .pill {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;  /* prevents pill from exceeding column width */
}

/* Contact row spacing under ride info */
html.admin-embed .contact-row {
  margin-top: 8px;
}

/* Single action row: center "Boka nu" */
html.admin-embed .actions-single {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

html.admin-embed .actions-single .btn {
  min-width: 220px;
}

/* Remove any multi-step visual indicators in admin mode */
html.admin-embed .step-admin {
  border: none;
}

/* -------------------- Admin form spacing -------------------- */

/* More vertical breathing room between all rows in the left card */
html.admin-embed #sheet .sheet-inner .row {
  margin-bottom: 10px;
}

/* Keep the actions row slightly separated from the fields */
html.admin-embed #sheet .sheet-inner .actions,
html.admin-embed #sheet .sheet-inner .actions-single {
  margin-top: 14px;
}

/* -------------------- Phone field / intl-tel-input -------------------- */

/* Phone pill behaves like a flex row: icon + ITI wrapper */
html.admin-embed .phone-pill {
  position: relative;   /* anchor for dropdown */
  display: flex;
  align-items: center;
  width: 100%;          /* fill the pill */
  max-width: 100%;      /* never grow wider than container */
  overflow: visible;    /* allow dropdown to extend downward */
}

/* Use border-box only on pill and input (not every child element) */
html.admin-embed .phone-pill,
html.admin-embed .phone-pill input {
  box-sizing: border-box;
}

/* Icon keeps its natural size */
html.admin-embed .phone-pill .i[aria-hidden="true"] {
  margin-right: 6px;
  flex: 0 0 auto;
}

/* ITI wrapper takes the remaining space */
html.admin-embed .phone-pill .iti {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  width: 100% !important;
  max-width: 100%;
}

/* NEW: vertical separator between code and digits */
html.admin-embed .phone-pill .iti__flag-container {
  position: absolute;
  left: 8px;
  height: 100%;
  display: flex;
  align-items: center;
  border-right: 1px solid #e5e7eb;
  padding-right: 8px;
  margin-right: 8px;
}

/* Actual input fills the ITI area and respects the pill width */
html.admin-embed .phone-pill input[type="tel"],
html.admin-embed .phone-pill input[type="text"],
html.admin-embed .phone-pill .iti input {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  background: transparent !important;
  border: none;
}

/* Comfortable distance from dial code;
   overrides intl-tel-input inline padding */
html.admin-embed label.phone-pill .iti.iti--separate-dial-code input.iti__tel-input,
html.admin-embed label.phone-pill .iti.iti--allow-dropdown input.iti__tel-input {
  padding-left: 100px !important;  /* space for flag + code + separator */
  text-indent: 0 !important;
}

/* Country list: small overlay box attached directly under the phone field */
html.admin-embed .phone-pill .iti__country-list {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: auto !important;
  max-width: 360px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 9999;
  background-color: #ffffff;
}

/* -------------------- Right-side card tweaks (admin only) -------------------- */

/* Make sure text inside right card stays readable on dark bg */
html.admin-embed .panel.car-info,
html.admin-embed .panel.trip-summary,
html.admin-embed .panel.car-info *,
html.admin-embed .panel.trip-summary * {
  color: #f9fafb;
}

/* Apply same white text to admin price cards explicitly */
html.admin-embed .admin-price-card,
html.admin-embed .admin-price-card * {
  color: #f9fafb;
}

/* Remove payment badges completely in admin (no methods shown) */
html.admin-embed .dq-foot .pay-badges {
  display: none !important;
}

/* Slightly tighter footer for admin where no payment badges exist */
html.admin-embed .dq-foot--admin {
  justify-content: flex-start;
}

/* Hide the original single-price UI + units inside the price block */
html.admin-embed .admin-price-card .dq-price .ico.price,
html.admin-embed .admin-price-card .dq-price #dqPriceOld,
html.admin-embed .admin-price-card .dq-price #dqPriceVal,
html.admin-embed .admin-price-card .dq-price #dqPriceValOld,
html.admin-embed .admin-price-card .dq-price #tsOld,
html.admin-embed .admin-price-card .dq-price #tsFare,
html.admin-embed .admin-price-card .dq-price .dq-price-unit {
  display: none !important;
}

/* Hide the discount-strike block (grey original price like “351 kr”) */
html.admin-embed .admin-price-card .discount-strike,
html.admin-embed .admin-price-card .discount-strike * {
  display: none !important;
}

/* IMPORTANT: let dq-price span the whole footer in admin so
   our breakdown grid can align values to the real right edge */
html.admin-embed .admin-price-card .dq-foot {
  align-items: flex-start;
}

html.admin-embed .admin-price-card .dq-price {
  flex: 1 1 auto;
  width: 100%;
  justify-content: flex-start;
}

/* -------------------- Admin section titles -------------------- */

html.admin-embed .admin-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 0.9;
  margin: 4px 4px 2px;
}

html.admin-embed .admin-section-title--ride {
  margin-top: 0;
  margin-bottom: 6px;
}

html.admin-embed .admin-section-title--contact {
  margin-top: 18px;   /* extra gap between sections */
  margin-bottom: 8px;
}

/* -------------------- Admin price rows (selector | label | value) -------------------- */

html.admin-embed .admin-price-breakdown {
  margin-top: 22px;         /* move the whole block slightly downward */
  display: flex;
  flex-direction: column;
  row-gap: 20px;            /* vertical space between fare types */
  width: 100%;
}

html.admin-embed .admin-price-row {
  display: grid;
  grid-template-columns: 30px 1fr minmax(80px, auto);
  align-items: center;
  column-gap: 10px;
  width: 100%;
}

/* bigger selector: ~2x visual size */
html.admin-embed .admin-price-cell--selector input[type="radio"] {
  width: 18px;
  height: 18px;
  transform: scale(1.9);
  transform-origin: center;
  cursor: pointer;
}

html.admin-embed .admin-price-cell--selector {
  display: flex;
  justify-content: center;
  align-items: center;
}

html.admin-embed .admin-price-cell--label {
  font-weight: 600;
}

/* values aligned towards the right edge of the card */
html.admin-embed .admin-price-cell--value {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  padding-right: 4px;
}

/* Custom price input styled like a small cell – 15% bigger + black text */
html.admin-embed .admin-custom-price {
  width: 105px;
  max-width: 138px;
  padding: 3px 6px;
  border-radius: 4px;
  border: none;
  font-size: 0.9rem;
  text-align: right;
  background: #5F6571;
  color: #ffffff;
}

/* -------------------- Misc admin polish -------------------- */

/* Avoid horizontal scrollbar in admin embed (base) */
html.admin-embed #sheet,
html.admin-embed .sheet-inner {
  overflow-x: hidden;
}

/* E-post / kommentar textareas should not grow huge vertically in admin */
html.admin-embed textarea#contactNote {
  resize: vertical;
  min-height: 38px;
  max-height: 120px;
}

/* -------------------- Scroll / overflow fixes (key part) -------------------- */

/* 1) Remove internal scrolling on the whole under-map HUD in admin. */
html.admin-embed .hud {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

/* 2) Ensure left card internals do not clip dropdowns */
html.admin-embed #sheet,
html.admin-embed #sheet .sheet-inner,
html.admin-embed #sheet .step,
html.admin-embed #sheet .step-admin {
  overflow: visible !important;
  max-height: none !important;
}
/* ------------------------------------------------------------------
   ADMIN MOBILE: Fare selector on step 2 (Taxameter / Ordinarie / Kampanj / Eget)
-------------------------------------------------------------------*/
@media (max-width: 900px), (pointer: coarse) {
  html.admin-embed #mobileFlow .m-admin-fare-block {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  }

  html.admin-embed #mobileFlow .m-admin-fare-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #ffffff;
  }

  html.admin-embed #mobileFlow .m-admin-fare-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  html.admin-embed #mobileFlow .m-admin-fare-row {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    font-size: 0.82rem;
    cursor: pointer;
  }

  html.admin-embed #mobileFlow .m-admin-fare-row .m-admin-fare-label {
    text-align: left;
  }

  html.admin-embed #mobileFlow .m-admin-fare-radio {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(148, 163, 184, 0.9);
    box-sizing: border-box;
  }

  html.admin-embed #mobileFlow .m-admin-fare-row.is-active {
    border-color: var(--brand, #fbbf24);
    background: rgba(251, 191, 36, 0.12);
  }

  html.admin-embed #mobileFlow .m-admin-fare-row.is-active .m-admin-fare-radio {
    border-color: var(--brand, #fbbf24);
    background: var(--brand, #fbbf24);
  }

  html.admin-embed #mobileFlow .m-admin-fare-custom {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 4px;
    font-size: 0.8rem;
    color: #ffffff;
  }

  html.admin-embed #mobileFlow #m-admin-custom-fare {
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    padding: 7px 10px;
    background: #0b1220;
    color: #ffffff;
  }
}
