/* ═══════════════════════════════════════════════════════════
   PRODUCTS PAGE ENHANCEMENTS
   Improved plan cards, billing toggles, and responsive layout
   ═══════════════════════════════════════════════════════════ */

/* Enhanced pricing toolbar */
.pricing-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

/* Segment control improvements */
.segment-control {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.segment-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(158, 176, 209, 0.9);
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.25s ease;
  cursor: pointer;
  white-space: nowrap;
  min-height: 48px;
}

.segment-chip:hover {
  color: #edf3ff;
  border-color: rgba(94, 163, 255, 0.25);
  background: rgba(94, 163, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(47, 125, 240, 0.12);
}

.segment-chip.active {
  color: #ffffff;
  border-color: rgba(94, 163, 255, 0.45);
  background: linear-gradient(135deg, rgba(47, 125, 240, 0.28), rgba(94, 163, 255, 0.18));
  box-shadow: 
    0 12px 28px rgba(47, 125, 240, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Billing switch improvements */
.billing-switch {
  display: flex;
  padding: 6px;
  border-radius: 999px;
  width: fit-content;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
}

.billing-switch-option {
  border: 0;
  min-width: 100px;
  padding: 11px 20px;
  border-radius: 999px;
  background: transparent;
  color: rgba(158, 176, 209, 0.85);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.billing-switch-option:hover {
  color: #edf3ff;
  background: rgba(255, 255, 255, 0.05);
}

.billing-switch-option.active {
  background: linear-gradient(135deg, #5ea3ff, #2f7df0);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(47, 125, 240, 0.28);
  transform: scale(1.02);
}

/* Enhanced pricing grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 26px;
  align-items: stretch;
  margin-top: 32px;
}

/* Enhanced pricing cards */
.pricing-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  border-radius: 28px;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(19, 31, 56, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.32);
  border-color: rgba(94, 163, 255, 0.2);
}

.pricing-card.featured {
  transform: translateY(-10px) scale(1.015);
  border-color: rgba(94, 163, 255, 0.4);
  background:
    linear-gradient(160deg, rgba(94, 163, 255, 0.2), rgba(68, 215, 182, 0.08) 45%, rgba(255, 255, 255, 0.04)),
    rgba(19, 31, 56, 0.96);
  box-shadow: 
    0 20px 52px rgba(27, 97, 212, 0.28), 
    0 0 0 1px rgba(94, 163, 255, 0.22);
}

.pricing-card.featured:hover {
  transform: translateY(-14px) scale(1.02);
  box-shadow: 0 26px 60px rgba(27, 97, 212, 0.35);
}

/* Pricing card header */
.pricing-card-head {
  display: grid;
  gap: 14px;
}

.pricing-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(158, 176, 209, 0.9);
  font-size: 0.85rem;
  font-weight: 600;
}

.pill-primary {
  border-color: rgba(94, 163, 255, 0.25);
  background: rgba(94, 163, 255, 0.12);
  color: #b8d4ff;
}

.spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 199, 107, 0.3), rgba(255, 126, 148, 0.2));
  color: #ffe8c0;
  border: 1px solid rgba(255, 199, 107, 0.25);
  font-size: 0.85rem;
  font-weight: 700;
}

.always-on-badge {
  background: linear-gradient(135deg, rgba(68, 215, 182, 0.3), rgba(94, 163, 255, 0.2));
  color: #e0fcf4;
  border-color: rgba(68, 215, 182, 0.28);
}

.pricing-card-head h2 {
  margin: 4px 0 0 0;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  color: #edf3ff;
}

.pricing-card-head p {
  margin: 0;
  color: rgba(158, 176, 209, 0.9);
  font-size: 0.95rem;
  line-height: 1.7;
}

.pricing-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.pricing-meta-row span {
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.88rem;
  color: rgba(158, 176, 209, 0.85);
}

/* Price stack improvements */
.price-stack {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pricing-card.featured .price-stack {
  background: rgba(94, 163, 255, 0.08);
  border-color: rgba(94, 163, 255, 0.15);
}

/* Card billing toggle */
.card-billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  margin: 0 auto 6px;
  width: 100%;
  max-width: 280px;
}

