.cupon-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;

  border: 2px solid #e3e8ef;
  padding: 16px;
  border-radius: 14px;
  max-width: 100%;
  font-family: "Segoe UI", Arial, sans-serif;
  margin-bottom: 22px;

  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cupon-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* Плашка */
/* Скрываем по умолчанию */
.cupon-item .badge {
  display: none;
  position: absolute;
  top: -11px;
  left: -26px;
  background: linear-gradient(135deg, #ff4d4d, #ff9f43);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  padding: 4px 20px;
  font-size: 11px;  /* уменьшаем текст */
  transform: rotate(-35deg);
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Показываем только на первых 4 блоках */
.cupon-item:nth-child(-n+5) .badge {
  display: block;
}

/* Блок скидки */
.discount {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 150px;
  flex-shrink: 0;
}

.discount .amount {
  font-size: 36px;
  font-weight: 700;
  color: #2b8a3e;
  margin: 0;
}

.discount .label {
  font-size: 15px;
  color: #2b8a3e;
  margin-top: 4px;
  opacity: 0.9;
}

/* Контент */
.cupon-content {
  flex: 1;
  margin-left: 22px;
}

.cupon-title {
  font-size: 18px;
  font-weight: 600;
  margin: 8px 0;
  color: #1a2b48;
  line-height: 1.4;
  word-wrap: break-word; /* перенос длинных слов */
  white-space: normal;   /* всегда перенос строки */
}

.cupon-description {
  font-size: 15px;
  color: #3c5874;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* Блок с кодом */
.cupon-code {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.expiration {
  font-size: 13px;
  color: #888;
}

.container-code {
  display: flex;
  align-items: center;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #d0d7de;
  width: 100%; /* добавляем, чтобы растянуть контейнер */
}

.code-field {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  text-align: center;
  background-color: #f8fafc;
  font-weight: 600;
  color: #1e293b;
  word-break: break-word;
   width: 100%; /* растягиваем поле ввода */
    box-sizing: border-box; /* учитываем паддинги */
}

.copy-button {
  padding: 10px 16px;
  background: linear-gradient(135deg, #36b37e, #00875a);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.copy-button:hover {
  background: linear-gradient(135deg, #2d9c6e, #007652);
  transform: scale(1.05);
}

/* Ссылка */
.cupon-footer {
  width: 100%;
}

.offer-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.3s, transform 0.2s;
}

.offer-link:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-2px);
}

/* Название магазина */
.stores-name {
  color: #d6336c;
  font-size: 20px;
  font-weight: bold;
}

/* Нет купонов */
.no-coupons {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: #f9fafb;
  border: 1px dashed #bbb;
  border-radius: 10px;
  text-align: center;
  margin: 20px 0;
}

.no-coupons-content p {
  font-size: 18px;
  font-weight: bold;
  color: #999;
  margin: 0;
}

/* Адаптив */
@media (max-width: 768px) {
  .cupon-item {
    flex-direction: column;
    padding: 12px;
    align-items: stretch;
    
  }

  .container-code {
    flex-direction: column;
  }

  .copy-button {
    width: 100%;
    border-radius: 0 0 8px 8px;
  }

  .discount {
    display: none;
  }

  .cupon-content {
    margin-left: 0;
  }

  .cupon-title {
    font-size: 16px;
    margin: 8px 0;
    color: #2b8a3e;
  }

  .offer-link {
    width: 100%;
  }

  .cupon-description {
    font-size: 14px;
    text-align: justify;
    color: #3c5874;
  }
}
