/**
 * Surface Kit - Notice Popup Styles
 *
 * @package Dear_Sticky
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --drstk-primary: #005a5b;
  --drstk-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* ============================================
   Sticky Navbar
   ============================================ */
.wp-site-blocks > .surfacekit-navbar {
  margin-block-start: 0;
}

.drstk-navbar {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-sizing: border-box;
  transition: top 0.3s ease-in-out;
}

.drstk-navbar.is-top {
  top: 0;
}

/* ============================================
   Notice Popup  Overlay Backdrop
   ============================================ */
.drstk-notice-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drstk-notice-popup-overlay.drstk-notice-popup-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   Notice Popup  Card
   ============================================ */
.drstk-notice-popup {
  /* Centered fixed positioning */
  position: fixed;
  top: 6%;
  right: 3%;
  transform: translate(-50%, -50%) translateY(20px);

  /* Sizing */
  width: 360px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;

  /* Visual */
  background: #ffffff;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.1);
  font-family: var(--drstk-font);
  color: #1f2937;

  /* Layering & animation */
  z-index: 1000001;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.drstk-notice-popup.drstk-notice-popup--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) translateY(0);
}

.drstk-notice-popup.drstk-notice-popup--hiding {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(12px);
  pointer-events: none;
}

/* ============================================
   Notice Popup  Header
   ============================================ */
.drstk-notice-popup__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.drstk-notice-popup__icon-wrap {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--drstk-popup-bg, #005a5b);
}

.drstk-notice-popup__title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.drstk-notice-popup__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.drstk-notice-popup__close:hover {
  background: #e5e7eb;
  color: #111827;
}

.drstk-notice-popup__close svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   Notice Popup  Body
   ============================================ */
