/* AWT Popups — refined neutral UI skin for PrestaShop 9.1 (CSS-only hotfix).
   All selectors are scoped to the module, to avoid theme collisions.
   No markup, PHP, hook, JS, or database changes. */
body.awtpopups-open { overflow: hidden !important; }

.awtpopups-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(16, 24, 39, .56);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  -webkit-overflow-scrolling: touch;
}

.awtpopups-overlay > .awtpopups-dialog {
  --awtpopups-width: 600px;
  --awtpopups-text: #202532;
  --awtpopups-muted: #505b6c;
  --awtpopups-primary: #202532;
  position: relative;
  box-sizing: border-box;
  container-type: inline-size;
  flex: 0 1 var(--awtpopups-width);
  width: 100%;
  max-width: 100%;
  max-height: min(88vh, 900px);
  max-height: min(88dvh, 900px);
  overflow-y: auto;
  padding: clamp(22px, 3.6vw, 34px);
  border: 1px solid rgba(15, 23, 42, .07);
  border-radius: 18px;
  background: #fff !important;
  box-shadow: 0 24px 80px rgba(11, 18, 33, .22), 0 3px 14px rgba(11, 18, 33, .07);
  color: var(--awtpopups-text);
  font-family: inherit;
  text-align: left;
}

.awtpopups-dialog *,
.awtpopups-dialog *::before,
.awtpopups-dialog *::after { box-sizing: border-box; }

.awtpopups-dialog .awtpopups-heading {
  margin: 0 40px 23px 0;
  padding: 0;
  font-family: inherit;
  font-size: clamp(22px, 2.6vw, 27px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.025em;
  color: var(--awtpopups-text);
  text-transform: none;
}

.awtpopups-dialog .awtpopups-close {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  z-index: 1;
  top: 17px;
  right: 17px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid #e6e9ee !important;
  border-radius: 50%;
  background: #f8fafc !important;
  color: #536072 !important;
  box-shadow: none !important;
  font: normal 25px/1 Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.awtpopups-dialog .awtpopups-close span {
  display: block;
  transform: translateY(-1px);
  line-height: 1;
}
.awtpopups-dialog .awtpopups-close:hover {
  background: #eef1f5 !important;
  border-color: #d4dae3 !important;
  color: #202532 !important;
}
.awtpopups-dialog .awtpopups-close:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 3px;
}

.awtpopups-dialog .awtpopups-content {
  display: block;
  min-width: 0;
  color: var(--awtpopups-muted);
  font-size: 15px;
  line-height: 1.62;
}
.awtpopups-dialog .awtpopups-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 205px;
  margin: 0 auto 18px;
  border-radius: 8px;
  object-fit: contain;
}
.awtpopups-dialog .awtpopups-html {
  min-width: 0;
  overflow-wrap: anywhere;
}
.awtpopups-dialog .awtpopups-html > :first-child { margin-top: 0; }
.awtpopups-dialog .awtpopups-html > :last-child { margin-bottom: 0; }
.awtpopups-dialog .awtpopups-html img { max-width: 100%; height: auto; }
.awtpopups-dialog .awtpopups-html a { text-decoration: underline; }
.awtpopups-dialog .awtpopups-html p { margin: 0 0 .9em; }
.awtpopups-dialog .awtpopups-html h2,
.awtpopups-dialog .awtpopups-html h3,
.awtpopups-dialog .awtpopups-html h4 {
  margin: 0 0 .5em;
  font-size: 1.15em;
  line-height: 1.35;
  font-weight: 650;
  color: var(--awtpopups-text);
}
.awtpopups-dialog .awtpopups-html ul,
.awtpopups-dialog .awtpopups-html ol { margin: .5em 0 0; padding-left: 1.4em; }

.awtpopups-dialog .awtpopups-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
  margin: 23px 0 0;
  padding: 0;
}
.awtpopups-dialog .awtpopups-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 11px 22px;
  border: 1px solid var(--awtpopups-primary);
  border-radius: 10px;
  background: var(--awtpopups-primary);
  box-shadow: 0 5px 13px rgba(20, 29, 46, .12);
  color: white !important;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  text-decoration: none !important;
  transition: background .18s, box-shadow .18s, transform .18s;
}
.awtpopups-dialog .awtpopups-cta:hover {
  background: #343e4f;
  border-color: #343e4f;
  box-shadow: 0 7px 17px rgba(20, 29, 46, .18);
  color: white !important;
  text-decoration: none !important;
}
.awtpopups-dialog .awtpopups-cta:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 3px;
}

/* On a sufficiently wide modal, place the illustration beside the copy.
   Container query considers the configured modal width, not just the screen. */
@container (min-width: 480px) {
  .awtpopups-dialog .awtpopups-content:has(> .awtpopups-image):has(> .awtpopups-html) {
    display: grid;
    grid-template-columns: minmax(0, 156px) minmax(0, 1fr);
    column-gap: 24px;
    align-items: center;
  }
  .awtpopups-dialog .awtpopups-content:has(> .awtpopups-image):has(> .awtpopups-html) > .awtpopups-image {
    margin: 0 auto;
    max-height: 176px;
  }
  .awtpopups-dialog .awtpopups-content:has(> .awtpopups-image):has(> .awtpopups-html) + .awtpopups-actions {
    padding-left: 180px;
  }
}

/* If there is an image but no written content, keep the CTA centered. */
.awtpopups-dialog .awtpopups-content:has(> .awtpopups-image):not(:has(> .awtpopups-html)) + .awtpopups-actions {
  justify-content: center;
}

@media (max-width: 575px) {
  .awtpopups-overlay { padding: 12px; }
  .awtpopups-overlay > .awtpopups-dialog {
    max-height: 92vh;
    max-height: 92dvh;
    padding: 25px 21px 23px;
    border-radius: 15px;
  }
  .awtpopups-dialog .awtpopups-heading {
    margin: 0 40px 17px 0;
    font-size: 22px;
  }
  .awtpopups-dialog .awtpopups-close { top: 12px; right: 12px; }
  .awtpopups-dialog .awtpopups-content { font-size: 14.5px; }
  .awtpopups-dialog .awtpopups-image { max-height: 160px; }
  .awtpopups-dialog .awtpopups-actions .awtpopups-cta { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .awtpopups-overlay > .awtpopups-dialog { animation: awtpopups-appear .2s cubic-bezier(.2,.75,.25,1) both; }
  @keyframes awtpopups-appear {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}
