:root {
  --tp-primary: #b074d1;
  --tp-primary-hover: #9e40d1;
  --tp-primary-active: #8536b0;
  --tp-primary-light: #f2e9f8;
  --tp-primary-lighter: #f8f3fb;
  --tp-primary-soft: rgba(176, 116, 209, 0.12);
  --tp-primary-glow: rgba(176, 116, 209, 0.35);
  --tp-radius: 0.85rem;
  --tp-shadow-sm: 0 6px 18px rgba(29, 58, 83, 0.06);
  --tp-shadow: 0 14px 34px rgba(29, 58, 83, 0.09);
  --tp-shadow-primary: 0 12px 26px rgba(176, 116, 209, 0.3);
  --tp-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

::selection { background: var(--tp-primary); color: #fff; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(176, 116, 209, 0.35); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(176, 116, 209, 0.6); }

.card {
  border: 1px solid rgba(176, 116, 209, 0.08);
  border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow-sm);
  transition: box-shadow 0.3s var(--tp-ease), transform 0.3s var(--tp-ease), border-color 0.3s var(--tp-ease);
}
.card.link:hover,
a.card:hover {
  transform: translateY(-4px);
  border-color: var(--tp-primary-soft);
  box-shadow: var(--tp-shadow);
}
.card .card-header {
  background: var(--tp-primary-lighter);
  border-bottom: 1px solid rgba(176, 116, 209, 0.08);
}

.btn {
  border-radius: 0.6rem;
  font-weight: 600;
  transition: transform 0.2s var(--tp-ease), box-shadow 0.2s var(--tp-ease), filter 0.2s var(--tp-ease), background-color 0.2s var(--tp-ease), color 0.2s var(--tp-ease);
}
.btn-primary {
  background-image: linear-gradient(135deg, #c98fe9 0%, #b074d1 50%, #9e40d1 100%);
  border: none;
  box-shadow: var(--tp-shadow-primary);
}
.btn-primary:hover,
.btn-primary:focus {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(176, 116, 209, 0.42);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 8px 18px rgba(176, 116, 209, 0.3); }
.btn-outline-primary { border-color: var(--tp-primary); color: var(--tp-primary); }
.btn-outline-primary:hover { background: var(--tp-primary); border-color: var(--tp-primary); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 20px rgba(176, 116, 209, 0.25); }

.form-control,
.form-select {
  border-radius: 0.6rem;
  border-color: #e5e7eb;
  transition: border-color 0.2s var(--tp-ease), box-shadow 0.2s var(--tp-ease);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--tp-primary);
  box-shadow: 0 0 0 0.2rem rgba(176, 116, 209, 0.18);
}

.table { border-radius: 0.75rem; }
.table thead th { background: var(--tp-primary-lighter); color: #6b4a7d; font-weight: 600; border-bottom: none; }

.badge { border-radius: 50rem; font-weight: 600; padding: 0.42em 0.72em; }
.alert { border-radius: 0.75rem; border: none; }

.addfunds-payment {
  border: 2px solid #ece7f2;
  border-radius: 0.75rem;
  padding: 0.7rem 1rem;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s var(--tp-ease), box-shadow 0.2s var(--tp-ease), transform 0.2s var(--tp-ease), background 0.2s var(--tp-ease);
}
.addfunds-payment img { max-height: 26px; max-width: 100%; }
.addfunds-payment:hover { border-color: var(--tp-primary); box-shadow: 0 8px 18px rgba(176, 116, 209, 0.16); transform: translateY(-2px); }
.addfunds-payment.active { border-color: var(--tp-primary); background: var(--tp-primary-light); box-shadow: 0 8px 18px rgba(176, 116, 209, 0.2); }

.checkboxDiv {
  border: 1px solid #ece7f2;
  border-radius: 0.7rem;
  transition: border-color 0.2s var(--tp-ease), background 0.2s var(--tp-ease), box-shadow 0.2s var(--tp-ease);
}
.checkboxDiv:hover { border-color: var(--tp-primary); }
.checkboxSelect { border-color: var(--tp-primary); background: var(--tp-primary-light); box-shadow: 0 6px 16px rgba(176, 116, 209, 0.16); }

.goods_info .title { color: var(--tp-primary); font-weight: 600; transition: color 0.2s var(--tp-ease); }
.goods_info .title:hover { color: var(--tp-primary-hover); }
.goods_info .info { color: #6b7280; }

.cart_qty .number { border-radius: 0.5rem; border-color: #e5e7eb; padding: 0.3rem 0.5rem; }

.nav-pills .nav-link {
  border-radius: 50rem;
  color: #6b7280;
  transition: background 0.25s var(--tp-ease), color 0.25s var(--tp-ease), box-shadow 0.25s var(--tp-ease);
}
.nav-pills .nav-link.active { background: linear-gradient(135deg, #c98fe9, #9e40d1); color: #fff; box-shadow: 0 8px 18px rgba(176, 116, 209, 0.3); }

.mobile-bottom-total {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1rem 1rem 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.cartitem {
  border: 1px solid #f0e7f6 !important;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s var(--tp-ease), box-shadow 0.3s var(--tp-ease), border-color 0.3s var(--tp-ease);
}
.cartitem::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d9b3f0, #b074d1, #8e50b0);
  opacity: 0;
  transition: opacity 0.3s var(--tp-ease);
}
.cartitem:hover,
.cartitem.active {
  transform: translateY(-6px);
  border-color: var(--tp-primary) !important;
  box-shadow: 0 22px 44px rgba(176, 116, 209, 0.22);
}
.cartitem:hover::before,
.cartitem.active::before { opacity: 1; }

.card-body.row > h4 {
  color: #3b2b46;
  font-size: 26px;
  transition: color 0.3s var(--tp-ease);
}
.cartitem:hover .card-body.row > h4,
.cartitem.active .card-body.row > h4 { color: var(--tp-primary); }

.card-footer.text-center.p-0 { border: none; background: transparent; }
.card-footer a {
  background: linear-gradient(135deg, #d9b3f0 0%, #b074d1 45%, #9e40d1 100%);
  border: none;
  border-radius: 0 0 1rem 1rem;
  padding: 0.85rem 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: filter 0.3s var(--tp-ease), letter-spacing 0.3s var(--tp-ease);
}
.card-footer a:hover { filter: brightness(1.07); letter-spacing: 1px; }

.firstgroup_box,
.secondgroup_box {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(29, 58, 83, 0.08) !important;
}
.firstgroup_box .firstgroup_item,
.secondgroup_box .secondgroup_item,
.pro_box .pro_item {
  border-radius: 0.8rem;
  border: 1px solid #ece7f2;
  transition: transform 0.25s var(--tp-ease), box-shadow 0.25s var(--tp-ease), background 0.25s var(--tp-ease), border-color 0.25s var(--tp-ease), color 0.25s var(--tp-ease);
}
.firstgroup_box .firstgroup_item:hover,
.secondgroup_box .secondgroup_item:hover,
.pro_box .pro_item:hover,
.firstgroup_box .firstgroup_item.active,
.secondgroup_box .secondgroup_item.active,
.pro_box .pro_item.active {
  background: linear-gradient(135deg, #c98fe9 0%, #b074d1 50%, #9e40d1 100%);
  border-color: transparent;
  border-radius: 0.8rem;
  color: #fff;
  box-shadow: 0 10px 22px rgba(176, 116, 209, 0.32);
  transform: translateY(-2px);
}
.firstgroup_box .firstgroup_item:hover a,
.secondgroup_box .secondgroup_item:hover a,
.pro_box .pro_item:hover a,
.firstgroup_box .firstgroup_item.active a,
.secondgroup_box .secondgroup_item.active a,
.pro_box .pro_item.active a { color: #fff; }

@media (max-width: 575.98px) {
  .card-body { padding: 1rem; }
  .addfunds-payment { min-height: 52px; }
  .cartitem:hover, .cartitem.active { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
