/* --- Variables & Theme Setup --- */
:root {
  --base-clr: hsl(var(--main));
  --accent-clr: #ff7000;
  --bg-card: #d1d1d1;
  --text-dark: #1e2337;
  --border-muted: #cccccf59;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 3px 9px rgba(50, 50, 9, 0.05), 6px 4px 19px rgb(115 103 240 / 20%);
}

/* --- Copy Animation Optimized --- */
.copyInput {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0; 
  right: 0;
  width: 40px;
  height: 50px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.copied::after {
  content: "COPIED";
  position: absolute;
  top: 8px;
  right: 12%;
  padding: 5px 10px;
  background: var(--accent-clr);
  color: #fff;
  font-size: 0.85rem;
  border-radius: 4px;
  pointer-events: none;
  animation: slideAndFade 1.5s ease-in-out forwards;
}

@keyframes slideAndFade {
  0% { opacity: 0; transform: translateX(20px); }
  20%, 80% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* --- Cookie Card: Improved Scoping --- */
.cookies-card {
  --card-width: 520px;
  width: min(var(--card-width), calc(100vw - 30px));
  position: fixed;
  bottom: 15px;
  left: 15px;
  padding: 1.5rem;
  background: var(--bg-card);
  color: var(--text-dark);
  border-radius: 10px;
  z-index: 1000;
  transition: transform 0.5s ease, opacity 0.5s ease;
  box-shadow: var(--shadow-sm);
}

.cookies-card.hide {
  transform: translateY(120%);
  opacity: 0;
}

/* --- Select2 Modernization --- */
.select2-container--default .select2-selection--single {
  border: 1px solid #d9d9d9 !important;
  border-radius: 0.375rem !important;
  height: 42px !important; /* Standardized height */
  display: flex;
  align-items: center;
}

.select2-dropdown {
  border: none !important;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Rotating arrow using modern transform */
.select2-container--open .select2-selection__arrow:after {
  transform: translateY(-50%) rotate(180deg);
}

/* --- Payment System List: Modern Logic --- */
.payment-system-list {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.payment-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-muted);
  border-left: 4px solid transparent;
  transition: var(--transition-smooth);
}

/* Logic for checked states using :has() - Modern Browser Support Required */
.payment-item:has(input:checked) {
  background-color: hsl(var(--main) / 0.05);
  border-left-color: var(--base-clr);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .cookies-card {
    inset: auto 0 0 0; /* Shorthand for bottom/left/right 0 */
    width: 100%;
    border-radius: 15px 15px 0 0;
  }
  
  .payment-item {
    padding: 10px;
    font-size: 0.9rem;
  }
}