/* ============================================================
   GLOBAL UTILITIES
   ============================================================ */

.base-color { color: hsl(var(--main)); }
.radius--10px { border-radius: 10px; }

/* ---------- Copy animation ---------- */
.copyInput {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-block;
  width: 40px;
  line-height: 50px;
  text-align: center;
  font-size: 14px;
  cursor: pointer;
  transition: color .3s, background-color .3s;
}

.copied::after {
  content: "COPIED";
  position: absolute;
  top: 8px;
  right: 12%;
  display: block;
  width: 100px;
  padding: 5px;
  color: #fff;
  background-color: #ff7000;
  border-radius: 3px;
  font-size: 1em;
  opacity: 0;
  animation: showcopied 1.5s ease;
}

@keyframes showcopied {
  0%   { opacity: 0;   transform: translateX(100%); }
  50%  { opacity: .7;  transform: translateX(40%); }
  70%  { opacity: 1;   transform: translateX(0); }
  100% { opacity: 0; }
}

/* ---------- Cookies card ---------- */
.cookies-card {
  position: fixed;
  bottom: 15px;
  left: 15px;
  z-index: 999999;
  width: min(520px, calc(100vw - 30px));
  padding: 30px;
  color: #1e2337;
  background: #d1d1d1;
  border-radius: 5px;
  transition: transform .5s ease, opacity .3s ease;
}

.cookies-card.hide {
  transform: translateY(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
}

.cookies-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background-color: #6e6f70;
  color: #fff;
  font-size: 32px;
}

.cookies-card__content { margin-bottom: 0; }

.cookies-btn {
  display: inline-block;
  margin: 3px 5px;
  padding: 10px 35px;
  color: #363636;
  text-decoration: none;
  border-radius: 999px;
}

.cookies-btn:hover { color: #363636; }
.cookies-btn:focus-visible {
  outline: 2px solid hsl(var(--main));
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .cookies-card {
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 15px;
    font-size: 14px;
    border-radius: 5px 5px 0 0;
  }
}

/* ---------- Input popup ---------- */
.hover-input-popup { position: relative; }
.input-popup { display: none; }

.hover-input-popup .input-popup {
  display: block;
  position: absolute;
  bottom: 70%;
  left: 50%;
  width: 280px;
  padding: 20px;
  color: #fff;
  background-color: #1a1a1a;
  border-radius: 5px;
  transform: translateX(-50%);
  transition: opacity .3s, transform .3s;
}

.input-popup::after {
  content: "";
  position: absolute;
  bottom: -19px;
  left: 50%;
  margin-left: -5px;
  border: 10px solid transparent;
  border-bottom-color: #1a1a1a;
  transform: rotate(180deg);
}

.input-popup p { position: relative; padding-left: 20px; }
.input-popup p::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  font-family: "Line Awesome Free";
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
}

