/* Edge-to-edge навіть у вузькому контейнері */
.wdc-edge{
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Смуга (50px desktop) */
.wdc-bar{
  position: relative;
  height: 50px;
  background: #0b1220;
  overflow: hidden;
}

/* Заповнення прогресу */
.wdc-fill{
  position: absolute;
  inset: 0;
  width: var(--wdc-pct, 0%);
  background: #F54E96;
  transition: width .25s ease;
}

/* Контент поверх */
.wdc-content{
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* left | center | right */
  align-items: center;
  height: 100%;
  color: #fff;
  font-size: 14px;
  line-height: 1.1;
  padding: 0 14px;
  gap: 12px;
}

.wdc-left{
  justify-self: start;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 600; opacity: .95;
}
.wdc-left {
  background: #ffffff;
  color: #f54e96;
  border: 1px solid rgba(0,0,0,.1);
  padding: 9px 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  min-height: 30px;
  line-height: 15px;
}
.wdc-center{
  justify-self: center; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 700;
}

.wdc-right{
  justify-self: end;
  display: inline-flex; align-items: center; gap: 10px;
  white-space: nowrap;
}

/* Кнопки/лінки праворуч */
.wdc-gift-trigger{
  background: #111827;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  padding: 8px 12px;
  border-radius: 0px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
}
.wdc-gift-trigger:hover{ filter: brightness(1.05); }

.wdc-shop-link{
  display:inline-block;
  background:#ffffff;
  color:#0f172a;
  border:1px solid rgba(0,0,0,.1);
  padding: 9px 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  min-height: 30px;
  line-height: 15px;
}
.wdc-shop-link:hover{ filter:brightness(1.03); }

.wdc-success{
  font-size:12px;
  background:rgba(34,197,94,.12);
  border:1px solid rgba(34,197,94,.35);
  padding:6px 8px;
  border-radius:10px;
  line-height: 16px;
}

/* ---------- Modal (footer root) ---------- */
body.wdc-modal-open{ overflow: hidden; }

.wdc-modal[aria-hidden="true"]{ display:none; }
.wdc-modal{
  position: fixed; inset: 0; z-index: 9999;
  display:flex; align-items:center; justify-content:center;
}
.wdc-modal-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.55); }

.wdc-modal-dialog{
  position:relative; 
  background:white; color:black;
  max-width: 940px; width: 95%;
  max-height: 90vh; /* desktop safety */
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
  display:flex; flex-direction:column;
}
.wdc-modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.wdc-modal-title{ font-weight: 800; font-size: 16px; }
.wdc-modal-close {
  background: transparent;
    background-color: transparent;
  border: 0;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 1px 8px;
}
.wdc-modal-body{ padding:12px; overflow:auto; }

.wdc-modal-loading{
  opacity:.8; font-size:14px; text-align:center; padding:16px 6px;
}

/* Вітрина подарунків */
.wdc-gifts-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
@media (max-width:1024px){ .wdc-gifts-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .wdc-gifts-grid{ grid-template-columns:1fr; } }

