/* Styles for the enhanced Pix payment display */
/* The outer container uses a neutral background and subtle border that
   contrasts on both light and dark themes. */
.bestfy-pix-wrapper {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid #e5e5e5;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  /* Always use a white background so the panel is consistent on dark themes */
  background: #ffffff;
  /* Dark text for readability */
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.bestfy-pix-instructions {
  flex: 1 1 250px;
  padding-right: 1rem;
  min-width: 200px;
}

.bestfy-pix-instructions .bestfy-steps {
  list-style: none;
  counter-reset: bestfystep;
  padding-left: 0;
  margin-top: 1rem;
}

.bestfy-pix-instructions .bestfy-steps li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 2rem;
  line-height: 1.4;
  /* Ensure text uses dark color to contrast against white background */
  color: #333;
}

/* Step numbers use the primary Pix green (#1fad7b) */
.bestfy-pix-instructions .bestfy-steps li:before {
  counter-increment: bestfystep;
  content: counter(bestfystep);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1.5rem;
  border-radius: 50%;
  background: #1fad7b;
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
}

.bestfy-pix-qr {
  flex: 1 1 250px;
  padding-left: 1rem;
  min-width: 200px;
  text-align: center;
  color: #333;
}

.bestfy-pix-qr img {
  max-width: 100%;
  height: auto;
  margin-bottom: 0.5rem;
}

/* Link styling within the Pix panel */
.bestfy-pix-wrapper a {
  color: #1fad7b;
  text-decoration: underline;
}
.bestfy-pix-wrapper a:hover {
  color: #158a58;
}

.bestfy-pix-qr .bestfy-amount {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #333;
}

.bestfy-pix-code {
  display: flex;
  margin-top: 0.5rem;
}

.bestfy-pix-code input {
  flex-grow: 1;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 4px 0 0 4px;
  font-size: 0.8rem;
  overflow-x: auto;
  /* dark text and light background for accessibility */
  color: #333;
  background: #f9f9f9;
}

/* Copy button styling using Pix green */
.bestfy-pix-code button {
  border: 1px solid #1fad7b;
  background: #1fad7b;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s ease;
}

/* Highlight the Pix payment method label on the checkout page. Use broader
   selectors to accommodate different theme structures. */
.woocommerce-checkout #payment .payment_methods .payment_method_bestfy_pix > label,
.woocommerce-checkout #payment .payment_methods .payment_method_bestfy_pix label {
  color: #1fad7b;
  font-weight: 600;
}

/* Optional styling for the Pix payment method wrapper to make it stand out.
   These rules add a border and padding similar to popular gateways. They are
   kept minimal to avoid clashing with theme styles. */
.woocommerce-checkout #payment .payment_methods .payment_method_bestfy_pix {
  border: 1px solid #1fad7b;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.woocommerce-checkout #payment .payment_methods .payment_method_bestfy_pix input[type="radio"] {
  margin-right: 0.5rem;
}
.woocommerce-checkout #payment .payment_methods .payment_method_bestfy_pix:hover {
  background-color: rgba(31, 173, 123, 0.05);
}
.bestfy-pix-code button:active,
.bestfy-pix-code button:focus {
  background: #158a58;
  outline: none;
}

/* Styles for the boleto payment panel */
.bestfy-boleto-wrapper {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid #e5e5e5;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  background: #ffffff;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.bestfy-boleto-info {
  flex: 1 1 250px;
  padding-right: 1rem;
  min-width: 200px;
}
.bestfy-boleto-info h3 {
  margin-top: 0;
  color: #333;
}
.bestfy-boleto-info .bestfy-steps {
  list-style: none;
  counter-reset: bestfystep;
  padding-left: 0;
  margin-top: 1rem;
}
.bestfy-boleto-info .bestfy-steps li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 2rem;
  line-height: 1.4;
  color: #333;
}
.bestfy-boleto-info .bestfy-steps li:before {
  counter-increment: bestfystep;
  content: counter(bestfystep);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1.5rem;
  border-radius: 50%;
  background: #1fad7b;
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
}
.bestfy-boleto-button {
  display: inline-block;
  border: 1px solid #1fad7b;
  background: #1fad7b;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s ease;
  margin-top: 1rem;
  display: inline-block;
}
.bestfy-boleto-button:hover {
  background: #158a58;
  color: #fff;
}
.bestfy-boleto-line {
  flex: 1 1 250px;
  padding-left: 1rem;
  min-width: 200px;
}