/* =========================================================================
   ACS Courier pickup / smartpoint picker — BoxNow-style layout, ACS red.
   Brand color: #E3001C
   ========================================================================= */

:root {
  --acs-red: #E3001C;
  --acs-red-dark: #c1001a;
  --acs-red-tint: #fdecee;
  --acs-ink: #1d2327;
  --acs-muted: #6b7280;
  --acs-line: #ececec;
}

/* MODAL SHELL */
.acs-ce-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  font-family: inherit;
}

.acs-ce-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.acs-ce-modal-content {
  position: relative;
  background: #fff;
  width: 92%;
  max-width: 1100px;
  height: 86vh;
  margin: 7vh auto;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Visually-hidden accessible heading */
.acs-ce-modal-content .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* CLOSE BUTTON — white circle, top-right corner */
.acs-ce-close {
  position: absolute !important;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  line-height: 32px;
  text-align: center;
  font-size: 22px;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  margin: 0;
  z-index: 40;
  transition: background 0.2s ease, transform 0.2s ease;
}

.acs-ce-close:hover,
.acs-ce-close:focus {
  background: rgba(0, 0, 0, 0.45);
  transform: scale(1.05);
}

/* BODY LAYOUT */
.acs-ce-modal-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* LEFT PANEL */
.acs-ce-left {
  width: 40%;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--acs-line);
  background: #fff;
}

/* Red header holding the search pill */
.acs-ce-left-header {
  background: var(--acs-red);
  padding: 18px 16px;
}

.acs-ce-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  padding: 0 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.acs-ce-search-icon {
  color: var(--acs-muted);
  flex: 0 0 auto;
  margin-right: 8px;
}

#acs-ce-search {
  flex: 1;
  border: none !important;
  outline: none;
  background: transparent;
  box-shadow: none !important;
  padding: 12px 0;
  margin: 0;
  font-size: 15px;
  color: var(--acs-ink);
  width: 100%;
}

#acs-ce-search:focus {
  border: none !important;
  box-shadow: none !important;
}

/* TYPE SWITCH — segmented pills */
.acs-ce-type-switch {
  display: flex;
  gap: 8px;
  padding: 14px 16px 10px;
}

.acs-ce-type-option {
  flex: 1;
  cursor: pointer;
  margin: 0;
}

.acs-ce-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.acs-ce-type-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  padding: 8px 10px;
  border: 1.5px solid var(--acs-line);
  border-radius: 12px;
  font-size: 13px;
  color: var(--acs-ink);
  background: #fff;
  transition: all 0.15s ease;
  height: 100%;
}

.acs-ce-type-name {
  font-weight: 700;
}

.acs-ce-type-price {
  font-size: 12px;
  color: var(--acs-muted);
}

.acs-ce-type-option input:checked + .acs-ce-type-pill {
  border-color: var(--acs-red);
  background: var(--acs-red-tint);
}

.acs-ce-type-option input:checked + .acs-ce-type-pill .acs-ce-type-price {
  color: var(--acs-red-dark);
}

.acs-ce-type-option input:focus-visible + .acs-ce-type-pill {
  box-shadow: 0 0 0 3px rgba(227, 0, 28, 0.25);
}

/* LOCATION LIST — cards */
#acs-ce-location-list {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0 8px;
  list-style: none;
}

.acs-ce-loc {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--acs-line);
  cursor: pointer;
  transition: background 0.12s ease;
}

.acs-ce-loc:hover {
  background: #fafafa;
}

.acs-ce-loc.active {
  background: var(--acs-red-tint);
  box-shadow: inset 4px 0 0 0 var(--acs-red);
}

.acs-ce-loc-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--acs-red);
}

.acs-ce-loc-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.acs-ce-loc-info {
  flex: 1 1 auto;
  min-width: 0;
}

.acs-ce-loc-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  color: var(--acs-ink);
}

.acs-ce-loc-addr {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--acs-muted);
}

.acs-ce-loc-select {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ff2a3c !important;
  background-color: #fff !important;
  border: 1px solid #FF2A3B !important;
  border-radius: 15px !important;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Chevron ">" after the label */
.acs-ce-loc-select::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.9;
}

