/* oferte-widget.css — Widget oferte flotant */

#ddm-offers-btn {
  position: fixed;
  bottom: 98px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #10B981;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(16,185,129,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9996;
  transition: transform .2s, box-shadow .2s;
  font-size: 22px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  line-height: 1;
}
#ddm-offers-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(16,185,129,.55); }
#ddm-offers-btn svg   { pointer-events: none; }

#ddm-offers-popup {
  position: fixed;
  bottom: 164px;
  right: 24px;
  width: 440px;
  max-height: 640px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  z-index: 9997;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
#ddm-offers-popup.open { display: flex; }

.ddm-of-header {
  background: #10B981;
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ddm-of-header-info { display: flex; align-items: center; gap: 10px; }
.ddm-of-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600;
}
.ddm-of-title { font-weight: 600; font-size: .95rem; }
.ddm-of-sub   { font-size: .75rem; opacity: .8; margin-top: 1px; }
.ddm-of-close {
  background: none; border: none; color: #fff; cursor: pointer;
  font-size: 22px; line-height: 1; padding: 2px 6px; border-radius: 6px; opacity: .7;
}
.ddm-of-close:hover { opacity: 1; background: rgba(255,255,255,.2); }

/* Screens */
.ddm-of-screen { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.ddm-of-screen.active { display: flex; }

/* List screen */
.ddm-of-list-body {
  padding: 12px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 10px;
}

.ddm-of-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.ddm-of-card:hover { background: #F0FDF4; border-color: #6EE7B7; }
.ddm-of-card-img {
  width: 80px; height: 80px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0; background: #F3F4F6;
}
.ddm-of-card-img-placeholder {
  width: 80px; height: 80px; border-radius: 10px;
  background: #D1FAE5; display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
}
.ddm-of-card-info { flex: 1; min-width: 0; }
.ddm-of-card-title {
  font-weight: 600; font-size: .92rem; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px;
}
.ddm-of-card-desc {
  font-size: .8rem; color: #6B7280; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ddm-of-card-arrow { color: #9CA3AF; font-size: 20px; flex-shrink: 0; }

.ddm-of-empty {
  text-align: center; padding: 40px 20px;
  color: #9CA3AF; font-size: .85rem;
}
.ddm-of-loading {
  text-align: center; padding: 40px 20px;
  color: #6B7280; font-size: .85rem;
}

/* Detail screen */
.ddm-of-detail-body { padding: 0; overflow-y: auto; flex: 1; }
.ddm-of-detail-back {
  position: sticky; top: 0; z-index: 1;
  background: #fff; border-bottom: 1px solid #F3F4F6;
  padding: 10px 14px;
}
.ddm-of-back-btn {
  background: none; border: none; color: #10B981; cursor: pointer;
  font-size: .82rem; font-weight: 600; padding: 0;
  display: flex; align-items: center; gap: 4px;
}
.ddm-of-back-btn:hover { color: #059669; }
.ddm-of-detail-img {
  width: 100%;
  max-height: 280px;
  height: auto;
  display: block;
  object-fit: cover;
}
.ddm-of-detail-img-placeholder {
  width: 100%; padding: 60px 0;
  background: #D1FAE5; display: flex; align-items: center; justify-content: center;
  font-size: 52px;
}
.ddm-of-detail-content { padding: 18px 20px 24px; }
.ddm-of-detail-title {
  font-weight: 600; font-size: 1.05rem; color: #111827;
  margin-bottom: 10px; line-height: 1.4;
}
.ddm-of-detail-desc {
  font-size: .88rem; color: #374151; line-height: 1.75;
  white-space: pre-wrap;
}

/* Tooltip greeting bubble — apare în stânga butonului */
#ddm-offers-tooltip {
  position: fixed;
  bottom: 94px;
  right: 90px;
  background: #fff;
  color: #111827;
  border-radius: 14px;
  padding: 12px 36px 12px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: .85rem;
  line-height: 1.45;
  max-width: 230px;
  z-index: 9995;
  pointer-events: none;
  opacity: 0;
  transform: translateX(8px) scale(.95);
  transition: opacity .3s ease, transform .3s ease;
}
#ddm-offers-tooltip::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #fff;
}
#ddm-offers-tooltip.ddm-of-tooltip-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}
.ddm-of-tooltip-close {
  position: absolute;
  top: 6px; right: 8px;
  background: none; border: none;
  cursor: pointer; font-size: 16px;
  color: #9CA3AF; line-height: 1; padding: 2px 4px;
}
.ddm-of-tooltip-close:hover { color: #374151; }
.ddm-of-tooltip-text { font-weight: 500; }

@media (max-width: 480px) {
  #ddm-offers-popup   { width: calc(100vw - 16px); right: 8px; bottom: 156px; }
  #ddm-offers-btn     { right: 24px; }
  #ddm-offers-tooltip { right: 86px; bottom: 94px; }
}

body.has-modal #ddm-offers-btn,
body.has-modal #ddm-offers-popup {
  display: none !important;
}

/* Dark mode */
[data-theme="dark"] #ddm-offers-popup {
  background: #1A1F2E;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
[data-theme="dark"] #ddm-offers-tooltip {
  background: #1A1F2E;
  color: #F9FAFB;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
[data-theme="dark"] #ddm-offers-tooltip::after { border-left-color: #1A1F2E; }
[data-theme="dark"] .ddm-of-card { border-color: #374151; }
[data-theme="dark"] .ddm-of-card:hover { background: #1A3A2E; border-color: #10B981; }
[data-theme="dark"] .ddm-of-card-title { color: #F9FAFB; }
[data-theme="dark"] .ddm-of-card-desc { color: #9CA3AF; }
[data-theme="dark"] .ddm-of-detail-back { background: #1A1F2E; border-bottom-color: #374151; }
[data-theme="dark"] .ddm-of-detail-title { color: #F9FAFB; }
[data-theme="dark"] .ddm-of-detail-desc { color: #D1D5DB; }
[data-theme="dark"] .ddm-of-empty,
[data-theme="dark"] .ddm-of-loading { color: #6B7280; }
