/**
 * Promise Laundry — Discount Pop-up Modal Styles
 * Native brand integration matching design tokens & typography
 * Features interactive Google Maps store photo link & walk-in perks highlight
 */

/* Scroll Lock when Modal is Active */
body.discount-modal-locked {
  overflow: hidden !important;
  touch-action: none;
}

/* 1. Dimmed & Blurred Backdrop Overlay */
.discount-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4, 16px);
  background: rgba(8, 23, 53, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.discount-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 2. Modal Container Card */
.discount-modal-card {
  position: relative;
  width: 100%;
  max-width: 730px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e8e5de);
  border-radius: var(--radius-xl, 24px);
  box-shadow: 0 24px 64px -12px rgba(15, 23, 42, 0.28), 0 8px 24px -4px rgba(15, 23, 42, 0.12);
  display: grid;
  grid-template-columns: 290px 1fr;
  overflow: hidden;
  transform: scale(0.94) translateY(12px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.discount-modal-overlay.is-active .discount-modal-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* 3. Close Button (X) - Accessible Touch Target */
.discount-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-full, 9999px);
  color: var(--color-text-secondary, #334155);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}

.discount-modal-close:hover {
  background: rgba(15, 23, 42, 0.12);
  color: var(--color-text, #0f172a);
  transform: scale(1.06);
}

.discount-modal-close:focus-visible {
  outline: 2px solid var(--color-primary, #1d4ed8);
  outline-offset: 2px;
}

/* 4. Left Image Column (Interactive Google Maps Link) */
a.discount-modal-media {
  position: relative;
  background: var(--pr-blue-950, #081735);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  cursor: pointer;
  outline: none;
}

a.discount-modal-media:focus-visible {
  outline: 2px solid var(--color-primary, #1d4ed8);
  outline-offset: -2px;
}

.discount-modal-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

a.discount-modal-media:hover img {
  transform: scale(1.05);
  opacity: 0.94;
}

.discount-modal-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 23, 53, 0.15) 0%, rgba(8, 23, 53, 0.88) 100%);
  z-index: 1;
  transition: background 0.3s ease;
}

a.discount-modal-media:hover .discount-modal-media-overlay {
  background: linear-gradient(180deg, rgba(8, 23, 53, 0.1) 0%, rgba(8, 23, 53, 0.82) 100%);
}

.discount-modal-media-content {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 24px 20px;
  color: #ffffff;
}

.discount-modal-store-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full, 9999px);
  padding: 4px 10px;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  margin-bottom: 6px;
}

.discount-modal-store-text {
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 10px 0;
}

/* Interactive Google Maps Chip */
.discount-modal-maps-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius-full, 9999px);
  padding: 6px 14px;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

