/* Promotions Widget — mobile-first, Figma design match */

/* --- Layout --- */
.promotion-widget {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}
.promotion-widget h1 {
  color: var(--accent, #155dfc);
  font-size: 24px;
  font-weight: 700;
  line-height: 36px;
  text-align: center;
  margin: 0 0 24px;
}

/* --- Filter panel --- */
.promo-filter-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 32px;
}
.promo-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.promo-filter-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #101828;
  margin: 0;
}
.promo-filter-count {
  font-size: 14px;
  color: #6a7282;
}

/* Search input */
.promo-search-group {
  margin-bottom: 16px;
}
.promo-search-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #364153;
  margin-bottom: 6px;
}
.promo-search-wrap {
  position: relative;
}
.promo-search-wrap input {
  width: 100%;
  height: 46px;
  border: 1px solid #d1d5dc;
  border-radius: 10px;
  padding: 0 16px 0 40px;
  font-size: 16px;
  color: #0a0a0a;
  background: #fff;
  box-sizing: border-box;
}
.promo-search-wrap input::placeholder {
  color: rgba(10,10,10,0.5);
}
.promo-search-icon {
  position: absolute;
  left: 12px;
  top: 13px;
  width: 20px;
  height: 20px;
  color: #9ca3af;
  pointer-events: none;
}

/* Dropdown row */
.promo-filter-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.promo-filter-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #364153;
  margin-bottom: 6px;
}
.promo-filter-group select {
  width: 100%;
  height: 42px;
  border: 1px solid #d1d5dc;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  color: #0a0a0a;
  background: #fff;
  appearance: auto;
  box-sizing: border-box;
}

/* Clear button */
.promo-clear-btn {
  display: none;
  margin-top: 12px;
  padding: 8px 20px;
  background: none;
  border: 1px solid #d1d5dc;
  border-radius: 8px;
  color: #364153;
  font-size: 14px;
  cursor: pointer;
}
.promo-clear-btn:hover {
  background: #f3f4f6;
}

/* Active filter chips */
.promo-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 16px;
}
.promo-active-chips:empty {
  display: none;
}
.promo-chip-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.promo-chip-active:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.promo-chip-active svg {
  opacity: 0.4;
}
.promo-chip-active:hover svg {
  opacity: 1;
}
.promo-chip-clear-all {
  background: transparent;
  border: none;
  color: var(--accent, #155dfc);
  font-weight: 600;
  padding: 5px 8px;
}
.promo-chip-clear-all:hover {
  text-decoration: underline;
  background: transparent;
}

.hidden { display: none !important; }

/* Empty state */
.promo-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #6a7282;
  font-size: 16px;
  line-height: 24px;
}
.promo-empty-state p {
  margin: 0;
}

/* --- Promotion cards --- */
.promotion-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.promotion {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
}

/* Card layout */
.promlist-top {
  display: flex;
  flex-direction: column;
}
.promlist-left {
  width: 100%;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(124deg, #dbeafe 0%, #cefafe 100%);
}
.promlist-image {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: contain;
}

/* Card content */
.promlist-right {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* Chips */
.promo-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.promo-chip-brand {
  display: inline-block;
  padding: 4px 12px;
  background: #dbeafe;
  color: #1447e6;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
  line-height: 16px;
}
.promo-chip-type {
  display: inline-block;
  padding: 4px 12px;
  background: #f3f4f6;
  color: #364153;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
  line-height: 16px;
}

/* Title */
.promlist-right h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 25px;
  color: #101828;
  margin: 0;
}

/* Subtitle */
.promlist-subtitle {
  font-size: 14px;
  line-height: 20px;
  color: #4a5565;
}

/* Expires */
.promlist-expires {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4a5565;
  line-height: 20px;
}
.promlist-expires strong {
  font-weight: 500;
}

/* See Details button */
.pbutton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 10px 24px;
  background: var(--accent, #155dfc);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  margin-top: 8px;
  transition: background 0.2s;
}
.pbutton:hover {
  background: var(--accent-hover, #1247c4);
}

/* Details expand */
.promo-details {
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  font-size: 14px;
  line-height: 22px;
  color: #364153;
}

/* --- Tablet (769px+) --- */
@media (min-width: 769px) {
  .promotion-widget h1 {
    font-size: 30px;
  }
  .promo-filter-panel {
    padding: 24px;
  }
  .promo-filter-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .promlist-top {
    flex-direction: row;
  }
  .promlist-left {
    width: 340px;
    min-width: 340px;
  }
  .promlist-image {
    height: 100%;
    min-height: 240px;
    object-fit: contain;
  }
  .promlist-right {
    padding: 24px;
  }
  .promlist-right h2 {
    font-size: 20px;
  }
}

/* Filter banner — shown when ?promo= deep-link is active */
.promo-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #0c4a6e;
}
.promo-filter-banner a {
  color: var(--accent, #155dfc);
  font-weight: 500;
  text-decoration: none;
}
.promo-filter-banner a:hover {
  text-decoration: underline;
}

/* Deep-link highlight pulse */
@keyframes promo-pulse {
  0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1); }
  50% { box-shadow: 0 0 0 3px var(--accent, #155dfc), 0 4px 12px rgba(0,0,0,0.15); }
}
.promo-highlight {
  animation: promo-pulse 0.6s ease-in-out 2;
}

/* --- Desktop (1025px+) --- */
@media (min-width: 1025px) {
  .promlist-left {
    width: 400px;
    min-width: 400px;
  }
}
