.promotions-page {
  --br-bg: #f6f8fb;
  --br-surface: #ffffff;
  --br-surface-2: #f9fbff;
  --br-border: #dbe3ee;
  --br-border-strong: #c8d3e1;
  --br-text: #1f2937;
  --br-text-muted: #667085;
  --br-primary: #2563eb;
  --br-primary-dark: #1d4ed8;
  --br-success: #15803d;
  --br-danger: #b42318;
  --br-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --br-radius: 16px;
  --br-radius-sm: 12px;
  background: var(--br-bg);
  color: var(--br-text);
  min-height: 100vh;
}

.promotions-main {
  width: auto;
  margin: 24px 10%;
  padding: 0 0 72px;
  background: transparent !important;
}

.promotions-section,
.promotion-detail-section {
  margin-top: 0;
}

.section-heading h2 {
  margin: 0 0 14px;
  color: var(--br-text);
  font-size: 24px;
  font-weight: 700;
}

.promotion-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 340px));
  gap: 18px;
}

.promotion-summary-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--br-border);
  background: var(--br-surface);
  border-radius: var(--br-radius);
  padding: 20px;
  min-height: 190px;
  box-shadow: var(--br-shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.promotion-summary-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.promotion-summary-card.is-selected {
  transform: translateY(-2px);
  border-color: #93c5fd;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), #ffffff);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.14), 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.promotion-summary-card::after {
  content: "";
  position: absolute;
  top: -36px;
  right: -36px;
  width: 128px;
  height: 128px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.015));
  pointer-events: none;
}

.promotion-summary-pill,
.promotion-detail-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.promotion-summary-pill-pet,
.promotion-detail-pill-pet {
  background: #f3e8ff;
  color: #7c3aed;
}

.promotion-summary-pill-agri,
.promotion-detail-pill-agri {
  background: #dcfce7;
  color: #15803d;
}

.promotion-summary-pill-vet,
.promotion-summary-pill-vet-equipment,
.promotion-detail-pill-vet,
.promotion-detail-pill-vet-equipment {
  background: #dbeafe;
  color: #2563eb;
}

.promotion-summary-card h3 {
  position: relative;
  z-index: 1;
  margin: 22px 0 14px;
  font-size: 24px;
  line-height: 1.15;
  color: var(--br-text);
}

.promotion-summary-date {
  color: var(--br-text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.promotion-summary-footer {
  margin-top: auto;
  border-top: 1px solid #edf2f7;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.promotion-summary-footer span {
  color: var(--br-text-muted);
  font-size: 13px;
}

.promotion-summary-footer strong {
  color: var(--br-primary);
  font-size: 14px;
}

.promotions-message {
  margin-top: 16px;
  color: var(--br-text-muted);
  font-size: 14px;
}

.promotion-filters {
  margin: 18px 0 22px;
  background: var(--br-surface);
  border: 1px solid var(--br-border);
  border-radius: var(--br-radius);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 420px) auto auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--br-shadow);
}

.promotion-filters input[type="search"],
.promotion-filters select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--br-border-strong);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--br-text);
  box-sizing: border-box;
}

.promotion-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  white-space: nowrap;
  color: #344054;
  font-weight: 600;
  font-size: 14px;
}

.promotion-vendor-group {
  margin-top: 24px;
  background: var(--br-surface);
  border: 1px solid var(--br-border);
  border-radius: var(--br-radius);
  box-shadow: var(--br-shadow);
  padding: 16px 18px 18px;
}

.promotion-vendor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf2f7;
}

