/* Price Monitor - main styles */

body {
  background-color: #f8f9fa;
}

.product-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  /* Needed so the absolute-positioned favourite button is contained */
  position: relative;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Highlighted ring on favourited cards */
.product-card.is-favorite {
  outline: 2px solid #fd7e14;
  outline-offset: -2px;
}

/* Heart / favourite toggle button */
.favorite-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.12s ease, background 0.12s ease;
}

.favorite-btn:hover {
  transform: scale(1.2);
  background: rgba(255, 255, 255, 1);
}

/* Price change since the product was favourited */
.favorite-price-change {
  font-size: 0.72rem;
}

/* Publication date shown on product cards */
.product-published-date {
  font-size: 0.72rem;
}

.product-published-date span {
  cursor: default;
}

/* First-seen / last-checked crawl dates shown on product cards */
.product-crawl-dates {
  font-size: 0.72rem;
}

.product-crawl-dates span {
  cursor: default;
}

/* ⭐ Mis favoritos filter button — active state */
.favorites-filter-btn.active {
  background-color: #fd7e14;
  border-color: #fd7e14;
  color: #fff;
}

/* localStorage disclaimer banner */
.disclaimer-banner {
  background-color: #fff3cd;
  border-bottom: 1px solid #ffc107;
  padding: 10px 0;
  font-size: 0.85rem;
}

.disclaimer-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.btn-close-disclaimer {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.btn-close-disclaimer:hover {
  opacity: 1;
}

/* Modal footer actions layout */
.modal-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.price-badge {
  font-size: 1.1rem;
  font-weight: 600;
}

.product-img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #fff;
  padding: 8px;
}

.product-img-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #dee2e6;
}

.discount-badge {
  font-size: 0.75rem;
  vertical-align: middle;
}

.price-change-badge {
  font-size: 0.7rem;
  vertical-align: middle;
}

.stock-locations {
  font-size: 0.72rem;
  color: #6c757d;
  padding-left: 0;
}

.stock-location-item {
  margin-right: 4px;
}

.price-block {
  line-height: 1.6;
}

/* Mini 7-day sparkline chart shown below each product image */
.mini-chart-wrapper {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  padding: 0;
  overflow: hidden;
}

.mini-chart-canvas {
  display: block;
  width: 100% !important;
  height: 56px !important;
}

/* =========================================================
   DARK MODE OVERRIDES
   Bootstrap handles its own components via data-bs-theme="dark".
   The rules below override our custom elements that use hardcoded colors.
   ========================================================= */

[data-bs-theme="dark"] body {
  background-color: #1a1d23;
}

[data-bs-theme="dark"] .product-img {
  background: #2b2f38;
}

[data-bs-theme="dark"] .product-img-placeholder {
  background: linear-gradient(135deg, #2b2f38 0%, #343a46 100%);
  color: #adb5bd;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .mini-chart-wrapper {
  background: #2b2f38;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .product-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .stock-locations {
  color: #9da5b4;
}

[data-bs-theme="dark"] .favorite-btn {
  background: rgba(40, 44, 52, 0.88);
}

[data-bs-theme="dark"] .favorite-btn:hover {
  background: rgba(40, 44, 52, 1);
}

[data-bs-theme="dark"] .disclaimer-banner {
  background-color: #332b00;
  border-bottom-color: #6e5500;
  color: #ffc107;
}

[data-bs-theme="dark"] .disclaimer-banner code {
  background: rgba(255,193,7,0.15);
  color: #ffc107;
}

/* Email notification form inside the price modal */
.notify-email-form {
  background-color: #f8f9fa;
  font-size: 0.875rem;
}

[data-bs-theme="dark"] .notify-email-form {
  background-color: #2b2f38;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