.input-popup p.error { text-decoration: line-through; }
.input-popup p.error::before   { content: "\f057"; color: #ea5455; }
.input-popup p.success::before { content: "\f058"; color: #28c76f; }

/* ---------- Filter toggle ---------- */
.show-filter { display: none; }

@media (max-width: 767px) {
  .responsive-filter-card { display: none; }
  .show-filter { display: block; }
}

/* ============================================================
   SELECT2 OVERRIDES
   ============================================================ */

.select2-dropdown {
  margin-top: 8px;
  border: 0;
  border-radius: 5px;
  box-shadow:
    0 3px 9px rgba(50, 50, 9, .05),
    6px 4px 19px rgba(115, 103, 240, .2);
}

.select2-search--dropdown {
  padding: 10px;
  border-color: #ced4da;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  padding: 10px 20px;
  border-color: #ced4da;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: #e0e0e0;
  box-shadow: 0 0 25px rgba(115, 103, 240, .071);
  outline: 0;
}

.select2-results__option.select2-results__option--selected,
.select2-results__option--selectable,
.select2-container--default .select2-results__option--disabled {
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
}

.select2-results__option.select2-results__message {
  padding: 12px 14px;
  text-align: center;
}

.select2-container--default .select2-results > .select2-results__options::-webkit-scrollbar {
  width: 8px;
  border-radius: 5px;
}
.select2-container--default .select2-results > .select2-results__options::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}
.select2-container--default .select2-results > .select2-results__options::-webkit-scrollbar-thumb,
.select2-container--default .select2-results > .select2-results__options::-webkit-scrollbar-thumb:hover {
  background: #ddd;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b { display: none; }

.select2-container--default .select2-selection--single .select2-selection__arrow::after {
  content: "\f107";
  position: absolute;
  top: 50%;
  right: 10px;
  height: 36px;
  font-family: "Line Awesome Free";
  font-weight: 900;
  transform: translateY(-50%);
  transition: transform .3s;
}

.select2-container--default.select2-container--open
  .select2-selection--single .select2-selection__arrow::after { content: "\f106"; }

.selection { width: 100%; }

.select2-container--default .select2-selection--single {
  height: 47px;
  background-color: transparent;
  border: 1px solid hsl(var(--black) / .12);
  color: hsl(var(--black));
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  position: absolute;
  top: 50%;
  right: 1px;
  width: 20px;
  height: 47px;
  transform: translateY(-50%);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  height: 47px;
  line-height: 47px;
}

.select2-results__option:first-child {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}
.select2-results__option:last-child {
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.select2-results__option.select2-results__option--selected,
.select2-container--default
  .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: #f1f1f1;
  color: #000;
}

.select2-dropdown .country-flag {
  width: 25px;
  height: 25px;
  border-radius: 8px;
}

.select2-dropdown .gateway-title    { margin: 0; font-size: 14px; font-weight: 600; }
.select2-dropdown .gateway-subtitle { margin: 0; font-size: 12px; }

.select2-container--open .select2-selection.select2-selection--single,
.select2-container--open .select2-selection.select2-selection--multiple {
  border-color: hsl(var(--base));
  border-radius: .375rem;
}

/* ============================================================
   PAYMENT / DEPOSIT
   ============================================================ */

.gateway-card { padding: 15px; }

.payment-card-title {
  margin-bottom: 0;
  padding: 13px 25px;
  color: #fff;
  background-color: hsl(var(--main));
  border: 0;
  border-radius: 5px;
  text-align: center;
}

.payment-system-list {
  --thumb-width: 100px;
  --thumb-height: 40px;
  --radio-size: 12px;
  --border-color: #cccccf59;
  --hover-border-color: hsl(var(--main));
  height: 100%;
  background-color: #fff;
  border-radius: 5px;
}

.payment-system-list.is-scrollable {
  max-height: min(388px, 70vh);
  padding-block: 4px;
  overflow-y: auto; /* was overflow-x — bug */
}

.payment-system-list.is-scrollable::-webkit-scrollbar { width: 5px; }
.payment-system-list.is-scrollable::-webkit-scrollbar-thumb {
  background-color: hsl(var(--main));
  border-radius: 10px;
}

.payment-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 18px;
  border: 1px solid #fff;
  border-top-color: var(--border-color);
  border-left: 3px solid transparent;
  transition: border-color .3s, background-color .3s;
}

.payment-item:first-child {
  border-top-color: #fff;
  border-radius: 5px 5px 0 0;
}

.payment-item:has(.payment-item__radio:checked) {
  border-left-color: var(--hover-border-color);
  border-radius: 0;
}

.payment-item__check {
  display: inline-block;
  width: var(--radio-size);
  height: var(--radio-size);
  border: 1px solid hsl(var(--main));
  border-radius: 100%;
}

.payment-item:has(.payment-item__radio:checked) .payment-item__check {
  border: 3px solid hsl(var(--main));
}

.payment-item__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  max-width: calc(100% - var(--thumb-width));
  min-width: 0;
}

.payment-item__name {
  width: calc(100% - var(--radio-size));
  padding-left: 10px;
  overflow-wrap: anywhere;
  transition: color .3s;
}

.payment-item__thumb {
  width: var(--thumb-width);
  height: var(--thumb-height);
  padding-left: 10px;
  text-align: right;
}

.payment-item__thumb:has(.text) { width: fit-content; } /* flattened nesting */

.payment-item__thumb img {
  max-width: var(--thumb-width);
  max-height: var(--thumb-height);
  object-fit: cover;
}

