/* css/upsell.css */

:root {
  --theme-primary: #ea580c;
  --theme-secondary: #f97316;
}

/* Modal Backdrop */
.upsell-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.upsell-backdrop.upsell-show {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.upsell-modal {
  background: #ffffff;
  width: 90%;
  max-width: 500px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  position: relative;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}

.upsell-backdrop.upsell-show .upsell-modal {
  transform: scale(1);
  opacity: 1;
}

/* Modal Header */
.upsell-header {
  background: linear-gradient(135deg, var(--theme-secondary) 0%, var(--theme-primary) 100%);
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: 700;
  font-size: 1.1rem;
}

.upsell-header-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upsell-timer-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.upsell-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.upsell-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

.upsell-close svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Modal Body (scrollable) */
.upsell-body {
  padding: 24px;
  overflow-y: auto;
  text-align: center;
}

/* Title */
.upsell-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #111827;
  line-height: 1.3;
  margin-bottom: 20px;
}

/* Thumbnails */
.upsell-images {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.upsell-images img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Info Box */
.upsell-info-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  text-align: left;
  margin-bottom: 24px;
}

.upsell-info-title {
  color: var(--theme-secondary);
  font-weight: 800;
  text-align: center;
  font-size: 1rem;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.upsell-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upsell-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.4;
}

.upsell-list li svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.upsell-icon-check svg {
  fill: #22c55e;
}

.upsell-icon-star svg {
  fill: #f59e0b;
}

/* Modal Footer */
.upsell-footer {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Main Button */
.upsell-btn-main {
  position: relative;
  background: linear-gradient(to right, var(--theme-primary), var(--theme-secondary));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 16px 24px;
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 15px -3px var(--theme-primary);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  animation: upsell-pulse 5s infinite;
  text-decoration: none;
}

.upsell-btn-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px var(--theme-primary);
}

/* Cart Icon */
.upsell-btn-main svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Button Pulse Animation */
@keyframes upsell-pulse {
  0%, 80%, 100% { transform: scale(1); }
  90% { transform: scale(1.05); }
}

/* Shimmer/Shine Effect */
.upsell-btn-main::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.4) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-20deg);
  animation: upsell-shine 3s infinite linear;
}

@keyframes upsell-shine {
  0%, 50% { left: -100%; }
  100% { left: 200%; }
}

/* Decline Link */
.upsell-btn-decline {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;
  padding: 8px;
}

.upsell-btn-decline:hover {
  color: #475569;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .upsell-modal {
    width: 95%;
  }
  .upsell-images img {
    width: 70px;
    height: 70px;
  }
  .upsell-title {
    font-size: 1.3rem;
  }
  .upsell-btn-main {
    font-size: 1rem;
    padding: 14px 20px;
  }
}