.drstk-notice-popup__body {
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

.drstk-notice-popup__body p {
  margin: 0 0 8px;
}

.drstk-notice-popup__body p:last-child {
  margin-bottom: 0;
}

.drstk-notice-popup__body a {
  color: var(--drstk-popup-bg, #005a5b);
  text-decoration: underline;
  font-weight: 500;
}

.drstk-notice-popup__body a:hover {
  text-decoration: none;
}

/* ============================================
   Notice Popup  Footer
   ============================================ */
.drstk-notice-popup__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 18px;
}

.drstk-notice-popup__later {
  background: #f3f4f6;
  border: none;
  border-radius: 4px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease;
  font-family: var(--drstk-font);
  white-space: nowrap;
}

.drstk-notice-popup__later:hover {
  background: #e5e7eb;
  color: #374151;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
  .drstk-notice-popup {
    width: calc(100vw - 24px);
    border-radius: 0;
  }

  .drstk-notice-popup__header {
    padding: 14px 16px 12px;
  }

  .drstk-notice-popup__body {
    padding: 12px 16px;
    font-size: 13px;
  }

  .drstk-notice-popup__footer {
    padding: 0 16px 16px;
  }
}

/* ============================================
   Animation variants
   ============================================ */

/* Fade */
.drstk-notice-popup--anim-fade {
  transform: translate(-50%, -50%);
}
.drstk-notice-popup--anim-fade.drstk-notice-popup--visible {
  transform: translate(-50%, -50%);
}
.drstk-notice-popup--anim-fade.drstk-notice-popup--hiding {
  transform: translate(-50%, -50%);
}

/* Slide Down */
.drstk-notice-popup--anim-slide-down {
  transform: translate(-50%, calc(-50% - 40px));
}
.drstk-notice-popup--anim-slide-down.drstk-notice-popup--visible {
  transform: translate(-50%, -50%);
}
.drstk-notice-popup--anim-slide-down.drstk-notice-popup--hiding {
  transform: translate(-50%, calc(-50% - 20px));
}

/* Bounce */
@keyframes drstk-popup-bounce {
  0% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 30px)) scale(0.9);
  }
  60% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 6px)) scale(1.02);
  }
  80% {
    transform: translate(-50%, calc(-50% + 3px)) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
.drstk-notice-popup--anim-bounce {
  transition: none;
}
.drstk-notice-popup--anim-bounce.drstk-notice-popup--visible {
  animation: drstk-popup-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
}
.drstk-notice-popup--anim-bounce.drstk-notice-popup--hiding {
  opacity: 0;
  transition: opacity 0.2s ease;
  transform: translate(-50%, -50%) scale(0.95);
}

/* ============================================
   Optional banner image
   ============================================ */
.drstk-notice-popup__image {
  display: block;
  width: 100%;
  height: auto;
}

/* ============================================
   CTA Button
   ============================================ */
.drstk-notice-popup__cta {
  flex: 1;
  display: block;
  text-align: center;
  background: var(--drstk-popup-bg, #005a5b);
  color: var(--drstk-popup-color, #ffffff);
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.18s ease;
  font-family: var(--drstk-font);
  line-height: 1.4;
}
.drstk-notice-popup__cta:hover {
  filter: brightness(0.92);
  text-decoration: none;
  color: var(--drstk-popup-color, #ffffff);
}

/* Footer with only Later (no CTA) — right-align */
.drstk-notice-popup__footer:not(:has(.drstk-notice-popup__cta)) {
  justify-content: flex-end;
}

/* ============================================
   Queue navigation  (remove — sequential now)
   ============================================ */
.drstk-notice-popup__queue-nav {
  display: none !important;
}

/* ============================================
   Notification type  icon-wrap colours
   ============================================ */
.drstk-notice-popup[data-type="notice"] .drstk-notice-popup__icon-wrap {
  background: #eff6ff;
  color: #005a5b;
}
.drstk-notice-popup[data-type="offer"] .drstk-notice-popup__icon-wrap {
  background: #f0fdf4;
  color: #059669;
}
.drstk-notice-popup[data-type="warning"] .drstk-notice-popup__icon-wrap {
  background: #fffbeb;
  color: #d97706;
}
.drstk-notice-popup[data-type="success"] .drstk-notice-popup__icon-wrap {
  background: #f0fdf4;
  color: #16a34a;
}
.drstk-notice-popup[data-type="info"] .drstk-notice-popup__icon-wrap {
  background: #eef2ff;
  color: #4f46e5;
}

/* ============================================
   MODE: drstk-imgbox — Image-only lightbox
   ============================================ */
.drstk-notice-popup--mode-imgbox {
  /* Reset standard popup sizing */
  width: auto;
  max-width: 90vw;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  /* Centered */
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%) scale(0.96);
  overflow: visible;
}

.drstk-notice-popup--mode-imgbox.drstk-notice-popup--visible {
  transform: translate(-50%, -50%) scale(1);
}

.drstk-notice-popup--mode-imgbox.drstk-notice-popup--hiding {
  transform: translate(-50%, -50%) scale(0.94);
}

.drstk-notice-popup--mode-imgbox .drstk-notice-popup__image {
  display: block;
  max-width: 90vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 3px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* X button overlaid in the top-right corner of the image */
.drstk-imgbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f2937;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 2;
  padding: 0;
  transition:
    background 0.15s,
    transform 0.15s;
}

.drstk-imgbox__close:hover {
  background: #f3f4f6;
  transform: scale(1.1);
}

.drstk-imgbox__close svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   MODE: drstk-corner-toast — Top-right corner card
.drstk-corner-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  min-width: 180px;
  max-width: 260px;
  background: #f9fafb;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  z-index: 10000;
  overflow: hidden;
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  padding: 0;
}

/* Gradient accent line at the top */
.drstk-corner-toast::before {
  content: "";
  display: block;
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, #005a5b 0%, #00797a 100%);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.drstk-notice-popup--mode-corner-toast.drstk-notice-popup--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.drstk-notice-popup--mode-corner-toast.drstk-notice-popup--hiding {
  opacity: 0;
  transform: translateX(110%);
}

/* Corner toast inner layout */
.drstk-corner-toast__header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.07);
  margin-bottom: 2px;
  padding: 14px 14px 10px;
}

.drstk-corner-toast__header .drstk-notice-popup__icon-wrap {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.drstk-corner-toast__header .drstk-notice-popup__title {
  font-size: 14px;
  font-weight: 700;
}

.drstk-corner-toast__header .drstk-notice-popup__close {
  margin-left: auto;
}

.drstk-corner-toast__image {
  width: 100%;
  height: auto;
  display: block;
  max-height: 160px;
  object-fit: cover;
}

.drstk-corner-toast__body {
  padding: 6px 14px 10px;
  font-size: 13px;
}

.drstk-corner-toast__footer {
  padding: 0 14px 14px;
}

.drstk-corner-toast__footer .drstk-notice-popup__cta {
  display: inline-block;
  flex: none;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 6px;
}

/* Corner toast animation keyframes */
@keyframes drstk-toast-slide-in {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Corner toast: no overlay needed — hide it if present */
.drstk-notice-popup--mode-corner-toast ~ .drstk-notice-popup-overlay,
body:has(.drstk-notice-popup--mode-corner-toast) .drstk-notice-popup-overlay {
  display: none !important;
}

/* Responsive: stack to bottom-right on tiny screens */
@media (max-width: 400px) {
  .drstk-notice-popup--mode-corner-toast {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: 100%;
    border-radius: 8px;
  }
}
