/* ============================================================
   POPUP STYLES — kaft.com Style
   Newsletter popup, cart popup, cookie banner
   ============================================================ */

/* ── OVERLAY BASE ── */
.tp-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(53, 53, 50, 0.5);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-base) var(--ease-default);
  backdrop-filter: blur(2px);
}

.tp-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ── POPUP CONTENT ── */
.tp-popup-content {
  background: var(--color-bg);
  max-width: 400px;
  width: calc(100% - 2rem);
  padding: var(--space-10);
  text-align: center;
  transform: scale(0.96) translateY(8px);
  transition: transform var(--duration-base) var(--ease-spring);
  border: 1px solid var(--color-border);
}

.tp-popup-overlay.active .tp-popup-content {
  transform: scale(1) translateY(0);
}

/* ── ICON ── */
.tp-popup-icon {
  margin-bottom: var(--space-6);
}

.tp-popup-icon svg {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  color: var(--color-success);
  stroke-width: 1.5;
}

/* ── TEXT ── */
.tp-popup-title {
  font-family: var(--font-primary);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.tp-popup-message {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

/* ── ACTIONS ── */
.tp-popup-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

/* ── NEWSLETTER POPUP ── */
.newsletter-popup {
  background: var(--color-bg);
  max-width: 500px;
  width: calc(100% - 2rem);
  position: relative;
}

.newsletter-popup-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: transparent;
  border: none;
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-2);
  z-index: 1;
}

.newsletter-popup-content {
  padding: var(--space-12) var(--space-8);
  text-align: center;
}

.newsletter-popup-title {
  font-family: var(--font-primary);
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.newsletter-popup-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  max-width: 36ch;
  margin-inline: auto;
}

.newsletter-popup-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.newsletter-popup-input {
  width: 100%;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  text-align: center;
  transition: border-color var(--duration-fast) var(--ease-default);
}

.newsletter-popup-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.newsletter-popup-btn {
  width: 100%;
  padding: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-on-dark);
  border: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
}

.newsletter-popup-btn:hover {
  background: var(--color-primary-hover);
}

/* ── COOKIE BANNER ── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-text-primary);
  color: var(--color-text-on-dark);
  padding: var(--space-6) var(--space-8);
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  font-size: var(--text-sm);
}

.cookie-banner.active {
  display: flex;
}

.cookie-banner-text {
  flex: 1;
  max-width: 600px;
  color: var(--color-text-on-dark);
  opacity: 0.9;
}

.cookie-banner-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

.cookie-accept-btn {
  padding: var(--space-2) var(--space-6);
  background: var(--color-text-on-dark);
  color: var(--color-text-primary);
  border: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-default);
}

.cookie-accept-btn:hover {
  opacity: 0.9;
}

.cookie-settings-btn {
  padding: var(--space-2) var(--space-6);
  background: transparent;
  color: var(--color-text-on-dark);
  border: 1px solid rgba(255,255,255,0.3);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-default);
}

.cookie-settings-btn:hover {
  border-color: rgba(255,255,255,0.6);
}

/* ── CUSTOM POPUP WRAPPER (legacy) ── */
.custom-popup-wrapper .popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-default);
}

.custom-popup-wrapper .popup-overlay.active { opacity: 1; }

.custom-popup-wrapper .popup-modal {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  background: var(--color-bg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--duration-base) var(--ease-spring);
}

.custom-popup-wrapper .popup-overlay.active .popup-modal { transform: scale(1); }

.custom-popup-wrapper .popup-header {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 10;
}

.custom-popup-wrapper .popup-close-btn {
  background: rgba(53, 53, 50, 0.7);
  color: var(--color-text-on-dark);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: var(--text-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-default);
}

.custom-popup-wrapper .popup-close-btn:hover {
  background: rgba(53, 53, 50, 0.9);
}

.custom-popup-wrapper .popup-content {
  width: 100%;
  height: 100%;
  min-width: 300px;
  min-height: 200px;
}

.custom-popup-wrapper .popup-content img {
  max-width: 100%;
  height: auto;
  display: block;
}

.custom-popup-wrapper .popup-video-container {
  width: 100%;
  height: 400px;
}

.custom-popup-wrapper .popup-video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.custom-popup-wrapper .popup-text-content {
  padding: var(--space-6);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--text-base);
}

@media (max-width: 768px) {
  .custom-popup-wrapper .popup-modal { max-width: 95%; max-height: 95%; }
  .custom-popup-wrapper .popup-video-container { height: 250px; }
  .cookie-banner {
    flex-direction: column;
    text-align: center;
    padding: var(--space-4) var(--space-4) var(--space-6);
  }
  .cookie-banner-actions { width: 100%; justify-content: center; }
}