.purchase-v2 {
  min-height: calc(100vh - 60px);
  background: #f5f7fb;
  color: #202633;
}

.purchase-v2 .container {
  max-width: 1400px;
}

.purchase-family-tabs {
  gap: 12px;
}

.purchase-family-tabs .nav-link {
  border: 1px solid #d8dee9;
  border-radius: 8px;
  color: #394150;
  font-weight: 700;
  padding: 13px 18px;
}

.purchase-family-tabs .nav-link.active {
  border-color: #0d6efd;
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.configuration-panel,
.order-panel {
  background: #fff;
  border: 1px solid #edf0f4;
  border-radius: 8px;
}

.configuration-panel {
  min-width: 0;
  padding: 34px 40px 8px;
}

.order-panel {
  position: sticky;
  top: 18px;
  padding: 34px 30px 30px;
}

.panel-title {
  margin: 0 0 24px;
  padding-left: 14px;
  border-left: 4px solid #0d6efd;
  font-size: 20px;
  font-weight: 700;
}

.configuration-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 26px;
  padding: 24px 0;
  border-bottom: 1px solid #edf0f4;
}

.configuration-label {
  padding-top: 13px;
  color: #5f6878;
  font-weight: 600;
}

.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.package-option,
.period-option {
  position: relative;
  min-width: 136px;
  min-height: 48px;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #fff;
  color: #202633;
  padding: 16px;
  text-align: left;
}

.package-option:disabled {
  border-color: #e3e7ed;
  background: #f7f8fa;
  color: #a2a9b4;
  cursor: not-allowed;
  box-shadow: none;
}

.package-option:not(:disabled):hover,
.package-option.active,
.period-option:hover,
.period-option.active {
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, .12);
}

.package-option.active,
.period-option.active {
  background: #f0f6ff;
}

.package-option small,
.period-option small {
  display: block;
  color: #6c757d;
  margin-top: 6px;
}

.discount-badge {
  position: absolute;
  z-index: 2;
  top: -12px;
  right: -4px;
  min-width: 50px;
  padding: 2px 7px;
  border-radius: 10px 10px 10px 0;
  background: #dc3545;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.pick-input-group {
  max-width: 300px;
}

.package-info {
  color: #687284;
  white-space: pre-line;
}

.quota-input-group {
  width: 280px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 32px;
  margin: 0;
  padding: 10px 0;
  list-style: none;
}

.feature-list li::before {
  content: "✓";
  margin-right: 8px;
  color: #0d6efd;
  font-weight: 700;
}

.period-row {
  border-bottom: 0;
}

.period-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 10px;
}

.order-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
}

.order-lines span {
  color: #687284;
}

.order-lines strong,
.order-lines del {
  text-align: right;
}

.discount-line strong {
  color: #dc3545;
}

.payable-line {
  margin-top: 10px;
  padding-top: 18px !important;
  border-top: 1px solid #edf0f4;
}

.payable-line strong {
  color: #dc3545;
  font-size: 30px;
}

.coupon-details {
  margin-top: 18px;
  border-top: 1px solid #edf0f4;
}

.coupon-details summary {
  padding: 16px 0 4px;
  color: #0d6efd;
  cursor: pointer;
  font-weight: 600;
}

.coupon-details[open] summary {
  padding-bottom: 12px;
}

.coupon-form {
  padding-bottom: 4px;
}

.balance-line {
  margin: 16px 0 0;
  color: #6c757d;
  text-align: right;
}

.mobile-purchase-bar {
  display: none;
}

@media (max-width: 980px) {
  .purchase-layout {
    grid-template-columns: 1fr;
  }

  .order-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  body {
    padding-bottom: 78px;
  }

  .purchase-v2 {
    padding-top: 24px !important;
  }

  .configuration-panel {
    padding: 24px 18px 4px;
  }

  .configuration-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 0;
  }

  .configuration-label {
    padding-top: 0;
  }

  .option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .package-option {
    min-width: 0;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .period-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-panel {
    padding: 24px 18px;
  }

  #purchase-submit {
    display: none;
  }

  .mobile-purchase-bar {
    position: fixed;
    z-index: 1030;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 14px;
    align-items: center;
    min-height: 68px;
    padding: 9px 12px;
    background: #fff;
    border-top: 1px solid #dfe4ec;
    box-shadow: 0 -6px 18px rgba(25, 36, 55, .08);
  }

  .mobile-purchase-bar div {
    display: flex;
    flex-direction: column;
  }

  .mobile-purchase-bar span {
    color: #6c757d;
    font-size: 12px;
  }

  .mobile-purchase-bar strong {
    color: #dc3545;
    font-size: 21px;
  }

  .quota-input-group {
    width: 100%;
  }

  #csFloat.cs-float {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
}
