/**
 * YBÁ Market Pro - Quick Checkout Styles
 * 
 * Premium popup checkout for Clube YBÁ subscription.
 * 
 * @package YBA_Market_Pro
 * @since 2.3.0
 */

/* ============================================
   CSS Variables (inherits from frontend.css)
   ============================================ */
:root {
  --yba-qc-primary: #89b864;
  --yba-qc-primary-dark: #7ab055;
  --yba-qc-primary-light: #a8d087;
  --yba-qc-gradient: linear-gradient(135deg, #89b864 0%, #7ab055 100%);
  --yba-qc-text: #2d3748;
  --yba-qc-text-light: #718096;
  --yba-qc-border: #e2e8f0;
  --yba-qc-bg: #ffffff;
  --yba-qc-overlay: rgba(0, 0, 0, 0.6);
  --yba-qc-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --yba-qc-radius: 16px;
  --yba-qc-radius-sm: 10px;
  --yba-qc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   CTA Button
   ============================================ */
.yba-quick-checkout-wrapper {
  display: block;
  width: 100%;
}

.yba-qc-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: #ffffff;
  color: var(--yba-qc-primary);
  border: none;
  padding: 18px 32px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--yba-qc-transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.yba-qc-btn__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.yba-qc-btn__arrow svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.yba-qc-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.yba-qc-btn:hover::before {
  left: 100%;
}

.yba-qc-btn:hover {
  background: #e6a816;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(230, 168, 22, 0.5);
}

.yba-qc-btn:hover .yba-qc-btn__arrow {
  transform: translateX(4px);
}

.yba-qc-btn:active {
  transform: translateY(0);
}

.yba-qc-btn__text {
  font-size: 15px;
}

.yba-qc-btn__price {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 500;
}

.yba-qc-expiration {
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--yba-qc-primary-dark);
  font-weight: 500;
}

/* ============================================
   Overlay
   ============================================ */
.yba-qc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--yba-qc-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.yba-qc-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Modal
   ============================================ */
.yba-qc-modal {
  background: var(--yba-qc-bg);
  border-radius: var(--yba-qc-radius);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--yba-qc-shadow);
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.yba-qc-overlay.active .yba-qc-modal {
  transform: scale(1) translateY(0);
}

/* Scrollbar styling */
.yba-qc-modal::-webkit-scrollbar {
  width: 6px;
}

.yba-qc-modal::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.yba-qc-modal::-webkit-scrollbar-thumb {
  background: var(--yba-qc-primary-light);
  border-radius: 3px;
}

/* ============================================
   Close Button
   ============================================ */
.yba-qc-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f7fafc;
  border-radius: 50%;
  font-size: 20px;
  color: var(--yba-qc-text-light);
  cursor: pointer;
  transition: var(--yba-qc-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.yba-qc-close:hover {
  background: #edf2f7;
  color: var(--yba-qc-text);
  transform: rotate(90deg);
}

/* ============================================
   Header
   ============================================ */
.yba-qc-header {
  text-align: center;
  padding: 28px 24px 16px;
  border-bottom: 1px solid var(--yba-qc-border);
}

.yba-qc-logo {
  font-size: 40px;
  margin-bottom: 8px;
  animation: yba-qc-bounce 2s infinite;
}

@keyframes yba-qc-bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

.yba-qc-title {
  color: var(--yba-qc-primary-dark);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.yba-qc-subtitle {
  color: var(--yba-qc-text-light);
  font-size: 14px;
  margin: 0;
}

/* ============================================
   Price Box
   ============================================ */
.yba-qc-price-box {
  background: linear-gradient(135deg, #fafff7 0%, #f0f8e8 100%);
  padding: 16px 24px;
  text-align: center;
  border-bottom: 1px solid var(--yba-qc-border);
}

.yba-qc-price-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--yba-qc-primary-dark);
}

.yba-qc-price-period {
  font-size: 16px;
  color: var(--yba-qc-text-light);
  font-weight: 500;
}

/* ============================================
   Form
   ============================================ */
.yba-qc-form {
  padding: 24px;
}

.yba-qc-field {
  margin-bottom: 16px;
}

.yba-qc-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--yba-qc-text);
  margin-bottom: 6px;
}

.yba-qc-field input[type="text"],
.yba-qc-field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--yba-qc-border);
  border-radius: var(--yba-qc-radius-sm);
  font-size: 15px;
  color: var(--yba-qc-text);
  transition: var(--yba-qc-transition);
  box-sizing: border-box;
}

