/* ==============================================================
   GAMIFICATION — ITEM PICKER  (prefix hgg2025-)
   ==============================================================*/

/* ---------- базові елементи ---------- */

#hgg2025-gitem-item-selection::-webkit-scrollbar {
  width: 6px;
}

#hgg2025-gitem-item-selection::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.hgg2025-gitem_scroll-wrapper {
  position: relative;
  width: 150px;
  max-height: 450px;
}

#hgg2025-gitem-item-selection {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

#hgg2025-gitem-scroll-indicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  color: #888;
  opacity: .6;
  transition: opacity .3s ease;
  pointer-events: none;
  animation: hgg2025-gitem_bounce 1.5s infinite;
}

#hgg2025-gitem-scroll-indicator,
#hgg2025-gitem-scroll-up {
  cursor: pointer;
}

#hgg2025-gitem-scroll-up {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-size: 26px;
  color: #888;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
  animation: hgg2025-gitem_bounce_up 1.5s infinite;
  z-index: 2;
}

@keyframes hgg2025-gitem_bounce_up {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-4px); }
}

@keyframes hgg2025-gitem_bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(4px); }
}

/* ---------- картка айтема ---------- */

.hgg2025-gitem_item-card {
  border: 1px solid #d1e3f8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,.06);
  padding: .5rem;
  position: relative;
  text-align: center;
  font-family: sans-serif;
}

.hgg2025-gitem_item-card.hgg2025-gitem_selected {
  border: 3px solid #ffe58f;
}

.hgg2025-gitem_item-card .hgg2025-gitem_label {
  font-weight: 600;
  text-align: start;
}

.hgg2025-gitem_item-card img {
  width: 100%;
  max-width: 100px;
  object-fit: contain;
  margin-bottom: .5rem;
}

.hgg2025-gitem_item-card .hgg2025-gitem_price {
  background: #e9f5ff;
  color: #007acc;
  font-weight: 600;
  font-size: .85rem;
  border-radius: 10px;
  padding: 3px 3px;
  margin: 0 auto;
  width: fit-content;
}

.hgg2025-gitem_item-card .hgg2025-gitem_remove {
  position: absolute;
  top: -7px;
  right: -7px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  color: #444;
}

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

/* ---------- TABLET 768 – 1024 px ---------- */
@media (min-width: 768px) and (max-width: 1024px) {

  .hgg2025-gitem_scroll-wrapper {
    width: 100%;
    max-width: 100%;
    max-height: 520px;
    padding-bottom: 2.5rem;
  }

  #hgg2025-gitem-item-selection {
    flex-direction: row;
    gap: 16px;              /* однаковий gap */
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    justify-content: flex-start;
    padding: 0;             /* прибираємо внутрішній padding, щоб простіше рахувати ширину */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .hgg2025-gitem_item-card {
    /* рівно 3 картки в ряд: 3 * width + 2 * gap = 100% */
    flex: 0 0 calc((100% - 2 * 16px) / 3);
    max-width: calc((100% - 2 * 16px) / 3);
    min-width: 140px;
    scroll-snap-align: start;
  }

  /* Стрілки вниз */
  .hgg2025-gitem_arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 0.5rem;
    z-index: 5;
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 22px;
    color: #007acc;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0,0,0,.15);
    cursor: pointer;
    user-select: none;
  }

  .hgg2025-gitem_arrow-left  {
    left: 1rem;
    animation: hgg2025-gitem_bounce_hL 1.5s infinite;
  }

  .hgg2025-gitem_arrow-right {
    right: 1rem;
    animation: hgg2025-gitem_bounce_h  1.5s infinite;
  }

  @keyframes hgg2025-gitem_bounce_h {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(4px); }
  }

  @keyframes hgg2025-gitem_bounce_hL {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(-4px); }
  }

  #hgg2025-gitem-scroll-indicator {
    display: none;
  }

  /* Пагінація */
  #hgg2025-gitem-pagination {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 4;
  }

  .hgg2025-gitem_dot {
    width: 10px;
    height: 10px;
    background-color: #b3d9f9;
    border-radius: 50%;
    transition: background-color 0.3s;
  }

  .hgg2025-gitem_dot.hgg2025-gitem_active {
    background-color: #007acc;
  }
}

/* ---------- MOBILE ≤768 px ---------- */
@media (max-width: 767px) {

  .hgg2025-gitem_item-card .hgg2025-gitem_label,
  .hgg2025-gitem_item-card .hgg2025-gitem_remove {
    display: none;
  }

  .hgg2025-gitem_scroll-wrapper {
    width: 100%;
    max-width: 100%;
    max-height: none;
    padding-bottom: 3.5rem;
    margin-bottom: 1rem;
  }

  #hgg2025-gitem-item-selection {
    flex-direction: row;
    gap: .75rem;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .hgg2025-gitem_item-card {
    min-width: calc((100% - 2 * 10px) / 3);
    flex: 0 0 calc((100% - 2 * 40px) / 3);
    scroll-snap-align: start;
  }

  .hgg2025-gitem_arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 0.5rem;
    z-index: 5;
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 22px;
    color: #007acc;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0,0,0,.15);
    cursor: pointer;
    user-select: none;
  }

  .hgg2025-gitem_arrow-left  {
    left: 1rem;
    animation: hgg2025-gitem_bounce_hL 1.5s infinite;
  }

  .hgg2025-gitem_arrow-right {
    right: 1rem;
    animation: hgg2025-gitem_bounce_h  1.5s infinite;
  }

  #hgg2025-gitem-scroll-indicator {
    display: none;
  }

  /* Пагінація */
  #hgg2025-gitem-pagination {
    position: absolute;
    bottom: 0.8rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 4;
  }

  .hgg2025-gitem_dot {
    width: 10px;
    height: 10px;
    background-color: #b3d9f9;
    border-radius: 50%;
    transition: background-color 0.3s;
  }

  .hgg2025-gitem_dot.hgg2025-gitem_active {
    background-color: #007acc;
  }
}

/* ---------- DESKTOP >1024 px ---------- */
@media (min-width: 1025px) {

  .hgg2025-gitem_scroll-wrapper {
    width: 140px;
  }

  #hgg2025-gitem-scroll-indicator {
    font-size: 26px;
    animation: hgg2025-gitem_bounce 1.8s infinite;
  }

  .hgg2025-gitem_arrow {
    display: none;
  }

  .hgg2025-gitem_item-card {
    padding: 0.4rem;
    font-size: 0.9rem;
    max-width: 160px;
  }

  .hgg2025-gitem_item-card img {
    max-width: 80px !important;
    margin-bottom: 0.4rem;
  }

  .hgg2025-gitem_item-card .hgg2025-gitem_price {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }

  #hgg2025-gitem-pagination {
    display: none !important;
  }
}
