/**
 * Prisderma AJAX Add to Cart
 *
 * Deliberately inherits font-family, letter-spacing and text-transform from the
 * active theme so the modal reads as part of the site rather than as a plugin.
 * The accent colour and corner radius are injected from the settings screen.
 */

:root {
  --pac-accent: #1f1f1f;
  --pac-accent-dark: #000000;
  --pac-radius: 8px;
}

/* Modal ------------------------------------------------------------------ */

.pac-modal[hidden] {
  display: none;
}

.pac-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pac-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  animation: pac-fade 0.2s ease-out;
}

.pac-modal__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--pac-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: pac-rise 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.pac-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: #8a8a8a;
  cursor: pointer;
}

.pac-modal__close:hover {
  color: #111;
}

.pac-modal__body {
  padding: 38px 30px 26px;
  text-align: center;
}

.pac-modal__tick {
  display: block;
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--pac-accent);
  position: relative;
  animation: pac-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pac-modal__tick::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 17px;
  width: 11px;
  height: 19px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.pac-modal__title {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.3;
  color: inherit;
  font-family: inherit;
}

.pac-modal__product {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: inherit;
}

.pac-modal__variation {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.7;
}

.pac-modal__actions {
  display: flex;
  gap: 10px;
  padding: 0 30px 30px;
}

.pac-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: var(--pac-radius);
  font-size: 14px;
  font-family: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.pac-btn--solid,
.pac-btn--solid:visited {
  background: var(--pac-accent);
  border: 1px solid var(--pac-accent);
  color: #fff;
}

.pac-btn--solid:hover,
.pac-btn--solid:focus {
  background: var(--pac-accent-dark);
  border-color: var(--pac-accent-dark);
  color: #fff;
}

.pac-btn--ghost {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.18);
  color: inherit;
}

.pac-btn--ghost:hover,
.pac-btn--ghost:focus {
  border-color: var(--pac-accent);
  color: var(--pac-accent);
}

body.pac-modal-open {
  overflow: hidden;
}

/* Toasts ----------------------------------------------------------------- */

.pac-toasts {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.pac-toast {
  position: relative;
  min-width: 260px;
  max-width: 360px;
  padding: 14px 40px 14px 16px;
  background: #fff;
  border-left: 3px solid var(--pac-accent);
  border-radius: var(--pac-radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  font-size: 14px;
  line-height: 1.45;
  color: #1f1f1f;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(16px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.pac-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.pac-toast--error {
  border-left-color: #c0392b;
}

.pac-toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 19px;
  line-height: 1;
  color: #9a9a9a;
  cursor: pointer;
}

.pac-toast__close:hover {
  color: #111;
}

/* Inline confirmation ---------------------------------------------------- */

.pac-hidden-by-pac {
  display: none !important;
}

.pac-added {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  animation: pac-rise 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.pac-added__msg {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.85;
}

.pac-added__msg::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 8px;
  margin-right: 9px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translateY(-3px);
}

/* Continue shopping and the theme's view-cart button sit side by side, on the
   same row, matching how the theme lays out its own button pair. */
.pac-added__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.pac-added__actions > * {
  margin: 0 !important;
  float: none !important;
}

/* The adopted theme button often ships as a block-level or floated element. */
.pac-added__actions .pac-adopted {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.pac-continue {
  color: var(--qode-main-color) !important;
  background-color: transparent !important;
  border-color: var(--qode-main-color) !important;
}

.pac-continue:hover {
  background-color: rgb(30, 81, 48) !important;
  color: #fff !important;
}

.qodef-buy-now-button {
  display: none !important;
}

/* Fallback styling, used only when no theme classes are configured. */
.pac-continue:not([class*=" button"]):not([class^="button"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: var(--pac-radius);
  font-size: 14px;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.pac-continue:not([class*=" button"]):not([class^="button"]):hover {
  border-color: var(--pac-accent);
  color: var(--pac-accent);
}

@media (max-width: 480px) {
  .pac-added__actions {
    flex-direction: column;
  }

  .pac-added__actions > * {
    width: 100%;
  }
}

/* Field validation ------------------------------------------------------- */

.pac-field-error {
  outline: 2px solid #c0392b;
  outline-offset: 1px;
}

/* Loading state ---------------------------------------------------------- */

.pac-loading {
  opacity: 0.6;
  cursor: progress;
  pointer-events: none;
}

/* Animations ------------------------------------------------------------- */

@keyframes pac-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pac-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pac-pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pac-modal__backdrop,
  .pac-modal__panel,
  .pac-modal__tick {
    animation: none;
  }

  .pac-toast {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 600px) {
  .pac-modal__body {
    padding: 32px 22px 22px;
  }

  .pac-modal__actions {
    flex-direction: column;
    padding: 0 22px 24px;
  }

  .pac-toasts {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  .pac-toast {
    min-width: 0;
    max-width: none;
  }
}