.wdc-gift-card{
  background:white; border:1px solid rgba(255,255,255,.08);
  border-radius:12px; padding:10px;
  display:flex; flex-direction:column; align-items:center; gap:8px;
}
.wdc-gift-img img{ display:block; max-width:100%; height:auto; border-radius:10px; }
.wdc-thumb-placeholder{ width:100%; aspect-ratio:1/1; background:#1f2937; border-radius:10px; }
.wdc-gift-title a{ color:black; text-decoration:none; text-align:center; display:block; font-size:13px; }
.wdc-gift-apply-card {
  background: #22c55e;
    background-color: rgb(34, 197, 94);
  color: white;
  border: 0;
  border-radius: 0px;
  padding: 8px 30px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  min-height: 36px;
  text-align: center;
  width: max-content;
}

/* =====================  RESPONSIVE  ===================== */

/* Tablet: трохи менший шрифт, бар вищий */
@media (max-width: 1024px){
  .wdc-content{ font-size: 13px; gap: 10px; }
  .wdc-bar{ height: 40px; }
}

/* Phablet / мобільний: переукладка у 2 рядки */
@media (max-width: 768px){
  .wdc-content{
    grid-template-columns: 1fr 1fr;       /* 2 колонки */
    grid-template-areas:
      "center center"
      "left   right";
    row-gap: 6px;
    padding: 6px 10px;
    align-content: center;
  }
  .wdc-left  { grid-area: left;  font-size: 12px; }
  .wdc-center{ grid-area: center; font-size: 13px; font-weight: 800; }
  .wdc-right { grid-area: right; justify-self: end; }

  .wdc-bar{ height: 45px; }
  .wdc-success{ font-size:11px; }
  .wdc-gift-trigger, .wdc-shop-link{ padding:7px 10px; min-height:34px; font-size:11.5px; border-radius:9px; }
}

/* Дуже вузькі (iPhone SE/старі Android) */
@media (max-width: 420px){
  .wdc-content{ row-gap: 4px; padding: 6px 8px; }
  .wdc-center{ font-size: 12.5px; }
  .wdc-left{ font-size: 11.5px; max-width: 65vw; }
  .wdc-right{ gap: 8px; }
  .wdc-success{ display:block; text-align:right; }
  .wdc-gift-trigger, .wdc-shop-link{ padding:6px 9px; min-height:32px; font-size:11px; }
}

/* Надвузькі (320px): уникаємо зламів, ховаємо лінк у магазин якщо бракує місця */
@media (max-width: 340px){
  .wdc-shop-link{ display:none; }
}

/* Mobile bottom-sheet для модалки */
@media (max-width: 768px){
  .wdc-modal-dialog{
    width: 100%;
    max-width: 100%;
    height: 88vh;
    max-height: 88vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
    margin-top: auto; /* прилипає до низу як sheet */
  }
}


/* ---------- Toast (bottom-center) ---------- */
#wdc-toast-container{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none; /* щоб клік проходив тільки по самим тостам */
}
.wdc-left a {
  color: #f54e96;
}
.wdc-toast{
  pointer-events: auto;
  background: rgba(17,24,39,.96); /* темний */
  color: #fff;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 260px;
  max-width: 92vw;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  display: flex; align-items: center; gap: 10px;
  transform: translateY(12px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
  font-size: 14px;
}

.wdc-toast-in{ transform: translateY(0); opacity: 1; }
.wdc-toast-out{ transform: translateY(12px); opacity: 0; }

.wdc-toast-close{
  background: transparent; border: 0; color: #fff;
  font-size: 16px; cursor: pointer; line-height: 1;
  opacity: .85;
}
.wdc-toast-close:hover{ opacity: 1; }

@media (max-width: 420px){
  .wdc-toast{ font-size: 13px; padding: 9px 10px; border-radius: 10px; }
}

/* Admin refresh button */
.wdc-refresh{
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  width: 34px; height: 34px;
  border-radius: 999px;
  font-size: 16px; line-height: 1;
  cursor: pointer;
}
.wdc-refresh:hover{ filter: brightness(1.1); }
@media (max-width:768px){ .wdc-refresh{ width:32px; height:32px; font-size:15px; } }
/* Лівий блок: завжди займає місце, щоб нічого не зсувалось */
#wdc-crossbar .wdc-left{
  display:flex;
  align-items:center;
  gap:8px;
  /* за бажанням можна підстрахуватись мінімальною шириною для стабільності */
  /* min-width: 200px; */
}

/* Коли текст не потрібен — робимо його невидимим, але зберігаємо місце */
#wdc-crossbar .wdc-left.wdc-left--invisible{
  visibility: hidden;   /* box лишається у потоці, розміри не змінюються */
  pointer-events: none; /* на всякий */
}

/* Іконка + текст (залишив, щоб можна було легко стилізувати) */
#wdc-crossbar .wdc-left-ico{ font-size:16px; line-height:1; }
#wdc-crossbar .wdc-left-text{ white-space:nowrap; }




/* ===== Mobile polish (додаткові правки) ===== */

/* робимо прогрес-бар трохи "гумовішим" на мобільних */
@media (max-width: 768px){
  .wdc-bar{
    height: auto;                 /* щоб помістився контент */
    min-height: 45px;
    padding: 6px 0;
  }
  .wdc-fill{ inset: 0; }          /* заповнення по всій висоті */
  
  /* центр: дозволити перенос, зменшити міжряддя */
  .wdc-center{
    white-space: normal;          /* було nowrap → ламало верстку */
    line-height: 1.2;
    max-width: 100%;
    word-break: break-word;
  }
    .wdc-content {
  display: flex;
  justify-content: center;
  align-items: center;
  align-content: center;
  height: 40px;
}
  /* лівий “піллюля”-блок: обмежуємо ширину, дрібніший падінг */
  #wdc-crossbar .wdc-left{
    max-width: 72vw;              /* не забирає весь рядок */
    padding: 7px 9px;
    gap: 6px;
  }
  #wdc-crossbar .wdc-left-ico{ font-size: 14px; }

  /* праві кнопки: трохи компактніше */
  .wdc-right{ gap: 8px; }
  .wdc-gift-trigger, .wdc-shop-link{
    padding: 6px 10px;
    min-height: 32px;
    font-size: 11.5px;
    border-radius: 9px;
  }
}

/* дуже вузькі — робимо центр у два рядки і ще стискаємо лівий блок */
@media (max-width: 420px){
  .wdc-content{
    row-gap: 4px;
    padding: 6px 8px;
  }
  .wdc-center{ font-size: 12.5px; }
  #wdc-crossbar .wdc-left{ max-width: 64vw; font-size: 11.5px; }
  .wdc-right{ gap: 6px; }
}

