@media (min-width: 48rem) {

  /* 769px */
  .popup-overlay {
    display: none !important;
  }
}

/* CSS apenas para mobile */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  /* Menos padding para caber na tela sem rolagem */
  padding: clamp(0.5rem, 2vh, 0.75rem) 0.75rem;
  box-sizing: border-box;
}

.popup-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-container {
  position: relative;
  width: 100%;
  /* Evita forçar altura grande; objetivo é caber na viewport */
  min-height: 0;
  background-color: #ffffff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.2);
  font-family: "Montserrat", sans-serif;
  /* Menos padding inferior: o CTA está no fluxo */
  padding-bottom: clamp(0.125rem, 0.75vh, 0.375rem);
}

.popup-cover-section {
  position: relative;
  width: 100%;
  /* Capa menor para liberar espaço ao CTA */
  height: clamp(7.25rem, 18vh, 9rem);
}

.popup-cover-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.popup-cover-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.popup-profile-info {
  position: absolute;
  /* Menos sobreposição para precisar de menos margem no conteúdo */
  bottom: clamp(-3.375rem, -9vh, -2.75rem);
  left: 1rem;
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  z-index: 2;
}

.popup-profile-image {
  width: clamp(3.75rem, 14vw, 4.5rem);
  height: clamp(3.75rem, 14vw, 4.5rem);
  border-radius: 50%;
  border: 0.25rem solid #ffffff;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
}

.popup-profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.popup-profile-text {
  padding-bottom: 0.5rem;
}