/* Deposit info */
.deposit-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.deposit-info__title {
  max-width: 50%;
  margin-bottom: 0;
  text-align: left;
}

.deposit-info__input {
  width: 100%;
  max-width: 50%;
  text-align: right;
}

.deposit-info__input-select {
  width: 100%;
  padding-block: 6px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

.deposit-info__input-group {
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

.deposit-info__input-group .deposit-info__input-group-text { /* flattened nesting */
  align-self: center;
  padding-left: 5px;
}

.deposit-info__input-group .form--control {
  height: 35px;
  padding: 5px;
  border: 0;
  text-align: right;
}

.deposit-info__input-group .form--control:focus { box-shadow: none; }

.info-text .text,
.deposit-info__input .text { font-size: 14px; }

.deposit-info__title .text.has-icon {
  display: flex;
  align-items: center;
  gap: 5px;
}

.total-amount { border-top: 1px solid var(--border-color); }
.total-amount .deposit-info__title { font-weight: 600; }

.payment-item__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 15px;
  background: #fff;
  border: 0;
  border-block: 1px solid var(--border-color);
  border-bottom: 0;
  font-weight: 500;
}

.payment-item:hover + .payment-item__btn { border-top-color: #fff; }

button .spinner-border {
  --bs-spinner-width: 1.5rem;
  --bs-spinner-height: 1.5rem;
}

/* ============================================================
   MARKETPLACE
   ============================================================ */

/* 1. Layout wrappers */
.catalog-section { background: #eef1f5; }

.catalog-item-wrapper { margin-bottom: 40px; }

.catalog-item-wrapper__header {
  margin-bottom: 20px;
  padding: 0 10px;
}

.catalog-item-wrapper__header h4 {
  font-size: 30px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.catalog-item-wrapper .market-card { margin-bottom: 25px; }

/* Make Bootstrap columns flex so height:100% propagates */
.catalog-item-wrapper .row > [class*="col-"] { display: flex; }

/* 2. Market card (grid view) */
.market-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background: #e8edf2;
  border: 1px solid #d6dde5;
  border-radius: 20px;
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease;
}

.market-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
}

.market-card:focus-within {
  box-shadow: 0 0 0 3px hsl(var(--main) / .35);
}

.market-price-row{
    margin:12px 0;
}

.market-thumb {
  position: relative;
  background: #e5e7eb; /* fallback when image fails */
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.market-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 24px);
  padding: 6px 12px;
  background: #0A2540;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 30px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
}

.market-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  color: #0f172a;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.market-desc {
  display: none;
  color: #475569; /* contrast bumped */
  font-size: 14px;
  line-height: 1.6;
}

.market-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
  min-width: 0;
}

.market-meta > * { min-width: 0; }

.stock-badge {
  padding: 6px 12px;
  background: #d5f0dc;
  color: #14532d; /* AA on #d5f0dc */
  font-size: 14px;
  font-weight: 700;
  border-radius: 30px;
  white-space: nowrap;
}

