/* =========================================================================
   dus_exitpopup — exit-intent offers & newsletter dialog
   Palette is derived from the Dus26 theme variables where they exist and
   falls back to the emerald/gold pairing used on the homepage banners.
   ========================================================================= */

/* Local tokens ----------------------------------------------------------- */
.dus-xpop {
   --xpop-green: #0c4a3c;
   --xpop-green-deep: #073327;
   --xpop-gold: var(--primary-color, #fad505);
   --xpop-ink: var(--secondary-color, #111111);
   --xpop-cream: #fbf8f0;
   --xpop-muted: #5a6b64;
   --xpop-line: #e2ddd0;
   --xpop-radius: var(--border-radius, 5px);
   --xpop-font: var(--body-font-family, Heebo), "Helvetica Neue", Arial, sans-serif;
}

/* Root container — fixed overlay above the sticky header ------------------ */
.dus-xpop {
   position: fixed;
   inset: 0;
   z-index: 99990;
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 20px;
   font-family: var(--xpop-font);
   line-height: 1.5;
}

.dus-xpop[hidden] {
   display: none;
}

/* Backdrop --------------------------------------------------------------- */
.dus-xpop__scrim {
   position: absolute;
   inset: 0;
   background: rgba(7, 26, 20, .62);
   opacity: 0;
   transition: opacity .22s ease;
}

.dus-xpop.is-open .dus-xpop__scrim {
   opacity: 1;
}

/* Dialog shell ----------------------------------------------------------- */
.dus-xpop__dialog {
   position: relative;
   display: flex;
   flex-direction: column;
   width: 100%;
   max-width: 880px;
   max-height: calc(100vh - 40px);
   overflow: hidden;
   background-color: var(--xpop-cream);
   border-radius: var(--xpop-radius);
   box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
   transform: translateY(14px) scale(.985);
   opacity: 0;
   transition: transform .26s cubic-bezier(.22, .8, .3, 1), opacity .26s ease;
   outline: none;
}

/* Scrolling middle, between the two bands -------------------------------- */
.dus-xpop__scroll {
   flex: 1 1 auto;
   overflow-y: auto;
   -webkit-overflow-scrolling: touch;
}

.dus-xpop.is-open .dus-xpop__dialog {
   transform: none;
   opacity: 1;
}

/* Khatam lattice bands — CSS background tiles, so no theme `svg {}` rule can
   stretch them the way an inline <svg> element gets stretched -------------- */
.dus-xpop__band {
   display: block;
   width: 100%;
   height: 24px;
   background-color: var(--xpop-green-deep);
   background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cg%20fill='none'%20stroke='%23fad505'%20stroke-width='1'%3E%3Cpath%20d='M4%2012%2012%204%2020%2012%2012%2020Z'/%3E%3Cpath%20d='M6%206h12v12H6z'/%3E%3Cpath%20d='M0%2012h4M20%2012h4M12%200v4M12%2020v4'/%3E%3C/g%3E%3C/svg%3E");
   background-repeat: repeat-x;
   background-position: center;
   background-size: 24px 24px;
   flex: 0 0 24px;
}

/* Optional khatam watermark behind the whole dialog --------------------- */
.dus-xpop__dialog--pattern {
   background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='72'%20height='72'%20viewBox='0%200%2072%2072'%3E%3Cg%20fill='none'%20stroke='%230c4a3c'%20stroke-opacity='.07'%20stroke-width='1.5'%3E%3Cpath%20d='M12%2036%2036%2012%2060%2036%2036%2060Z'/%3E%3Cpath%20d='M18%2018h36v36H18z'/%3E%3Cpath%20d='M0%2036h12M60%2036h12M36%200v12M36%2060v12'/%3E%3C/g%3E%3C/svg%3E");
   background-repeat: repeat;
   background-size: 72px 72px;
}

/* Text direction — the theme centres or right-aligns inherited text in
   places, so the dialog states its own alignment explicitly -------------- */
.dus-xpop__dialog,
.dus-xpop__content,
.dus-xpop__label,
.dus-xpop__form {
   text-align: left;
}

[dir="rtl"] .dus-xpop__dialog,
[dir="rtl"] .dus-xpop__content,
[dir="rtl"] .dus-xpop__label,
[dir="rtl"] .dus-xpop__form {
   text-align: right;
}

/* Close control ---------------------------------------------------------- */
.dus-xpop__close {
   position: absolute;
   top: 32px;
   right: 12px;
   width: 36px;
   height: 36px;
   padding: 0;
   font-size: 26px;
   line-height: 1;
   color: var(--xpop-muted);
   background: transparent;
   border: 0;
   border-radius: 50%;
   cursor: pointer;
   transition: background .15s ease, color .15s ease;
}

.dus-xpop__close:hover {
   color: var(--xpop-ink);
   background: rgba(12, 74, 60, .08);
}

/* Two-column layout ------------------------------------------------------ */
.dus-xpop__grid {
   display: flex;
   align-items: stretch;
}

.dus-xpop__art {
   flex: 0 0 40%;
   background: var(--xpop-green);
   display: flex;
   align-items: center;
   justify-content: center;
   overflow: hidden;
}

.dus-xpop__art img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   display: block;
}

.dus-xpop__content {
   flex: 1 1 auto;
   padding: 28px 32px 26px;
   min-width: 0;
}

.dus-xpop__content--wide {
   padding: 32px 40px 30px;
}

/* Eyebrow ---------------------------------------------------------------- */
.dus-xpop__eyebrow {
   margin: 0 0 6px;
   font-size: 11px;
   font-weight: 700;
   letter-spacing: .16em;
   text-transform: uppercase;
   color: var(--xpop-green);
}

/* Headings and copy ------------------------------------------------------ */
.dus-xpop__title {
   margin: 0 0 8px;
   font-family: var(--title-font-family, Heebo), sans-serif;
   font-size: 25px;
   font-weight: 700;
   line-height: 1.22;
   color: var(--xpop-ink);
}

.dus-xpop__sub {
   margin: 0 0 12px;
   font-size: 15px;
   color: var(--xpop-muted);
}

.dus-xpop__copy {
   margin: 0 0 16px;
   font-size: 14px;
   color: var(--xpop-muted);
}

.dus-xpop__copy p:last-child {
   margin-bottom: 0;
}

/* Offers link — primary action ------------------------------------------- */
.dus-xpop__cta {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 11px 20px;
   margin-bottom: 20px;
   font-size: 15px;
   font-weight: 700;
   color: var(--xpop-ink);
   text-decoration: none;
   background: var(--xpop-gold);
   border-radius: var(--xpop-radius);
   transition: transform .15s ease, box-shadow .15s ease;
}

.dus-xpop__cta:hover,
.dus-xpop__cta:focus {
   color: var(--xpop-ink);
   text-decoration: none;
   transform: translateY(-1px);
   box-shadow: 0 6px 16px rgba(12, 74, 60, .22);
}

.dus-xpop__arrow {
   transition: transform .15s ease;
}

.dus-xpop__cta:hover .dus-xpop__arrow {
   transform: translateX(3px);
}

/* Signup block — sits on its own card so it reads as a separate action --- */
.dus-xpop__form {
   margin-top: 20px;
   padding: 16px 18px 18px;
   background: rgba(255, 255, 255, .82);
   border: 1px solid var(--xpop-line);
   border-radius: var(--xpop-radius);
}

.dus-xpop__form-title {
   margin: 0 0 4px;
   font-family: var(--title-font-family, Heebo), sans-serif;
   font-size: 16px;
   font-weight: 700;
   color: var(--xpop-green);
}

.dus-xpop__form-intro {
   margin: 0 0 14px;
   font-size: 13px;
   color: var(--xpop-muted);
}

.dus-xpop__label {
   display: block;
   margin-bottom: 4px;
   font-size: 12px;
   font-weight: 600;
   color: var(--xpop-ink);
}

.dus-xpop__input {
   width: 100%;
   height: 42px;
   padding: 0 12px;
   font-family: inherit;
   font-size: 15px;
   color: var(--xpop-ink);
   background: #fff;
   border: 1px solid var(--xpop-line);
   border-radius: var(--xpop-radius);
   margin-bottom: 12px;
}

.dus-xpop__input:focus {
   border-color: var(--xpop-green);
   outline: 2px solid rgba(12, 74, 60, .18);
   outline-offset: 1px;
}

/* Email + button on one line --------------------------------------------- */
.dus-xpop__row {
   display: flex;
   gap: 8px;
   align-items: flex-start;
}

.dus-xpop__row .dus-xpop__input {
   flex: 1 1 auto;
}

.dus-xpop__submit {
   flex: 0 0 auto;
   height: 42px;
   padding: 0 22px;
   font-family: inherit;
   font-size: 15px;
   font-weight: 700;
   color: var(--xpop-cream);
   background: var(--xpop-green);
   border: 0;
   border-radius: var(--xpop-radius);
   cursor: pointer;
   transition: background .15s ease;
}

.dus-xpop__submit:hover:not(:disabled) {
   background: var(--xpop-green-deep);
}

.dus-xpop__submit:disabled {
   opacity: .6;
   cursor: default;
}

/* Honeypot — off screen, never shown ------------------------------------- */
.dus-xpop__hp {
   position: absolute;
   left: -5000px;
   width: 1px;
   height: 1px;
   overflow: hidden;
}

/* Status message --------------------------------------------------------- */
.dus-xpop__msg {
   margin: 4px 0 0;
   padding: 9px 12px;
   font-size: 14px;
   border-radius: var(--xpop-radius);
}

.dus-xpop__msg--ok {
   color: #0b5c3f;
   background: #e6f4ec;
}

.dus-xpop__msg--info {
   color: #6b5300;
   background: #fdf6d8;
}

.dus-xpop__msg--err {
   color: var(--price-color, #a90000);
   background: #fbeaea;
}

/* Small print ------------------------------------------------------------ */
.dus-xpop__foot {
   margin: 10px 0 0;
   font-size: 12px;
   color: var(--xpop-muted);
}

/* Secondary dismiss ------------------------------------------------------ */
.dus-xpop__dismiss {
   display: inline-block;
   margin-top: 14px;
   padding: 0;
   font-family: inherit;
   font-size: 13px;
   color: var(--xpop-muted);
   background: none;
   border: 0;
   text-decoration: underline;
   cursor: pointer;
}

.dus-xpop__dismiss:hover {
   color: var(--xpop-ink);
}

/* Keyboard focus --------------------------------------------------------- */
.dus-xpop :focus-visible {
   outline: 2px solid var(--xpop-gold);
   outline-offset: 2px;
}

/* Body scroll lock while the dialog is open ------------------------------ */
html.dus-xpop-locked,
html.dus-xpop-locked body {
   overflow: hidden;
}

/* Tablet and below — stack, drop the artwork ----------------------------- */
@media (max-width: 767px) {
   .dus-xpop {
      padding: 0;
      align-items: flex-end;
   }

   .dus-xpop__dialog {
      max-width: 100%;
      max-height: 92vh;
      border-radius: var(--xpop-radius) var(--xpop-radius) 0 0;
      transform: translateY(28px);
   }

   .dus-xpop__grid {
      flex-direction: column;
   }

   .dus-xpop__art {
      display: none;
   }

   .dus-xpop__content,
   .dus-xpop__content--wide {
      padding: 22px 20px 24px;
   }

   .dus-xpop__title {
      font-size: 21px;
   }

   .dus-xpop__row {
      flex-direction: column;
      gap: 0;
   }

   .dus-xpop__submit {
      width: 100%;
   }
}

/* Reduced motion --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

   .dus-xpop__scrim,
   .dus-xpop__dialog,
   .dus-xpop__cta,
   .dus-xpop__arrow {
      transition: none;
   }

   .dus-xpop__dialog {
      transform: none;
   }
}