.popup-profile-name {
  font-size: clamp(0.875rem, 4vw, 1rem);
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.popup-verified {
  display: flex;
  align-items: center;
}

.popup-verified svg {
  width: clamp(1rem, 5vw, 1.125rem);
  height: clamp(1rem, 5vw, 1.125rem);
}

.popup-profile-username {
  font-size: clamp(0.75rem, 3.5vw, 0.875rem);
  color: #666;
  margin-top: 0.125rem;
}

.popup-stats {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  gap: 1rem;
  color: #ffffff;
  font-size: clamp(0.75rem, 3.5vw, 0.875rem);
  text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
}

.popup-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.popup-stats i {
  font-size: clamp(0.875rem, 4vw, 1rem);
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #ffffff;
  font-size: clamp(1rem, 5vw, 1.25rem);
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-active {
  overflow: hidden;
}

.popup-content {
  /* Aumentado para não sobrepor a foto/perfil */
  /* Reduzido novamente para subir o conteúdo e caber na tela */
  margin-top: clamp(2.75rem, 6.5vh, 3.25rem);
  padding: 1rem;
}

.popup-headline {
  padding: 0 1.25rem;
  /* Removido deslocamento negativo para descer o título */
  margin-top: 0;
}

.popup-headline h2 {
  font-size: clamp(0.9375rem, 4.5vw, 1.0625rem);
  font-weight: 700;
  color: #555555;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.popup-verification-items {
  padding: 0 1.25rem;
}

.verification-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.check-icon {
  width: clamp(0.9rem, 3vw, 0.9rem);
  height: clamp(0.9rem, 3vw, 0.9rem);
  background-color: #ff6b3d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-icon i {
  color: #ffffff;
  font-size: clamp(0.5rem, 2.5vw, 0.5625rem);
}

.verification-item span:last-child {
  font-size: clamp(0.875rem, 4vw, 1rem);
  color: #424242;
}

.popup-additional-headline {
  text-align: center;
  margin: 1.25rem 0 0.9375rem;
  width: 110%;
  transform: translateX(-5%);
  margin-left: auto;
  margin-right: auto;
}

.popup-additional-headline h3 {
  font-size: clamp(0.75rem, 3.5vw, 0.875rem);
  font-weight: 600;
  color: #555;
  line-height: 1.4;
}

.subscription-button-popup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  width: calc(100% - 1.875rem);
  /* Coloca o botão no fluxo logo abaixo do h3 */
  margin: 0.5rem auto 0.125rem;
  border: none;
  border-radius: 9999px;
  background: linear-gradient(to right, #f58370, #f5a55b);
  color: #ffffff;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
  transition: opacity 0.2s;
  will-change: opacity;
  /* Removida a posição absoluta para ficar logo após o h3 */
  position: static;
}

.subscription-button-popup:hover {
  opacity: 0.9;
}

.subscription-button-popup span {
  font-size: clamp(1.125rem, 5vw, 1.3125rem);
}

.payment-trust {
  /* Entra no fluxo abaixo do botão */
  position: static;
  margin-top: 0.375rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.trust-item i {
  color: #ff6b3d;
  font-size: clamp(0.625rem, 3vw, 0.75rem);
}

.trust-item span {
  color: #666;
  font-size: clamp(0.6rem, 2.6vw, 0.656rem);
  font-weight: 500;
  white-space: nowrap;
}

.popup-overlay.active .popup-container {
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-1.25rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* iPhone X, XS, 11 Pro, 12 Mini, 13 Mini */
@media screen and (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
  .popup-container {
    min-height: 0;
  }

  .popup-cover-section {
    height: clamp(10rem, 28vh, 12.5rem);
  }

  .popup-content {
    /* Acompanha o perfil um pouco mais baixo */
    margin-top: clamp(2.5rem, 6vh, 3rem);
  }

  .popup-headline h2 {
    font-size: clamp(1rem, 4.2vw, 1.125rem);
    margin-bottom: 1rem;
  }

  .verification-item {
    margin-bottom: 0.5rem;
    gap: 0.75rem;
  }

  .verification-item span:last-child {
    font-size: clamp(0.875rem, 3.8vw, 1rem);
  }

  .popup-additional-headline h3 {
    font-size: clamp(0.75rem, 3.5vw, 0.875rem);
  }
}

/* iPhone 11, XR */
@media screen and (device-width: 414px) and (device-height: 896px) and (-webkit-min-device-pixel-ratio: 2) {
  .popup-container {
    min-height: 0;
  }

  .popup-cover-section {
    height: clamp(10rem, 22vh, 11rem);
  }

  .popup-content {
    margin-top: clamp(2.5rem, 6vh, 3rem);
  }

  .popup-headline h2 {
    font-size: clamp(1.125rem, 4.5vw, 1.25rem);
    margin-bottom: 0.75rem;
    line-height: 1.3;
  }

  .verification-item {
    margin-bottom: 0.5rem;
    gap: 0.625rem;
  }

  .verification-item span:last-child {
    font-size: clamp(1rem, 4.2vw, 1.125rem);
  }

  .popup-additional-headline h3 {
    font-size: clamp(0.875rem, 4vw, 1rem);
    line-height: 1.3;
  }
}

/* iPhone 12 Pro, 13 Pro, 14 Pro */
@media screen and (device-width: 390px) and (device-height: 844px) and (-webkit-min-device-pixel-ratio: 3) {
  .popup-container {
    min-height: 0;
  }

  .popup-cover-section {
    height: clamp(10rem, 22vh, 11rem);
  }

  .popup-content {
    margin-top: clamp(2.5rem, 6vh, 3rem);
  }

  .popup-headline h2 {
    font-size: clamp(1.125rem, 4.5vw, 1.25rem);
    margin-bottom: 0.75rem;
    line-height: 1.3;
  }

  .verification-item {
    margin-bottom: 0.5rem;
    gap: 0.625rem;
  }

  .verification-item span:last-child {
    font-size: clamp(1rem, 4.2vw, 1.125rem);
  }

  .popup-additional-headline h3 {
    font-size: clamp(0.875rem, 4vw, 1rem);
    line-height: 1.3;
  }
}

/* iPhone 12 Pro Max, 13 Pro Max, 14 Pro Max */
@media screen and (device-width: 428px) and (device-height: 926px) and (-webkit-min-device-pixel-ratio: 3) {
  .popup-container {
    min-height: 0;
  }

  .popup-cover-section {
    height: clamp(10rem, 22vh, 11rem);
  }

  .popup-content {
    margin-top: clamp(2.5rem, 6vh, 3rem);
  }

  .popup-headline h2 {
    font-size: clamp(1.125rem, 4.5vw, 1.25rem);
    margin-bottom: 0.75rem;
    line-height: 1.3;
  }

  .verification-item {
    margin-bottom: 0.5rem;
    gap: 0.625rem;
  }

  .verification-item span:last-child {
    font-size: clamp(1rem, 4.2vw, 1.125rem);
  }

  .popup-additional-headline h3 {
    font-size: clamp(0.875rem, 4vw, 1rem);
    line-height: 1.3;
  }
}

/* Payment Popup specific styles */
.payment-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  /* Darker overlay */
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.payment-popup-overlay.active {
  display: flex !important;
}

.payment-popup-container {
  background: #000000;
  color: #ffffff;
  width: 100%;
  max-width: 380px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  font-family: 'Montserrat', sans-serif;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
  /* Fix overflow issues */
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.pay-header {
  position: relative;
  padding: 10px 15px;
  text-align: center;
  background: linear-gradient(to bottom, rgba(255, 107, 61, 0.1), transparent);
}

.pay-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  opacity: 0.7;
}

.pay-profile-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid #ff6b3d;
  /* Brand color */
  object-fit: cover;
  margin: 0 auto 10px;
  display: block;
}

.pay-user-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.pay-user-info p {
  margin: 2px 0 0;
  color: #888;
  font-size: 13px;
}

.pay-benefits {
  padding: 0 20px;
  margin-bottom: 10px;
}

.pay-benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #ccc;
  margin-bottom: 4px;
}

.pay-benefit-item i {
  color: #ff6b3d;
}

.pay-body {
  padding: 0 20px 15px;
  /* Reduced bottom padding */
}

.pay-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 5px;
}

.pay-value-lg {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
}

.pay-pix-container {
  background: #0f0f0f;
  /* Darker background */
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #333;
}

.pay-pix-code {
  background: transparent;
  border: none;
  color: #fff;
  width: 100%;
  font-family: monospace;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px;
  outline: none;
}

.pay-btn-copy {
  width: 100%;
  padding: 10px;
  border-radius: 999px;
  border: none;
  background: #ffbca8;
  /* Light pastel orange from image */
  color: #000;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 15px;
  transition: transform 0.1s;
}

.pay-btn-copy:active {
  transform: scale(0.98);
}

.pay-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-option-btn {
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  color: #000;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pay-option-btn.picpay {
  background: #fff;
  /* Or specific PicPay color if needed */
}

/* Recharge Toggle */
.pay-recharge-row {
  background: #1f1f1f;
  border-radius: 999px;
  padding: 6px 6px 6px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.pay-recharge-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #ccc;
}

.pay-recharge-label i {
  color: #ffca28;
}

/* Gold/Orange wallet icon */

.pay-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.pay-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pay-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: .4s;
  border-radius: 34px;
}