.yba-qc-field input:focus {
  outline: none;
  border-color: var(--yba-qc-primary);
  box-shadow: 0 0 0 3px rgba(137, 184, 100, 0.15);
}

.yba-qc-field input::placeholder {
  color: #a0aec0;
}

.yba-qc-field-row {
  display: flex;
  gap: 12px;
}

.yba-qc-field-row .yba-qc-field {
  flex: 1;
}

/* User Info (logged in) */
.yba-qc-user-info {
  background: linear-gradient(135deg, #fafff7 0%, #f0f8e8 100%);
  padding: 16px;
  border-radius: var(--yba-qc-radius-sm);
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid var(--yba-qc-primary-light);
}

.yba-qc-user-info p {
  margin: 0 0 4px 0;
  font-weight: 600;
  color: var(--yba-qc-primary-dark);
  font-size: 16px;
}

.yba-qc-user-info small {
  color: var(--yba-qc-text-light);
  font-size: 13px;
}

/* ============================================
   Payment Methods
   ============================================ */
.yba-qc-payment-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.yba-qc-payment-option {
  display: block;
  cursor: pointer;
}

.yba-qc-payment-option input[type="radio"] {
  display: none;
}

.yba-qc-payment-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--yba-qc-border);
  border-radius: var(--yba-qc-radius-sm);
  transition: var(--yba-qc-transition);
  background: white;
}

.yba-qc-payment-option input:checked + .yba-qc-payment-label {
  border-color: var(--yba-qc-primary);
  background: linear-gradient(135deg, #fafff7 0%, #f0f8e8 100%);
  box-shadow: 0 0 0 3px rgba(137, 184, 100, 0.15);
}

.yba-qc-payment-label:hover {
  border-color: var(--yba-qc-primary-light);
}

.yba-qc-payment-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.yba-qc-payment-name {
  font-weight: 600;
  color: var(--yba-qc-text);
  font-size: 15px;
  flex-grow: 1;
}

.yba-qc-payment-desc {
  font-size: 12px;
  color: var(--yba-qc-text-light);
}

/* ============================================
   Card Fields
   ============================================ */
.yba-qc-card-fields {
  margin-bottom: 20px;
  padding: 16px;
  background: #f7fafc;
  border-radius: var(--yba-qc-radius-sm);
  animation: yba-qc-slideDown 0.3s ease;
}

@keyframes yba-qc-slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Submit Button
   ============================================ */
.yba-qc-submit {
  width: 100%;
  padding: 16px 24px;
  background: var(--yba-qc-gradient);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--yba-qc-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.yba-qc-submit:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(137, 184, 100, 0.5);
  transform: translateY(-2px);
}

.yba-qc-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Spinner */
.yba-qc-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: yba-qc-spin 0.8s linear infinite;
}

@keyframes yba-qc-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   Security Badge
   ============================================ */
.yba-qc-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--yba-qc-text-light);
}

/* ============================================
   Result Messages
   ============================================ */
.yba-qc-result {
  padding: 24px;
  text-align: center;
}

.yba-qc-result.success {
  color: var(--yba-qc-primary-dark);
}

.yba-qc-result.error {
  color: #e53e3e;
}

.yba-qc-result__icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.yba-qc-result__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.yba-qc-result__message {
  font-size: 14px;
  color: var(--yba-qc-text-light);
  margin: 0 0 20px 0;
}

.yba-qc-result__expiration {
  background: linear-gradient(135deg, #fafff7 0%, #f0f8e8 100%);
  padding: 12px 16px;
  border-radius: var(--yba-qc-radius-sm);
  font-weight: 600;
  color: var(--yba-qc-primary-dark);
  margin-bottom: 20px;
  display: inline-block;
}

.yba-qc-result__btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--yba-qc-gradient);
  color: white !important;
  text-decoration: none !important;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  transition: var(--yba-qc-transition);
}

.yba-qc-result__btn:hover {
  box-shadow: 0 4px 15px rgba(137, 184, 100, 0.4);
}

/* Pix QR Code */
.yba-qc-pix-code {
  background: #f7fafc;
  padding: 16px;
  border-radius: var(--yba-qc-radius-sm);
  margin-bottom: 16px;
}

.yba-qc-pix-code img {
  max-width: 200px;
  margin: 0 auto;
  display: block;
}

.yba-qc-pix-copy {
  margin-top: 12px;
}

.yba-qc-pix-copy input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--yba-qc-border);
  border-radius: 8px;
  font-size: 11px;
  font-family: monospace;
  text-align: center;
}