/* extra-narrow: якщо не влазить — ховаємо лінк у магазин */
@media (max-width: 360px){
  .wdc-shop-link{ display:none !important; }
}

/* коли досягнуто максимум — центр коротший, щоб не роздувало */
#wdc-crossbar.is-max .wdc-center{
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
/* ====== ДЕСКТОП ====== */
@media (min-width: 769px){
  /* у барі видно всі три колонки */
  #wdc-crossbar .wdc-left,
  #wdc-crossbar .wdc-right { display:flex; }
  /* підбар ховаємо повністю */
  .wdc-underbar { display:none !important; }
}

/* ====== МОБАЙЛ ====== */
@media (max-width: 768px){
  /* у барі лишаємо тільки центр */
  #wdc-crossbar .wdc-left,
  #wdc-crossbar .wdc-right { display:none !important; }
  /* показуємо підбар */
  .wdc-underbar { display:grid; }
}

/* ===== UNDERBAR (рядок під смугою) ===== */

/* базово — нічого не показуємо, ти вже керуєш через media-queries */
.wdc-underbar{
  display:none;
}

/* мобайл: показуємо підбар, 2 рядки — повідомлення і дії */
@media (max-width: 768px){
  .wdc-underbar{
    display: grid !important;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 10px;
    padding: 8px 12px 12px;
  }

  /* “піллюля” з повідомленням */
  .wdc-underbar .wdc-under-left{
    display:flex; align-items:center; gap:8px;
    background:#fff; color:#f54e96;
    border:1px solid rgba(0,0,0,.1);
    padding:9px 10px;
    border-radius:10px;
    font-size:12px; font-weight:700; line-height:15px;
    min-height:30px;
    /* не даємо тексту ламати верстку */
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }

  /* рядок з кнопками */
  .wdc-underbar .wdc-under-actions{
    display:flex; gap:8px; align-items:center;
  }

  /* кнопки у підбарі тягнуться рівномірно */
  .wdc-underbar .wdc-gift-trigger,
  .wdc-underbar .wdc-shop-link{
    flex:1 1 0;
    text-align:center;
    min-height:34px;
    font-size:11.5px;
    border-radius:0px;
    padding:7px 10px;
  }
}

/* дуже вузькі: якщо не влазять у ряд — переносимо кнопки в 2 колонки */
@media (max-width: 420px){
  .wdc-underbar .wdc-under-actions{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:8px;
  }
  
    .wdc-center {
    font-size: 14px;
    padding-left: 15px;
    padding-right: 15px;
    font-weight: 700;
    line-height: 130%;
  }
  
}

/* коли макс-рівень — просто ховаємо текстову “піллюлю” в підбарі (щоб не стрибало) */
#wdc-crossbar.is-max + .wdc-underbar .wdc-under-left{
  visibility: hidden;
  pointer-events: none;
}
/* Десктоп: показуємо left/right в барі, ховаємо підбар */
@media (min-width: 769px){
  #wdc-crossbar-wrap #wdc-crossbar .wdc-left,
  #wdc-crossbar-wrap #wdc-crossbar .wdc-right { display:flex; }
  #wdc-crossbar-wrap .wdc-underbar { display:none !important; }
}

/* Мобайл: у барі лиш центр, підбар показати */
@media (max-width: 768px){
  #wdc-crossbar-wrap #wdc-crossbar .wdc-left,
  #wdc-crossbar-wrap #wdc-crossbar .wdc-right { display:none !important; }
  #wdc-crossbar-wrap .wdc-underbar { display:grid; grid-template-columns: 1fr; gap:10px; align-items:center; padding:8px 12px; }
  #wdc-crossbar-wrap .wdc-under-left{
    display:inline-flex; align-items:center; gap:6px;
    background:#fff; color:#f54e96; border:1px solid rgba(0,0,0,.1);
    padding:8px 10px; border-radius:0px; font-size:12px; font-weight:700; text-decoration:none; min-height:30px;
  }
  #wdc-crossbar-wrap .wdc-under-actions{ justify-self:end; display:inline-flex; gap:8px; }
  
/* Вбиваємо тільки порожній дублікат */
#wdc-crossbar .wdc-underbar[data-dup="1"] {
  display: none !important;
}
#wdc-crossbar-wrap .wdc-under-actions {
    justify-self: end;
    display: inline-flex;
    gap: 8px;
    width: max-content;
    margin: 0 auto;
  }
#wdc-crossbar-wrap .wdc-under-left {
  width: max-content;
  margin: 0 auto;
}
.wdc-modal-dialog {
  margin-right: 10px;
  margin-left: 10px;
}
}
/* Мобайл: 2 картки в ряд, на дуже вузьких — 1 */
@media (max-width: 768px){
  .wdc-modal .wdc-gifts-grid{
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 12px !important;
  }
}
@media (max-width: 460px){
  .wdc-modal .wdc-gifts-grid{
    grid-template-columns: 1fr !important;
  }
}