/**
 * Ekstrasens Boutique: free shipping progress and DPD pickup points
 * inside the WooCommerce Cart and Checkout blocks.
 */
:root {
  --ekb-foret: #183d35;
  --ekb-accent: #e2ff8e;
  --ekb-light: #e5e9e3;
  --ekb-muted: #5f7069;
  --ekb-surface: #f5f5f5;
  --ekb-radius: 14px;
  --ekb-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Free shipping progress ------------------------------------------------- */

.ekb-free-shipping {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: var(--ekb-radius);
  background: var(--ekb-light);
  color: var(--ekb-foret);
}

.ekb-free-shipping__text {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.4;
}

.ekb-free-shipping__track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #fff;
}

.ekb-free-shipping__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ekb-foret);
  transform-origin: left center;
  transition: transform 400ms var(--ekb-ease-out);
}

/* Inside the order summary the box is already a card: text and bar only.
   WooCommerce pads slot fills with ".slot-wrapper > * > *", hence the specificity. */
.wc-block-components-totals-wrapper.slot-wrapper .ekb-free-shipping.ekb-free-shipping {
  margin: 0;
  padding: 4px 16px 16px;
  background: none;
}

.wc-block-components-totals-wrapper .ekb-free-shipping__track {
  background: var(--ekb-light);
}

/* The cart summary card already has its own inner spacing. */
.wc-block-cart__sidebar .wc-block-components-totals-wrapper.slot-wrapper .ekb-free-shipping.ekb-free-shipping {
  padding-inline: 0;
}

/* DPD pickup points ------------------------------------------------------ */

.ekb-relais {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  color: var(--ekb-foret);
  transition: opacity 150ms ease;
}

.ekb-relais[aria-busy='true'] {
  opacity: 0.7;
}

.ekb-relais__title {
  margin: 0 0 4px;
  padding: 0;
  font-size: 16px;
  font-weight: 600;
}

.ekb-relais__intro {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ekb-muted);
}

.ekb-relais__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ekb-relais__item {
  border: 1px solid var(--ekb-light);
  border-radius: var(--ekb-radius);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ekb-relais__item.is-selected {
  border-color: var(--ekb-foret);
  box-shadow: 0 0 0 1px var(--ekb-foret);
}

.ekb-relais__option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px 6px;
  cursor: pointer;
}

.ekb-relais__option input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ekb-foret);
}

.ekb-relais__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ekb-relais__name {
  font-size: 14px;
  font-weight: 600;
}

.ekb-relais__address {
  font-size: 13px;
  color: var(--ekb-muted);
}

.ekb-relais__distance {
  font-size: 13px;
  color: var(--ekb-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ekb-relais__details {
  padding: 0 16px 12px 46px;
  font-size: 13px;
}

.ekb-relais__details summary {
  width: fit-content;
  color: var(--ekb-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ekb-relais__hours {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 16px;
  margin: 8px 0 0;
}

.ekb-relais__hours dt {
  font-weight: 600;
}

.ekb-relais__hours dd {
  margin: 0;
  color: var(--ekb-muted);
  font-variant-numeric: tabular-nums;
}

.ekb-relais__hint,
.ekb-relais__closing {
  margin: 8px 0 0;
  color: var(--ekb-muted);
}

.ekb-relais__error {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fdf2f2;
  color: #9b1c1c;
  font-size: 14px;
}

.ekb-relais__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.ekb-relais__search {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--ekb-radius);
  background: var(--ekb-surface);
}

.ekb-relais__search-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
}

.ekb-relais__search label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.ekb-relais__search input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d5dbd7;
  border-radius: 10px;
  background: #fff;
  font-size: 16px; /* below 16px, iOS zooms into the field */
  color: var(--ekb-foret);
}

.ekb-relais__search input:focus-visible {
  outline: 2px solid var(--ekb-foret);
  outline-offset: 1px;
}

/* Buttons and links ------------------------------------------------------ */

.ekb-button {
  justify-self: start;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--ekb-foret);
  color: var(--ekb-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms var(--ekb-ease-out), opacity 150ms ease;
}

.ekb-button:active {
  transform: scale(0.97);
}

.ekb-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.ekb-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ekb-foret);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ekb-button:focus-visible,
.ekb-link:focus-visible,
.ekb-relais__option input:focus-visible {
  outline: 2px solid var(--ekb-foret);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .ekb-relais__item:not(.is-selected):hover {
    border-color: #c5cec9;
  }

  .ekb-link:hover {
    text-decoration-thickness: 2px;
  }
}

@media (width < 480px) {
  .ekb-relais__search-fields {
    grid-template-columns: 1fr;
  }

  .ekb-relais__details {
    padding-left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ekb-free-shipping__bar,
  .ekb-button {
    transition: none;
  }
}