.yba-qc-pix-copy button {
  margin-top: 8px;
  padding: 8px 16px;
  background: var(--yba-qc-primary);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--yba-qc-transition);
}

.yba-qc-pix-copy button:hover {
  background: var(--yba-qc-primary-dark);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
  .yba-qc-overlay {
    padding: 12px;
  }

  .yba-qc-modal {
    max-height: 95vh;
    border-radius: var(--yba-qc-radius-sm);
  }

  .yba-qc-header {
    padding: 24px 20px 14px;
  }

  .yba-qc-logo {
    font-size: 32px;
  }

  .yba-qc-title {
    font-size: 20px;
  }

  .yba-qc-price-value {
    font-size: 28px;
  }

  .yba-qc-form {
    padding: 20px;
  }

  .yba-qc-field-row {
    flex-direction: column;
    gap: 0;
  }

  .yba-qc-payment-label {
    flex-wrap: wrap;
  }

  .yba-qc-payment-desc {
    flex-basis: 100%;
    margin-left: 36px;
    margin-top: 4px;
  }
}

/* ============================================
   Animation Preferences
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .yba-qc-overlay,
  .yba-qc-modal,
  .yba-qc-btn,
  .yba-qc-close,
  .yba-qc-submit {
    transition: none;
  }

  .yba-qc-logo {
    animation: none;
  }

  .yba-qc-spinner {
    animation: none;
  }

  .yba-qc-btn::before {
    display: none;
  }
}

/* ============================================
   PIX Payment Display (Direct API)
   ============================================ */
.yba-qc-pix-container {
  padding: 24px;
  text-align: center;
}

.yba-qc-pix-header {
  margin-bottom: 20px;
}

.yba-qc-pix-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.yba-qc-pix-header h3 {
  color: var(--yba-qc-text);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.yba-qc-pix-qr {
  background: white;
  padding: 20px;
  border-radius: var(--yba-qc-radius-sm);
  border: 2px dashed var(--yba-qc-primary-light);
  margin-bottom: 20px;
  display: inline-block;
}

.yba-qc-pix-qr img {
  max-width: 200px;
  width: 100%;
  height: auto;
}

.yba-qc-pix-copy {
  margin-bottom: 24px;
}

.yba-qc-pix-copy label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--yba-qc-text-light);
  margin-bottom: 8px;
}

.yba-qc-pix-copy textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--yba-qc-border);
  border-radius: var(--yba-qc-radius-sm);
  font-size: 10px;
  font-family: monospace;
  text-align: center;
  resize: none;
  height: 60px;
  color: var(--yba-qc-text);
  background: #f7fafc;
}

.yba-qc-copy-btn {
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--yba-qc-primary);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--yba-qc-transition);
}

.yba-qc-copy-btn:hover {
  background: var(--yba-qc-primary-dark);
  transform: translateY(-2px);
}

.yba-qc-pix-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fafff7 0%, #f0f8e8 100%);
  border-radius: var(--yba-qc-radius-sm);
  font-size: 14px;
  color: var(--yba-qc-primary-dark);
  font-weight: 500;
}

.yba-qc-pix-status .yba-qc-spinner {
  width: 16px;
  height: 16px;
  border-color: rgba(137, 184, 100, 0.3);
  border-top-color: var(--yba-qc-primary);
}

/* ============================================
   Success State
   ============================================ */
.yba-qc-success {
  padding: 16px 0;
}

.yba-qc-success-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: yba-qc-bounce 1s ease-out;
}

.yba-qc-success h3 {
  color: var(--yba-qc-primary-dark);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.yba-qc-success p {
  color: var(--yba-qc-text-light);
  font-size: 14px;
  margin: 0 0 20px 0;
}

.yba-qc-expiration-box {
  background: linear-gradient(135deg, #fafff7 0%, #f0f8e8 100%);
  padding: 16px 20px;
  border-radius: var(--yba-qc-radius-sm);
  font-size: 14px;
  color: var(--yba-qc-primary-dark);
  margin-bottom: 20px;
  border: 1px solid var(--yba-qc-primary-light);
}

.yba-qc-done-btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--yba-qc-gradient);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--yba-qc-transition);
}

.yba-qc-done-btn:hover {
  box-shadow: 0 8px 25px rgba(137, 184, 100, 0.5);
  transform: translateY(-2px);
}

/* Error field state */
.yba-qc-field input.error {
  border-color: #e53e3e;
  background: #fff5f5;
}