.card-billing-toggle .toggle-label {
  font-size: 0.87rem;
  color: rgba(158, 176, 209, 0.75);
  font-weight: 600;
  transition: color 0.25s ease;
  cursor: pointer;
  user-select: none;
}

.card-billing-toggle .toggle-label.active-label {
  color: #edf3ff;
  font-weight: 700;
}

.card-billing-toggle .toggle-track {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.card-billing-toggle .toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5ea3ff, #2f7df0);
  box-shadow: 0 3px 10px rgba(47, 125, 240, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-billing-toggle .toggle-track.yearly::after {
  inset-inline-start: 27px;
  background: linear-gradient(135deg, #44d7b6, #34b89a);
  box-shadow: 0 3px 10px rgba(68, 215, 182, 0.35);
}

.card-billing-toggle .toggle-track.yearly {
  background: rgba(68, 215, 182, 0.2);
  border-color: rgba(68, 215, 182, 0.3);
}

/* Price display */
.price-prefix {
  color: rgba(158, 176, 209, 0.8);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.price-display {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.price-currency,
.price-cycle {
  color: rgba(158, 176, 209, 0.75);
  font-size: 1.05rem;
  font-weight: 500;
}

.price-amount {
  font-size: 2rem;
  font-weight: 800;
  color: #edf3ff;
  line-height: 1;
}

.price-note {
  font-size: 0.86rem;
  color: rgba(158, 176, 209, 0.75);
  line-height: 1.75;
}

/* Resource grid */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.resource-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.resource-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.resource-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #edf3ff;
}

.resource-item span {
  font-size: 0.92rem;
  color: rgba(158, 176, 209, 0.85);
  line-height: 1.5;
}

/* Benefit strip */
.benefit-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.benefit-chip {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(158, 176, 209, 0.75);
  font-size: 0.88rem;
  font-weight: 500;
}

.benefit-chip.active {
  color: #e0fcf4;
  border-color: rgba(68, 215, 182, 0.22);
  background: rgba(68, 215, 182, 0.1);
}

/* Card CTA */
.card-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 10px;
}

.card-cta .btn {
  width: 100%;
  min-height: 50px;
  font-size: 0.96rem;
  font-weight: 700;
  border-radius: 16px;
  transition: all 0.25s ease;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #edf3ff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #5ea3ff, #2f7df0);
  border: 0;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(47, 125, 240, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2f7df0, #1b61d4);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(47, 125, 240, 0.4);
}

.pricing-card.featured .btn-primary {
  box-shadow: 0 14px 32px rgba(47, 125, 240, 0.38);
}

/* Responsive improvements */
@media (max-width: 1024px) {
  .pricing-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 24px;
  }

  .pricing-card {
    padding: 26px;
  }

  .pricing-card.featured {
    transform: translateY(-6px) scale(1.01);
  }
}

@media (max-width: 768px) {
  .pricing-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .segment-control {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .segment-chip {
    flex-shrink: 0;
    padding: 12px 18px;
  }

  .billing-switch {
    width: 100%;
    justify-content: center;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .pricing-card {
    padding: 24px;
    gap: 18px;
  }

  .pricing-card.featured {
    transform: translateY(0) scale(1);
  }

  .pricing-card:hover,
  .pricing-card.featured:hover {
    transform: translateY(-4px);
  }

  .resource-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .price-stack {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .pricing-card {
    padding: 20px;
    gap: 16px;
    border-radius: 24px;
  }

  .pricing-card-head h2 {
    font-size: 1.4rem;
  }

  .segment-chip {
    padding: 11px 16px;
    font-size: 0.88rem;
  }

  .billing-switch-option {
    min-width: 90px;
    padding: 10px 16px;
    font-size: 0.87rem;
  }

  .price-amount {
    font-size: 1.75rem;
  }

  .resource-item {
    padding: 13px;
  }

  .card-cta .btn {
    min-height: 48px;
    font-size: 0.94rem;
  }
}