.promotion-vendor-header h3 {
  margin: 0 0 6px;
  color: var(--br-text);
  font-size: 22px;
  line-height: 1.2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.promotion-vendor-header p {
  margin: 0;
  color: var(--br-text-muted);
  font-size: 14px;
  font-weight: 600;
}

.promotion-vendor-mix-match-note {
  color: #dc2626;
  font-weight: 600;
}

.promotion-vendor-deal-title,
.promotion-vendor-mechanics {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 14px;
  border: 2px solid #ef4444;
  border-radius: 999px;
  background: #fff7f7;
  color: #dc2626;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.promotion-products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.browse-card,
.promotion-product-card {
  background: var(--br-surface);
  border: 1px solid var(--br-border);
  border-radius: var(--br-radius);
  box-shadow: var(--br-shadow);
}

.browse-product,
.promotion-product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.promotion-product-card:hover {
  transform: translateY(-2px);
  border-color: var(--br-border-strong);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.browse-product-image-wrap,
.promotion-product-image-wrap {
  position: relative;
  padding: 16px 16px 0;
}

.browse-product-image-link,
.promotion-product-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 12px;
  min-height: 210px;
  text-decoration: none;
}

.browse-product-image,
.promotion-product-image {
  width: 100%;
  max-width: 220px;
  height: 200px;
  object-fit: contain;
}

.browse-stock-badge,
.promotion-product-stock {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.browse-stock-badge small,
.promotion-product-stock small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
}

.browse-stock-badge.in,
.promotion-product-stock.is-in {
  background: #ecfdf3;
  color: #027a48;
}

.browse-stock-badge.low,
.promotion-product-stock.is-low {
  background: #fffaeb;
  color: #b54708;
}

.browse-stock-badge.out,
.promotion-product-stock.is-out {
  background: #fef3f2;
  color: #b42318;
}

.browse-product-body,
.promotion-product-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.browse-brand,
.promotion-product-topline {
  font-size: 12px;
  font-weight: 700;
  color: var(--br-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.promotion-product-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.promotion-product-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--br-primary);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

.browse-title,
.promotion-product-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  color: #111827;
  min-height: 40px;
}

.browse-title a,
.promotion-product-title a {
  color: inherit;
  text-decoration: none;
}

.browse-title a:hover,
.promotion-product-title a:hover {
  text-decoration: underline;
}

.browse-desc-sub,
.promotion-product-subline {
  font-size: 12px;
  line-height: 1.35;
  color: #667085;
  min-height: 32px;
  margin-top: -2px;
}

.browse-desc-meta,
.promotion-product-meta {
  font-size: 11px;
  line-height: 1.2;
  color: #98a2b3;
  min-height: 30px;
  margin-top: -2px;
}

.browse-item-code,
.promotion-product-kvs-line {
  font-size: 12px;
  color: var(--br-text-muted);
  font-weight: 600;
}

.browse-price-block,
.promotion-product-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 0 2px;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
}

.browse-price-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.browse-price-label,
.promotion-product-price-label {
  font-size: 11px;
  color: var(--br-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.browse-price-value {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.browse-price-value.final,
.promotion-product-your-price {
  color: var(--br-danger);
  font-size: 18px;
  font-weight: 900;
}

.promotion-product-tier-block {
  display: grid;
  gap: 5px;
  margin-top: 4px;
  border: 1px solid #fee2e2;
  border-radius: 12px;
  background: #fff7f7;
  padding: 8px 10px;
}

.promotion-product-tier-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.promotion-product-tier-row::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #dc2626;
  flex-shrink: 0;
}

.browse-card-actions,
.promotion-product-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.browse-qty-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.browse-qty-input,
.promotion-product-actions input {
  width: 86px;
  height: 38px;
  border: 1px solid var(--br-border-strong);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  box-sizing: border-box;
  background: white;
}

.browse-add-btn,
.browse-update-btn,
.promotion-product-btn {
  height: 38px;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
}

.browse-add-btn,
.promotion-product-btn:not(.is-update) {
  background: linear-gradient(135deg, #0a84ff, #2563eb);
  color: #fff;
}

.browse-update-btn,
.promotion-product-btn.is-update {
  background: linear-gradient(135deg, #1f7a3f, #2f9e44);
  color: #fff;
  border: 0;
}

.browse-add-btn:disabled,
.browse-update-btn:disabled,
.promotion-product-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.promotion-view-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.promotion-view-more-btn {
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  cursor: pointer;
  padding: 10px 18px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.promotion-view-more-btn:hover {
  background: #dbeafe;
}

.promo-scroll-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--br-primary);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.promo-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.promo-scroll-top:hover {
  background: var(--br-primary-dark);
}

@media (max-width: 1600px) {
  .promotion-products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .promotions-main {
    margin: 20px 4%;
  }

  .promotion-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .promotion-filters {
    grid-template-columns: 1fr;
  }

  .promotion-vendor-header {
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .promotions-main {
    margin: 18px 14px;
  }

  .promotion-card-grid,
  .promotion-products-grid {
    grid-template-columns: 1fr;
  }

  .promotion-vendor-group {
    padding: 14px;
  }

  .promotion-vendor-deal-title,
  .promotion-vendor-mechanics {
    font-size: 14px;
    white-space: normal;
  }

  .browse-price-block,
  .promotion-product-prices {
    grid-template-columns: 1fr;
  }
}


.promotion-download-pdf-btn {
  height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  background: var(--br-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.promotion-download-pdf-btn:hover:not(:disabled) {
  background: var(--br-primary-dark);
}

.promotion-download-pdf-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}


.promo-pdf-loading-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

.promo-pdf-loading-modal.is-visible {
  display: flex;
}

.promo-pdf-loading-card {
  width: min(420px, 100%);
  border-radius: 20px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  text-align: center;
}

.promo-pdf-loading-title {
  color: #111827;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 8px;
}

.promo-pdf-loading-text {
  color: #667085;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 18px;
}

.promo-pdf-loading-bar {
  position: relative;
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #edf2e8;
}

.promo-pdf-loading-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -45%;
  width: 45%;
  border-radius: inherit;
  background: #4db300;
  animation: promoPdfLoading 1.1s ease-in-out infinite;
}

@keyframes promoPdfLoading {
  0% { left: -45%; }
  100% { left: 100%; }
}


/* ---------- Active promotions carousel ---------- */
.promotion-carousel {
  position: relative;
}

.promotion-carousel .promotion-card-grid {
  display: flex;
  grid-template-columns: none;
  flex-wrap: nowrap;
  gap: 18px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0 2px 4px;
}

.promotion-carousel .promotion-card-grid::-webkit-scrollbar {
  display: none;
}

.promotion-carousel .promotion-summary-card {
  flex: 0 0 340px;
  scroll-snap-align: start;
}

.promotion-carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: var(--br-primary);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
}

.promotion-carousel-btn-prev {
  left: -21px;
}

.promotion-carousel-btn-next {
  right: -21px;
}

.promotion-carousel-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.promotion-carousel-btn[hidden] {
  display: none;
}

@media (max-width: 700px) {
  .promotion-carousel .promotion-card-grid {
    grid-template-columns: none;
  }

  .promotion-carousel .promotion-summary-card {
    flex-basis: min(86vw, 340px);
  }

  .promotion-carousel-btn-prev {
    left: -8px;
  }

  .promotion-carousel-btn-next {
    right: -8px;
  }
}
