/**
 * Styles for HoaTuoi Sales Notification Popup
 */

.hts-popup-wrapper {
  position: fixed;
  bottom: 75px;
  left: 24px;
  z-index: 9999;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Hide sales popup completely when order checkout modal is open */
#hoa-order-modal.open ~ .hts-popup-wrapper,
.hoa-modal-overlay.open ~ .hts-popup-wrapper,
body:has(#hoa-order-modal.open) .hts-popup-wrapper,
body:has(.hoa-modal-overlay.open) .hts-popup-wrapper,
body.hoa-modal-open .hts-popup-wrapper,
body.modal-open .hts-popup-wrapper {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.hts-popup-card {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #ffd1df;
  border-radius: 14px;
  padding: 10px 14px;
  max-width: 360px;
  min-width: 290px;
  box-shadow: 0 10px 30px rgba(255, 94, 142, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
  position: relative;
  box-sizing: border-box;
  opacity: 0;
  transform: translateX(-100%) scale(0.9);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

/* Slide in state */
.hts-popup-card.hts-active {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Fade out / Slide out state */
.hts-popup-card.hts-hiding {
  opacity: 0;
  transform: translateX(-40px) scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Luxury 'Đã đặt' Badge */
.hts-badge-label {
  position: absolute;
  top: -8px;
  left: 12px;
  background: linear-gradient(135deg, #ff477e 0%, #d6336c 100%);
  color: #ffffff;
  font-size: 10px;
  font-weight: 500;
  padding: 1.5px 8px;
  border-radius: 12px;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px rgba(214, 51, 108, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  line-height: 1.4;
  pointer-events: none;
}

/* Flower Image Thumbnail */
.hts-thumb-wrap {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #ffe4ec;
  background: #fff0f5;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hts-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hts-thumb-fallback {
  font-size: 26px;
  line-height: 1;
}

/* Order Content Information */
.hts-info-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hts-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #374151;
  line-height: 1.3;
}

.hts-customer-name {
  font-weight: 500;
  color: #1f2937;
}

.hts-phone-tag {
  color: #6b7280;
  font-size: 11.5px;
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 400;
}

.hts-flower-title {
  font-size: 13px;
  font-weight: 500;
  color: #d6336c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  line-height: 1.35;
  display: block;
  transition: color 0.15s;
}

.hts-flower-title:hover {
  color: #ff477e;
}

.hts-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 1px;
}

.hts-price {
  font-size: 12.5px;
  font-weight: 500;
  color: #ff477e;
}

.hts-time-ago {
  font-size: 10.5px;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 400;
}

/* Close button */
.hts-close-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9ca3af;
  border: none;
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: all 0.15s;
}

.hts-close-btn:hover {
  background: #ff5e8e;
  color: #ffffff;
}

/* Responsive Mobile Layout (Lifted above mobile bottom bar) */
@media (max-width: 768px) {
  .hts-popup-wrapper {
    bottom: 85px; /* Above bottom app bar and navigation */
    left: 10px;
    right: 10px;
  }
  .hts-popup-card {
    max-width: 100%;
    min-width: 0;
    width: auto;
    padding: 8px 12px;
  }
  .hts-thumb-wrap {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }
  .hts-flower-title {
    font-size: 12.5px;
  }
  .hts-customer-name {
    font-size: 12px;
  }
}