a.discount-modal-media:hover .discount-modal-maps-chip {
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(255, 255, 255, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* 5. Right Offer Content Column */
.discount-modal-content {
  padding: 34px 32px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.discount-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  background: var(--pr-green-50, #f0fdf4);
  color: var(--pr-green-700, #15803d);
  border: 1px solid rgba(22, 163, 74, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-full, 9999px);
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.discount-modal-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text, #0f172a);
  margin: 0 0 10px 0;
}

.discount-modal-sub {
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.92rem;
  line-height: 1.48;
  color: var(--color-text-secondary, #334155);
  margin: 0 0 18px 0;
}

/* Walk-In Perks Row (Automatic counter discount, no coupon code required) */
.discount-modal-perks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(22, 163, 74, 0.05);
  border: 1px solid rgba(22, 163, 74, 0.16);
  border-radius: var(--radius-md, 14px);
  padding: 12px 14px;
  margin-bottom: 20px;
}

.discount-modal-perk-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.discount-modal-perk-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.12);
  color: var(--pr-green-700, #15803d);
  margin-top: 1px;
}

.discount-modal-perk-body {
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.84rem;
  line-height: 1.42;
  color: var(--color-text, #0f172a);
}

.discount-modal-perk-body strong {
  color: var(--color-text, #0f172a);
  font-weight: 700;
  margin-right: 4px;
}

.discount-modal-perk-body span {
  color: var(--color-text-secondary, #475569);
}

/* Primary CTA Button */
.discount-modal-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 8px);
  width: 100%;
  padding: 13px 24px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff !important;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-weight: 700;
  font-size: 0.96rem;
  text-decoration: none;
  border-radius: var(--radius-full, 9999px);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.32);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  min-height: 48px;
}

.discount-modal-cta:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.42);
  color: #ffffff !important;
}

.discount-modal-cta:active {
  transform: scale(0.98) translateY(1px);
}

.discount-modal-cta:focus-visible {
  outline: 2px solid var(--pr-green-600, #16a34a);
  outline-offset: 3px;
}

/* Secondary Dismiss Link */
.discount-modal-dismiss {
  background: none;
  border: none;
  margin-top: 12px;
  padding: 8px;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
  text-align: center;
  cursor: pointer;
  transition: color 0.2s ease, text-decoration 0.2s ease;
  min-height: 44px; /* Accessible tap target */
  display: flex;
  align-items: center;
  justify-content: center;
}

.discount-modal-dismiss:hover {
  color: var(--color-text, #0f172a);
  text-decoration: underline;
}

.discount-modal-dismiss:focus-visible {
  outline: 2px solid var(--color-primary, #1d4ed8);
  outline-offset: 2px;
}

/* ====================================================================
   Dark Theme Adjustments
   ==================================================================== */
[data-theme="dark"] .discount-modal-card {
  background: var(--color-bg-elevated, #0e172e);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.75), 0 8px 24px -4px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .discount-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

[data-theme="dark"] .discount-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

[data-theme="dark"] .discount-modal-badge {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .discount-modal-title {
  color: #f8fafc;
}

[data-theme="dark"] .discount-modal-sub {
  color: #cbd5e1;
}

[data-theme="dark"] .discount-modal-perks {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

[data-theme="dark"] .discount-modal-perk-icon {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

[data-theme="dark"] .discount-modal-perk-body strong {
  color: #f8fafc;
}

[data-theme="dark"] .discount-modal-perk-body span {
  color: #cbd5e1;
}

[data-theme="dark"] .discount-modal-dismiss {
  color: #94a3b8;
}

[data-theme="dark"] .discount-modal-dismiss:hover {
  color: #f8fafc;
}

/* ====================================================================
   Mobile Responsive (Under 640px) — Slides up as a Bottom Sheet
   ==================================================================== */
@media (max-width: 640px) {
  .discount-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .discount-modal-card {
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    grid-template-columns: 1fr;
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(100%);
  }

  .discount-modal-overlay.is-active .discount-modal-card {
    transform: translateY(0);
  }

  a.discount-modal-media {
    height: 130px;
  }

  .discount-modal-close {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .discount-modal-close:hover {
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
  }

  .discount-modal-media-content {
    padding: 14px 16px;
  }

  .discount-modal-store-text {
    font-size: 0.82rem;
    margin-bottom: 6px;
  }

  .discount-modal-maps-chip {
    padding: 5px 12px;
    font-size: 0.74rem;
  }

  .discount-modal-content {
    padding: 22px 20px 24px;
  }

  .discount-modal-title {
    font-size: 1.38rem;
    margin-bottom: 8px;
  }

  .discount-modal-sub {
    font-size: 0.86rem;
    margin-bottom: 14px;
  }

  .discount-modal-perks {
    padding: 10px 12px;
    gap: 8px;
    margin-bottom: 16px;
  }

  .discount-modal-perk-body {
    font-size: 0.8rem;
  }

  .discount-modal-cta {
    min-height: 48px;
    font-size: 0.92rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .discount-modal-overlay,
  .discount-modal-card,
  .discount-modal-close,
  .discount-modal-cta,
  a.discount-modal-media,
  .discount-modal-maps-chip {
    transition: none !important;
    animation: none !important;
  }
}