.acs-ce-loc-select:hover,
.acs-ce-loc-select:focus {
  color: #fff !important;
  background-color: #ff2a3c !important;
}

.acs-ce-loc-select:focus-visible {
  outline: 2px solid #ff2a3c;
  outline-offset: 2px;
}

/* On the previewed / selected card the button reads as confirmed */
.acs-ce-loc.active .acs-ce-loc-select {
  color: #fff !important;
  background-color: #ff2a3c !important;
}

/* RIGHT PANEL */
.acs-ce-right {
  width: 60%;
  display: flex;
  flex-direction: column;
  position: relative;
}

#acs-ce-map {
  flex: 1;
  min-height: 300px;
}

/* Details panel below the map */
.acs-ce-details {
  padding: 0;
  font-size: 14px;
  color: var(--acs-ink);
}

.acs-ce-details:not(:empty) {
  padding: 14px 16px;
  border-top: 1px solid var(--acs-line);
  max-height: 34%;
  overflow-y: auto;
}

.acs-ce-details h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--acs-ink);
}

.acs-ce-details p {
  margin: 0 0 8px;
  color: var(--acs-muted);
  line-height: 1.45;
}

.acs-ce-details a {
  color: var(--acs-red);
  font-weight: 600;
  text-decoration: none;
}

.acs-ce-details a:hover {
  text-decoration: underline;
}

/* Primary confirm button in details */
.acs-ce-details .acs-ce-confirm {
  display: inline-block;
  background: var(--acs-red) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 0 rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.acs-ce-details .acs-ce-confirm:hover,
.acs-ce-details .acs-ce-confirm:focus {
  background: var(--acs-red-dark) !important;
  box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.1);
  transform: translateY(2px);
}

/* MAP MARKERS */
.acs-ce-marker {
  width: 28px;
  height: 28px;
  cursor: pointer;
  pointer-events: auto;
  z-index: 20;
  background: url("/wp-content/plugins/acs-courier-by-competitive-edge/assets/img/pin.svg") no-repeat center;
  background-size: contain;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.acs-ce-marker.active {
  /* Focused / selected point turns green. */
  background-image: url("/wp-content/plugins/acs-courier-by-competitive-edge/assets/img/pin-green.svg");
  transform: scale(1.35);
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
  z-index: 30;
}

.acs-ce-marker-tooltip {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
}

.maplibregl-popup-content {
  padding: 6px 10px;
  border-radius: 8px;
}

/* ── Under-rate area (button + selected-location box) ── */
.acs-ce-under-rate {
  margin: 8px 0 4px;
  text-align: right;
}

/* Selected location box — BoxNow style, ACS red */
.acs-ce-locker-box {
  margin-top: 10px;
  border: 1.5px solid var(--acs-red);
  background: var(--acs-red-tint);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: right;
}

.acs-ce-locker-box:empty {
  display: none;
}

.acs-ce-locker-title {
  margin: 0 0 6px !important;
  font-weight: 700;
  font-size: 14px;
  color: var(--acs-red-dark);
}

.acs-ce-locker-detail {
  margin: 0 0 2px !important;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--acs-muted);
}

/* ── Trigger buttons in checkout — ACS red ── */
.acs-ce-pickup-wrap .button.acs-ce-open-modal {
  background-color: var(--acs-red) !important;
  color: #ffffff !important;
  border: none;
  border-radius: 6px;
  box-shadow: 0 4px 0 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  margin-top: 6px;
  margin-left: 5px;
  position: relative;
}

.acs-ce-pickup-wrap .button.acs-ce-open-modal:hover,
.acs-ce-pickup-wrap .button.acs-ce-open-modal:focus {
  background-color: var(--acs-red-dark) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.1);
  transform: translateY(2px);
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .acs-ce-modal-content {
    width: 96%;
    height: 92vh;
    margin: 4vh auto;
    border-radius: 14px;
  }

  .acs-ce-modal-body {
    flex-direction: column;
  }

  .acs-ce-left,
  .acs-ce-right {
    width: 100%;
    min-width: 0;
  }

  .acs-ce-left {
    border-right: none;
    border-bottom: 1px solid var(--acs-line);
    max-height: 55%;
  }

  .acs-ce-right {
    flex: 1;
  }

  #acs-ce-map {
    min-height: 220px;
  }
}