.pay-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.pay-slider {
  background-color: #ff6b3d;
}


input:checked+.pay-slider:before {
  transform: translateX(20px);
}

/* New Recharge Button Design */
.pay-recharge-btn-wrapper {
  position: relative;
  margin-top: 25px;
  width: 100%;
}

.pay-recharge-badge {
  position: absolute;
  top: -10px;
  left: 20px;
  background-color: #ff7b29;
  /* Orange matching image */
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pay-recharge-trigger-btn {
  width: 100%;
  background-color: #2d2d2d;
  /* Dark grey pill */
  border: none;
  padding: 16px;
  border-radius: 30px;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.pay-recharge-trigger-btn:hover {
  background-color: #3d3d3d;
}

/* Credit Card Form Styles */
.card-form {
  margin-top: 5px;
  /* Reduced from 20px */
  text-align: left;
}

.form-group {
  margin-bottom: 10px;
  /* Reduced from 15px */
}

.form-group label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #ccc;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  background: #0f0f0f;
  /* Darker background */
  border: 1px solid #333;
  border-radius: 999px;
  /* Pill shape inputs */
  display: flex;
  align-items: center;
  padding: 0 15px;
  height: 34px;
  /* Reduced from 44px */
}

.input-wrapper:focus-within {
  border-color: #ff6b3d;
  /* Orange focus */
}

.input-wrapper i {
  color: #888;
  margin-right: 10px;
  font-size: 14px;
}

.input-wrapper input {
  background: transparent;
  border: none;
  color: #fff;
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  outline: none;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row .form-group {
  flex: 1;
}

.subscription-info {
  font-size: 11px;
  color: #ccc;
  margin-top: 2px;
  /* Reduced from 5px */
  line-height: 1.3;
  display: flex;
  align-items: flex-start;
}

/* Recharge Popup Styles */
/* ... existing recharge popup styles ... */
.recharge-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 10001;
  /* Above payment popup */
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.recharge-popup-overlay.active {
  display: flex !important;
}

.recharge-container {
  width: 100%;
  max-width: 420px;
  background: #000;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  border-radius: 20px;
  /* Rounded corners like main popup */
  position: relative;
  display: flex;
  flex-direction: column;
  height: auto;
  /* Allow auto height */
  max-height: 90vh;
  /* Limit to viewport height */
  overflow-y: auto;
  /* Scroll if content overflows */
  padding-bottom: 20px;
  /* Bottom spacing */
}

/* Header */
.recharge-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.recharge-back-btn {
  position: absolute;
  left: 10px;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 10px;
}

.recharge-title {
  font-size: 16px;
  font-weight: 600;
  color: #e5e5e5;
}

/* Main Display */
.recharge-value-display {
  text-align: center;
  margin: 40px 0 20px;
}

.recharge-amount {
  font-size: 36px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.recharge-control-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff6b3d;
  border: none;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Slider */
.recharge-slider-container {
  padding: 0 20px;
  margin-bottom: 40px;
}

input[type=range].recharge-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range].recharge-slider:focus {
  outline: none;
}

/* Track */
input[type=range].recharge-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: #333;
  border-radius: 2px;
}

/* Thumb */
input[type=range].recharge-slider::-webkit-slider-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #ff6b3d;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  box-shadow: 0 0 0 2px #000;
}

/* Summary Section */
.recharge-summary-title {
  padding: 0 20px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 15px;
  color: #fff;
}

.recharge-summary-list {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #ccc;
  border-bottom: 1px solid #222;
  padding-bottom: 10px;
}

.summary-row.final {
  border-bottom: none;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  margin-top: 10px;
}

.bonus-text {
  color: #4ade80;
  font-weight: 700;
}

/* Footer Button */
.recharge-footer {
  margin-top: auto;
  padding: 20px;
}

.recharge-btn-continue {
  width: 100%;
  padding: 16px;
  background: #ff6b3d;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.recharge-btn-continue:hover {
  opacity: 0.9;
}

#recharge-state-pix {
  padding: 20px 30px;
  /* Increased side padding */
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 15px;
  /* Spacing */
  /* text-align: center; Removed to allow inputs to behave normally */
}

#recharge-state-pix .pay-pix-container,
#recharge-state-pix .pay-btn-copy,
#recharge-state-pix .pay-option-btn {
  width: 100%;
  margin-bottom: 0;
}