/* NOVVIA Popups — Frontend Cos Design System v1.1.0
   Tokens spiegeln das Shop-Theme (novvia): Cream, Copper, Soft-Blue, Manrope/Cormorant.
   Pro Popup steuerbar via CSS-Variablen auf .novvia-popup-box / .novvia-popup-overlay.
*/

/* ===== TOKENS (Defaults = Cos Shop) ===== */
.novvia-popup-overlay,
.novvia-popup {
  --nvp-bg: var(--nv-white, #ffffff);
  --nvp-text: var(--nv-gray-900, #120d0d);
  --nvp-muted: var(--nv-gray-500, #7a7572);
  --nvp-accent: var(--nv-copper, #b8956b);
  --nvp-accent-hover: var(--nv-copper-light, #d4b896);
  --nvp-accent-text: #ffffff;
  --nvp-border: var(--nv-gray-100, #ece8e3);
  --nvp-soft: var(--nv-blue-soft, #edf1f6);
  --nvp-cream: var(--nv-cream, #fdf3ea);
  --nvp-radius: var(--nv-radius-lg, 16px);
  --nvp-pad: clamp(1.25rem, 3vw, 2rem);
  --nvp-shadow: var(--nv-shadow-md, 0 12px 40px rgba(26, 26, 24, 0.08));
  --nvp-font: var(--nv-font-sans, "Manrope", system-ui, -apple-system, sans-serif);
  --nvp-font-display: var(--nv-font-serif, "Cormorant Garamond", "Times New Roman", serif);
  --nvp-focus: var(--nv-blue-dark, #5f7591);
  --nvp-success: var(--nv-green-dark, #567a65);
  --nvp-success-bg: var(--nv-green-soft, #e9f1ec);
  --nvp-transition: var(--nv-transition, 0.25s cubic-bezier(0.4, 0, 0.2, 1));
}

/* ===== MODAL BOX ===== */
.novvia-popup-overlay {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.novvia-popup-box {
  background: var(--nvp-bg);
  color: var(--nvp-text);
  border-radius: var(--nvp-radius);
  box-shadow: var(--nvp-shadow);
  font-family: var(--nvp-font);
  line-height: 1.55;
  border: var(--nvp-box-border, none);
}

.novvia-popup-box[data-font="serif"] {
  --nvp-font: var(--nvp-font-display);
}
.novvia-popup-box[data-font="sans"] {
  --nvp-font: var(--nv-font-sans, "Manrope", system-ui, sans-serif);
  --nvp-font-display: var(--nv-font-sans, "Manrope", system-ui, sans-serif);
}
.novvia-popup-box[data-font="cos"],
.novvia-popup-box:not([data-font]) {
  /* Shop-Default: Sans Body + Serif Headings */
}

.novvia-popup-box[data-shadow="none"]   { --nvp-shadow: none; }
.novvia-popup-box[data-shadow="soft"]   { --nvp-shadow: 0 4px 20px rgba(26, 26, 24, 0.06); }
.novvia-popup-box[data-shadow="medium"] { --nvp-shadow: 0 12px 40px rgba(26, 26, 24, 0.12); }
.novvia-popup-box[data-shadow="strong"] { --nvp-shadow: 0 24px 64px rgba(18, 13, 13, 0.22); }

.novvia-popup-box[data-border="subtle"] { --nvp-box-border: 1px solid var(--nvp-border); }
.novvia-popup-box[data-border="copper"] { --nvp-box-border: 1px solid rgba(184, 149, 107, 0.45); }
.novvia-popup-box[data-border="blue"]   { --nvp-box-border: 1px solid rgba(169, 185, 207, 0.65); }

.novvia-popup-content {
  padding: var(--nvp-pad);
  color: var(--nvp-text);
}

.novvia-popup-content[data-pad="sm"] { --nvp-pad: 1rem 1.15rem; }
.novvia-popup-content[data-pad="md"] { --nvp-pad: clamp(1.25rem, 3vw, 1.75rem); }
.novvia-popup-content[data-pad="lg"] { --nvp-pad: clamp(1.75rem, 4vw, 2.5rem); }
.novvia-popup-content[data-pad="xl"] { --nvp-pad: clamp(2rem, 5vw, 3rem); }

.novvia-popup-content h1,
.novvia-popup-content h2,
.novvia-popup-content h3,
.novvia-popup-content .nvp-title {
  font-family: var(--nvp-font-display);
  font-weight: 550;
  color: var(--nvp-text);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.65em;
}

.novvia-popup-content h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
.novvia-popup-content h2 { font-size: clamp(1.45rem, 2.5vw, 1.85rem); }
.novvia-popup-content h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }

.novvia-popup-content p {
  margin: 0 0 0.9em;
  color: var(--nvp-muted);
  font-size: 0.98rem;
}

.novvia-popup-content a:not(.button):not(.wp-block-button__link) {
  color: var(--nv-blue-dark, #5f7591);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.novvia-popup-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--nv-radius-md, 8px);
}

.novvia-popup-content iframe {
  max-width: 100%;
}

/* ===== CLOSE BUTTON ===== */
.novvia-popup-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  border: 1px solid var(--nvp-border);
  background: #f7f4f0;
  color: var(--nvp-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  z-index: 2;
  transition: background var(--nvp-transition), color var(--nvp-transition), transform var(--nvp-transition), border-color var(--nvp-transition);
}

.novvia-popup-close:hover {
  background: var(--nvp-cream);
  border-color: rgba(184, 149, 107, 0.45);
  color: var(--nvp-text);
}

.novvia-popup-close:focus-visible {
  outline: 2px solid var(--nvp-focus);
  outline-offset: 2px;
}

/* ===== CTAs / Buttons im Popup ===== */
/* Button-Reihen: gleiche Höhe/Mindestbreite */
.novvia-popup-content p:has(> .button),
.novvia-popup-content p:has(> a.button),
.novvia-popup-content .nvp-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: stretch;
}

.novvia-popup-content .button,
.novvia-popup-content .button-primary,
.novvia-popup-content a.button,
.novvia-popup-content .wp-block-button__link,
.novvia-popup-content button[type="submit"],
.novvia-popup-box .nvp-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  background: var(--nvp-accent) !important;
  color: var(--nvp-accent-text) !important;
  border: none !important;
  border-radius: var(--nv-radius-md, 8px);
  padding: 0.85em 1.4em;
  min-height: 44px;
  min-width: 9.5rem;
  box-sizing: border-box;
  font-family: var(--nvp-font);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  cursor: pointer;
  transition: background var(--nvp-transition), transform var(--nvp-transition), box-shadow var(--nvp-transition);
  box-shadow: 0 4px 14px rgba(184, 149, 107, 0.25);
}

.novvia-popup-content p:has(> .button) > .button,
.novvia-popup-content p:has(> a.button) > a.button,
.novvia-popup-content .nvp-btn-row > .button,
.novvia-popup-content .nvp-btn-row > a.button {
  flex: 1 1 9.5rem;
}

.novvia-popup-content .button:hover,
.novvia-popup-content .button-primary:hover,
.novvia-popup-content a.button:hover,
.novvia-popup-content .wp-block-button__link:hover,
.novvia-popup-content button[type="submit"]:hover:not(:disabled),
.novvia-popup-box .nvp-cta:hover {
  background: var(--nvp-accent-hover) !important;
  color: var(--nvp-text) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(184, 149, 107, 0.3);
}

.novvia-popup-content .button:focus-visible,
.novvia-popup-content button[type="submit"]:focus-visible,
.novvia-popup-box .nvp-cta:focus-visible {
  outline: 2px solid var(--nvp-focus);
  outline-offset: 2px;
}

.novvia-popup-content .button:not(.button-primary):not(.wp-block-button__link) {
  background: transparent !important;
  color: var(--nvp-text) !important;
  border: 1px solid var(--nvp-border) !important;
  box-shadow: none;
}

.novvia-popup-content .button:not(.button-primary):not(.wp-block-button__link):hover {
  border-color: var(--nvp-accent) !important;
  background: var(--nvp-cream) !important;
  color: var(--nvp-text) !important;
}

/* ===== STICKY-BAR (Top/Bottom Banner) ===== */
.novvia-popup[data-popup-type="bar_top"],
.novvia-popup[data-popup-type="bar_bottom"] {
  position: fixed;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, var(--nv-gray-900, #120d0d), #2a3544 55%, var(--nv-blue-dark, #5f7591));
  color: #fff;
  padding: 12px 48px 12px 20px;
  z-index: 99999;
  box-shadow: 0 4px 20px rgba(18, 13, 13, 0.12);
  font-family: var(--nvp-font);
  font-size: 14px;
  text-align: center;
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.novvia-popup[data-popup-type="bar_top"] { top: 0; }
.novvia-popup[data-popup-type="bar_bottom"] {
  bottom: 0;
  transform: translateY(100%);
}
.novvia-popup[data-popup-type="bar_top"].open,
.novvia-popup[data-popup-type="bar_bottom"].open {
  transform: translateY(0);
}

.novvia-popup[data-popup-type="bar_top"] a,
.novvia-popup[data-popup-type="bar_bottom"] a {
  color: var(--nv-copper-light, #d4b896);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.novvia-popup[data-popup-type="bar_top"] .novvia-popup-close,
.novvia-popup[data-popup-type="bar_bottom"] .novvia-popup-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 20px;
  width: 32px;
  height: 32px;
}

/* ===== SLIDE-IN (Bottom-Right Toast) ===== */
.novvia-popup[data-popup-type="slide_in"] {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 340px;
  background: var(--nvp-bg);
  color: var(--nvp-text);
  border-radius: var(--nvp-radius);
  border: 1px solid var(--nvp-border);
  box-shadow: var(--nvp-shadow);
  padding: 18px 22px;
  z-index: 99998;
  font-family: var(--nvp-font);
  transform: translateX(110%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.novvia-popup[data-popup-type="slide_in"].open {
  transform: translateX(0);
}

.novvia-popup[data-popup-type="slide_in"] .novvia-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--nvp-soft);
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--nvp-muted);
}

/* ===== INLINE ===== */
.novvia-popup[data-popup-type="inline"] {
  position: static;
  background: var(--nvp-cream);
  border: 1px solid var(--nvp-border);
  border-radius: var(--nvp-radius);
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--nv-shadow-sm, 0 4px 20px rgba(26, 26, 24, 0.04));
  font-family: var(--nvp-font);
  color: var(--nvp-text);
}

/* ===== LEAD-FORM ===== */
.novvia-popup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.novvia-popup-form input[type="text"],
.novvia-popup-form input[type="email"],
.novvia-popup-form input[type="tel"] {
  border: 1px solid var(--nvp-border);
  border-radius: var(--nv-radius-md, 8px);
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--nvp-font);
  color: var(--nvp-text);
  background: #fff;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--nvp-transition), box-shadow var(--nvp-transition);
}

.novvia-popup-form input::placeholder {
  color: var(--nv-gray-400, #a8a4a0);
}

.novvia-popup-form input:focus {
  outline: none;
  border-color: var(--nvp-accent);
  box-shadow: 0 0 0 3px rgba(184, 149, 107, 0.2);
}

.novvia-popup-form input:focus-visible {
  outline: 2px solid var(--nvp-focus);
  outline-offset: 1px;
}

.novvia-popup-form .hp-field {
  position: absolute !important;
  left: -9999px !important;
  height: 0 !important;
  width: 0 !important;
  opacity: 0 !important;
}

.novvia-popup-form button[type="submit"] {
  background: var(--nvp-accent);
  color: var(--nvp-accent-text);
  border: none;
  border-radius: var(--nv-radius-md, 8px);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--nvp-font);
  cursor: pointer;
  transition: transform var(--nvp-transition), box-shadow var(--nvp-transition), background var(--nvp-transition);
}

.novvia-popup-form button[type="submit"]:hover:not(:disabled) {
  background: var(--nvp-accent-hover);
  color: var(--nvp-text);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(184, 149, 107, 0.28);
}

.novvia-popup-form label.consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--nvp-muted);
  cursor: pointer;
}

.novvia-popup-form label.consent input {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--nvp-accent);
}

.novvia-popup-success {
  background: var(--nvp-success-bg);
  border: 1px solid rgba(86, 122, 101, 0.22);
  padding: 18px;
  border-radius: var(--nv-radius-md, 8px);
  text-align: center;
  color: var(--nvp-success);
  font-family: var(--nvp-font);
}

/* ===== COUPON-DISPLAY ===== */
.nv-coupon-code {
  display: inline-block;
  font-family: var(--nvp-font);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--nvp-cream);
  color: var(--nv-gray-800, #2d2828);
  padding: 10px 18px;
  border: 1.5px dashed var(--nvp-accent);
  border-radius: var(--nv-radius-md, 8px);
  user-select: all;
  cursor: pointer;
}

/* ===== COUNTDOWN ===== */
[data-nv-countdown] {
  font-family: var(--nvp-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--nvp-text);
}

/* ===== STUDIO FORM im Popup (Cos, ohne Doppel-Headline/Logo) ===== */
.novvia-popup-box .nv-studio-newsletter--popup,
.novvia-popup-box [data-nvp-studio] {
  width: 100%;
  max-width: none;
  margin: 1rem 0 0;
}

.novvia-popup-box .nisf {
  --nisf-bg: transparent;
  --nisf-t: var(--nvp-text);
  --nisf-f: #ffffff;
  --nisf-ft: var(--nvp-text);
  --nisf-r: var(--nvp-border);
  --nisf-k: var(--nvp-accent);
  --nisf-kt: var(--nvp-accent-text);
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  font-family: var(--nvp-font) !important;
  text-align: left;
}

.novvia-popup-box .nisf-logo,
.novvia-popup-box .nisf > h2 {
  display: none !important;
}

.novvia-popup-box .nisf .nisf-el input,
.novvia-popup-box .nisf input[type="email"],
.novvia-popup-box .nisf input[type="text"]:not(.nisf-hp) {
  border-radius: 8px !important;
  border-color: var(--nvp-border) !important;
  background: #ffffff !important;
  color: var(--nvp-text) !important;
  font-family: var(--nvp-font) !important;
}

.novvia-popup-box .nisf .nisf-el input:focus,
.novvia-popup-box .nisf input[type="email"]:focus {
  border-color: var(--nvp-accent) !important;
  box-shadow: 0 0 0 3px rgba(184, 149, 107, 0.22) !important;
}

.novvia-popup-box .nisf .nisf-hk,
.novvia-popup-box .nisf .nisf-captcha,
.novvia-popup-box .nisf .nisf-fuss {
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--nvp-muted);
}

.novvia-popup-box .nisf .nisf-b {
  width: 100%;
  min-height: 48px;
  margin-top: 0.75rem;
  border: none !important;
  border-radius: 8px !important;
  background: var(--nvp-accent) !important;
  color: var(--nvp-accent-text) !important;
  font-family: var(--nvp-font) !important;
  font-weight: 600 !important;
  cursor: pointer;
}

.novvia-popup-box .nisf .nisf-b:hover {
  background: var(--nvp-accent-hover) !important;
  color: var(--nvp-text) !important;
}

.novvia-popup-content .nvp-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nvp-accent);
  text-align: center;
}

.novvia-popup-box .nvp-studio-required-hint {
  margin: 0 0 0.65rem;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--nvp-muted);
  text-align: left;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .novvia-popup-overlay,
  .novvia-popup-box,
  .novvia-popup,
  .novvia-popup-close,
  .novvia-popup-form button[type="submit"],
  .novvia-popup-content .button {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  .novvia-popup[data-popup-type="slide_in"] {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }

  .novvia-popup-content {
    padding: var(--nvp-pad, 1.15rem);
  }

  .novvia-popup-close {
    width: 40px;
    height: 40px;
  }
}
