/* Colete Online — site-wide return modal. Light, neutral styling that sits well
   on a standard (white) storefront theme; buttons reuse whatever button classes
   the host theme applies so they inherit the shop's look. A dark theme can
   override any of these via the .col-return-* classes. */

.col-return-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.55);
  padding: 24px;
  overflow-y: auto;
}
.col-return-overlay.is-open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.col-return-modal {
  position: relative;
  background: #ffffff;
  color: #1f2933;
  width: 100%;
  max-width: 520px;
  margin: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 44px rgba(15, 23, 42, 0.18);
  padding: 28px 28px 20px;
  box-sizing: border-box;
}

.col-return-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 4px;
}
.col-return-close:hover {
  color: #1f2933;
  background: #f3f4f6;
}

.col-return-title {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f2;
  font-size: 1.3em;
  line-height: 1.2;
}

.col-return-field {
  display: block;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 0.95em;
}
.col-return-field input,
.col-return-search {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 400;
  color: inherit;
  background: #fff;
}
.col-return-field input:focus,
.col-return-search:focus {
  outline: none;
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.25);
}

.col-return-search {
  margin: 0 0 14px;
}

.col-return-list {
  max-height: 55vh;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.col-return-order {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fcfcfd;
}
.col-return-order:hover {
  border-color: #d1d5db;
}
.col-return-order-head {
  margin-bottom: 6px;
}
.col-return-order-items {
  font-size: 0.9em;
  color: #6b7280;
  margin-bottom: 12px;
}
.col-return-order-items s {
  opacity: 0.75;
}

.col-return-error {
  color: #b42318;
  margin: 0 0 14px;
}
.col-return-success {
  color: #12805c;
  margin: 0 0 16px;
}
.col-return-loading {
  color: #6b7280;
}

/* A disabled confirm button (nothing in the order can be returned) + its note. */
.col-return-modal .button {
  cursor: pointer;
}
.col-return-modal .button[disabled],
.col-return-modal .button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.col-return-note {
  margin: 8px 0 0;
  font-size: 0.85em;
  color: #b42318;
}

.col-return-powered {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #eef0f2;
  text-align: right;
  font-size: 0.78em;
  color: #6b7280;
}
.col-return-powered a {
  color: inherit;
  text-decoration: none;
}
.col-return-powered a:hover {
  text-decoration: underline;
}

/* ── Embedded portal page ([coleteonline_return_portal]) ────────────── */

.coleteonline-return-portal__frame {
  display: block;
  width: 100%;
  border: 0;
  /* Starting height until the first resize message lands. */
  height: 640px;
}

.coleteonline-return-portal__powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  margin-top: 0.75em;
  font-size: 0.85em;
  opacity: 0.75;
}

.coleteonline-return-portal__powered a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}

.coleteonline-return-portal__powered img {
  height: 1.5em;
  width: auto;
}

/* Handshake states: while waiting for the portal's first resize message
   the frame is COVERED by an opaque loading overlay - never visibility- or
   display-hidden, because Chromium throttles rendering inside invisible
   iframes, which would starve the embedded app and deadlock the handshake.
   A missing handshake swaps the frame for the retry box. Without JS neither
   state class is ever set and the iframe simply shows. */
.coleteonline-return-portal {
  position: relative;
}

.coleteonline-return-portal.is-loading .coleteonline-return-portal__frame {
  min-height: 160px;
}

.coleteonline-return-portal.is-failed .coleteonline-return-portal__frame {
  display: none;
}

.coleteonline-return-portal__loading,
.coleteonline-return-portal__fallback {
  display: none;
  text-align: center;
  padding: 2em 1em;
}

.coleteonline-return-portal.is-loading .coleteonline-return-portal__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  background: #fff;
}

@media (prefers-color-scheme: dark) {
  .coleteonline-return-portal.is-loading .coleteonline-return-portal__loading {
    background: #1f1f1f;
    color: #f0f0f0;
  }
}

.coleteonline-return-portal.is-failed .coleteonline-return-portal__fallback {
  display: block;
}

.coleteonline-return-portal__fallback p {
  margin: 0 0 1em;
}