.price-badge {
  color: #0A2540;
  font-size: 20px;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.market-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.preview-btn,
.buy-btn {
  flex: 1;
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color .25s, color .25s, transform .25s;
}

.preview-btn { background: #dde3e8; color: #0f172a; }

.buy-btn { background: #08284b; color: #fff; border: none; }

.preview-btn:focus-visible,
.buy-btn:focus-visible,
.market-preview-btn:focus-visible,
.market-buy-btn:focus-visible {
  outline: 2px solid hsl(var(--main));
  outline-offset: 2px;
}

.out-stock-btn {
  background: #cbd5e1;
  color: #1f2937; /* AA */
  cursor: not-allowed;
}

/* 3. Market card (list view) */
.market-list-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  padding: 12px;
  background: #d7dde4;
  border: 1px solid #c7d0d9;
  border-radius: 14px;
}

.market-list-top {
  display: flex;
  flex: 1;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.market-list-image {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: 10px;
  background: #e5e7eb;
  object-fit: cover;
}

.market-list-info {
  flex: 1;
  min-width: 0;
}

.market-list-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.market-list-category {
  color: #475569; /* AA on #d7dde4 */
  font-size: 12px;
}

.market-stock {
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
}

.market-price {
  color: #0A2540;
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.market-buttons {
  display: flex;
  gap: 8px;
  margin-top: auto; /* pin to bottom — equal-height fix */
  padding-top: 12px;
}

.market-preview-btn,
.market-buy-btn {
  flex: 1;
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transition: background-color .25s, color .25s;
}

.market-preview-btn { background: #fff; color: #111827; text-decoration: none; }
.market-buy-btn { background: #0A2540; color: #fff; border: none; }

/* 4. Dark mode (uses .dark per Tailwind config) */
.dark .market-card,
.dark .market-list-card {
  background: #111827;
  border-color: #1e293b;
}

.dark .market-thumb,
.dark .market-list-image { background: #1f2937; }

.dark .market-title,
.dark .market-list-title { color: #f8fafc; }

.dark .market-desc,
.dark .market-list-category { color: #94a3b8; }

.dark .preview-btn,
.dark .market-preview-btn {
  background: #1e293b;
  color: #f8fafc;
}

.dark .buy-btn,
.dark .market-buy-btn {
  background: #2563eb;
  color: #fff;
}

.dark .price-badge,
.dark .market-price { color: #60a5fa; }

.dark .stock-badge { background: #14532d; color: #d1fae5; }

.dark .out-stock-btn { background: #334155; color: #cbd5e1; }

.dark .category-badge { background: #1e293b; color: #f8fafc; }

/* 5. Responsive: tablet (≤768px) */
@media (max-width: 768px) {
  .container {
    max-width: 100%;
    padding-inline: 12px;
  }

  .catalog-item-wrapper .row { --bs-gutter-x: 10px; }
  .catalog-item-wrapper__header h4 { font-size: 18px; }

  .market-card {
    border-radius: 16px;
    box-shadow: none;
  }
  .market-card:hover { transform: none; }

  .market-thumb { aspect-ratio: 16 / 11; }
  .market-body { padding: 10px; }

  .market-title { font-size: 14px; margin-bottom: 6px; }

  .market-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 10px 0;
  }

  .stock-badge { padding: 4px 10px; font-size: 11px; }
  .price-badge { font-size: 15px; line-height: 1.2; }

  .market-actions { gap: 6px; }

  .preview-btn,
  .buy-btn {
    padding: 8px;
    font-size: 12px;
    border-radius: 8px;
  }

  .market-list-image { width: 60px; height: 60px; }
  .market-list-title { font-size: 13px; }
  .market-price { font-size: 16px; }
}

/* 6. Responsive: mobile (≤575px) */
@media (max-width: 575px) {
  .market-card {
    background: #f3f4f6;
    border-color: #e5e7eb;
  }

  .market-thumb { aspect-ratio: 4 / 3; }
  .market-body { padding: 12px; }

  .market-title { font-size: 14px; margin-bottom: 6px; }

  .price-badge { font-size: 14px; line-height: 1.2; }

  .stock-badge {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 20px;
  }

  .preview-btn,
  .buy-btn {
    padding: 10px 6px;
    font-size: 12px;
    border-radius: 8px;
    white-space: nowrap;
  }

  .category-badge { padding: 5px 8px; font-size: 10px; }
}

/* 7. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }

  .market-card:hover {
    transform: none;
  }

/* Mobile Bottom Navigation */
.mobile-bottom-nav{
    position:fixed;
    left:0;
    bottom:0;
    width:100%;
    background:#fff;
    border-top:1px solid #e2e8f0;
    z-index:9999;
    display:none;
}

.mobile-bottom-wrapper{
    display:grid;
    grid-template-columns:repeat(4,1fr);
}

.mobile-nav-item{
    text-decoration:none;
    padding:10px 5px;
    text-align:center;
    color:#6b7280;
    font-size:.78rem;
    font-weight:600;
}

.mobile-nav-item.active{
    color:#ff7a00;
}

.mobile-nav-icon{
    display:block;
    font-size:1.1rem;
    margin-bottom:4px;
}

@media(max-width:768px){
    .mobile-bottom-nav{
        display:block;
    }
}