/* ============================
   BYNET PIX CHECKOUT v2 - PREMIUM
   ============================ */

:root {
    --gummy-pink: #e5187e;
    --gummy-pink-light: #ffecf5;
    --gummy-pink-hover: #c9146b;
    --gummy-pink-soft: #fff5f9;
    --gummy-dark: #2f2f5f;
    --gummy-text: #232323;
    --gummy-gray: #717171;
    --gummy-light-gray: #aaa;
    --gummy-border: #e0e0e0;
    --gummy-bg: #ffffff;
    --gummy-bg-light: #fafafa;
    --gummy-green: #16a34a;
    --gummy-green-light: #dcfce7;
    --gummy-radius: 12px;
    --gummy-radius-lg: 16px;
}

/* Hide default WooCommerce elements */
.woocommerce-checkout .entry-title,
.woocommerce-checkout .page-title,
.woocommerce-checkout #secondary,
.woocommerce-checkout .woocommerce-breadcrumb,
.woocommerce-checkout .site-header,
.woocommerce-checkout .site-footer,
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout .woocommerce-NoticeGroup,
.woocommerce-checkout .woocommerce-form-coupon-toggle {
    display: none !important;
}

/* Body bg */
body.woocommerce-checkout { background: var(--gummy-pink-soft) !important; }

/* ---- WRAPPER ---- */
.bynet-checkout-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gummy-text);
}

/* ---- HEADER ---- */
.bynet-checkout-header {
    text-align: center;
    padding: 16px 0 24px;
}
.bynet-logo-img {
    max-height: 50px;
    width: auto;
}
.bynet-logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--gummy-pink);
}

/* ---- PROGRESS BAR ---- */
.bynet-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto 36px;
    position: relative;
    padding: 0 20px;
}
.bynet-progress-line {
    position: absolute;
    top: 22px;
    left: 60px;
    right: 60px;
    height: 3px;
    background: #e8e8e8;
    border-radius: 3px;
    z-index: 0;
}
.bynet-progress-line-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gummy-pink), var(--gummy-pink-hover));
    border-radius: 3px;
    width: 0%;
    transition: width 0.4s ease;
}
.bynet-progress-step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 0 0 auto;
}
.bynet-progress-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #aaa;
    margin: 0 auto 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.bynet-progress-step.active .bynet-progress-circle {
    background: var(--gummy-pink);
    border-color: var(--gummy-pink);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(229,24,126,0.3);
}
.bynet-progress-step.completed .bynet-progress-circle {
    background: var(--gummy-pink);
    border-color: var(--gummy-pink);
    color: #fff;
}
.bynet-progress-step.completed .bynet-progress-circle::after {
    content: "✓";
    position: absolute;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}
.bynet-progress-step.completed .bynet-progress-circle {
    text-indent: -9999px;
}
.bynet-progress-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gummy-gray);
    transition: color 0.3s ease;
}
.bynet-progress-step.active .bynet-progress-label,
.bynet-progress-step.completed .bynet-progress-label {
    color: var(--gummy-dark);
}

/* ---- 2-COLUMN GRID ---- */
.bynet-checkout-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .bynet-checkout-grid { grid-template-columns: 1fr; gap: 20px; }
    .bynet-checkout-summary-col { order: -1; }
}

.bynet-checkout-form-col {
    background: #fff;
    border-radius: var(--gummy-radius-lg);
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.bynet-checkout-summary-col {
    position: sticky;
    top: 20px;
}

/* ---- ORDER SUMMARY ---- */
.bynet-summary-toggle {
    display: none;
    background: var(--gummy-pink-light);
    padding: 14px 20px;
    border-radius: var(--gummy-radius);
    cursor: pointer;
    margin-bottom: 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(229,24,126,0.08);
}
.summary-toggle-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gummy-pink);
    font-weight: 600;
}
.summary-toggle-icon { font-size: 10px; color: var(--gummy-pink); transition: transform 0.3s; }
.summary-toggle-icon.rotated { transform: rotate(180deg); }
.summary-toggle-total { font-size: 18px; font-weight: 800; color: var(--gummy-dark); margin-left: auto; }

@media (max-width: 900px) {
    .bynet-summary-toggle { display: flex; }
    .bynet-checkout-summary-col { display: none; }
    .bynet-checkout-summary-col.open { display: block; }
}

.bynet-order-summary {
    background: #fff;
    border-radius: var(--gummy-radius-lg);
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.summary-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 18px;
    color: var(--gummy-dark);
    padding-bottom: 14px;
    border-bottom: 2px solid var(--gummy-pink-light);
}
.summary-title svg { color: var(--gummy-pink); }

/* Items */
.summary-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.summary-item:last-child { border-bottom: none; }

.summary-item-thumb {
    position: relative;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}
.summary-item-thumb img,
.summary-item-thumb .summary-item-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--gummy-border);
    background: var(--gummy-bg-light);
}
.summary-item-qty {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--gummy-pink);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(229,24,126,0.4);
}

.summary-item-info { flex: 1; min-width: 0; }
.summary-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gummy-dark);
    display: block;
    line-height: 1.4;
}
.summary-item-variant {
    font-size: 12px;
    color: var(--gummy-gray);
    display: block;
    margin-top: 2px;
}
.summary-item-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--gummy-dark);
    white-space: nowrap;
}

/* Totals */
.summary-totals {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid var(--gummy-pink-light);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: var(--gummy-gray);
}
.summary-savings {
    background: var(--gummy-green-light);
    color: var(--gummy-green) !important;
    padding: 10px 14px !important;
    border-radius: 8px;
    margin: 6px 0;
    font-weight: 600;
}
.summary-savings span:last-child { color: var(--gummy-green) !important; font-weight: 800; }
.summary-total {
    padding-top: 14px;
    margin-top: 8px;
    border-top: 1px solid #f0f0f0;
    font-size: 20px;
    font-weight: 800;
    color: var(--gummy-dark);
}
.summary-total span:first-child { color: var(--gummy-dark); }
.total-currency small {
    font-size: 12px;
    font-weight: 500;
    color: var(--gummy-gray);
    margin-right: 6px;
}

/* ---- FORM SECTIONS ---- */
.step-section { margin-bottom: 32px; }
.step-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gummy-dark);
    margin: 0 0 18px;
}
.step-section-title svg { color: var(--gummy-pink); flex-shrink: 0; }
.step-section-desc {
    font-size: 13px;
    color: var(--gummy-gray);
    margin: -8px 0 16px;
}

/* ---- FORM FIELDS ---- */
.bynet-checkout-form .form-row { margin-bottom: 12px; padding: 0; }
.bynet-checkout-form .form-row label { display: none; }

.bynet-checkout-form .form-row input[type="text"],
.bynet-checkout-form .form-row input[type="email"],
.bynet-checkout-form .form-row input[type="tel"],
.bynet-checkout-form .form-row select,
.bynet-checkout-form .form-row .select2-container .select2-selection {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid var(--gummy-border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--gummy-text);
    background: #fff;
    transition: all 0.2s;
    box-sizing: border-box;
    height: auto;
    line-height: 1.4;
}
.bynet-checkout-form .form-row input:focus,
.bynet-checkout-form .form-row select:focus {
    border-color: var(--gummy-pink);
    outline: none;
    box-shadow: 0 0 0 3px rgba(229,24,126,0.12);
}
.bynet-checkout-form .form-row input::placeholder { color: #aaa; }

.bynet-field-full { width: 100% !important; float: none !important; }
.bynet-field-half { width: 48.5% !important; }
.bynet-field-70 { width: 68% !important; }
.bynet-field-30 { width: 30% !important; }

.bynet-field-row {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
}
.bynet-field-row .form-row { flex: 1; }

/* ---- REVIEW SECTION ---- */
.step-review {
    border: 1.5px solid var(--gummy-border);
    border-radius: 12px;
    margin-bottom: 28px;
    overflow: hidden;
    background: var(--gummy-bg-light);
}
.review-row {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    font-size: 14px;
    border-bottom: 1px solid var(--gummy-border);
}
.review-row:last-child { border-bottom: none; }
.review-label {
    color: var(--gummy-gray);
    width: 90px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
}
.review-value {
    flex: 1;
    color: var(--gummy-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.review-change {
    color: var(--gummy-pink);
    text-decoration: underline;
    font-size: 13px;
    margin-left: 12px;
    flex-shrink: 0;
    font-weight: 600;
}

/* ---- SHIPPING OPTIONS ---- */
.bynet-shipping-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border: 2px solid var(--gummy-border);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.2s;
    position: relative;
}
.bynet-shipping-option:hover {
    border-color: var(--gummy-pink);
    background: var(--gummy-pink-soft);
}
.bynet-shipping-option.selected {
    border-color: var(--gummy-pink);
    background: var(--gummy-pink-soft);
    box-shadow: 0 4px 16px rgba(229,24,126,0.12);
}
.bynet-shipping-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.shipping-radio-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--gummy-border);
    background: #fff;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}
.bynet-shipping-option.selected .shipping-radio-circle,
.bynet-payment-method.selected .shipping-radio-circle,
.bynet-billing-option.selected .shipping-radio-circle {
    border-color: var(--gummy-pink);
}
.bynet-shipping-option.selected .shipping-radio-circle::after,
.bynet-payment-method.selected .shipping-radio-circle::after,
.bynet-billing-option.selected .shipping-radio-circle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gummy-pink);
}

.shipping-info-block { flex: 1; min-width: 0; }
.shipping-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--gummy-dark);
    display: block;
    margin-bottom: 4px;
}
.shipping-detail {
    color: var(--gummy-gray);
    font-size: 13px;
}
.shipping-detail strong { color: var(--gummy-dark); }
.shipping-price {
    font-weight: 800;
    font-size: 16px;
    color: var(--gummy-dark);
    white-space: nowrap;
}
.shipping-price.free {
    color: var(--gummy-green);
    text-transform: uppercase;
    font-size: 14px;
}

/* ---- PAYMENT METHOD ---- */
.bynet-payment-method {
    border: 2px solid var(--gummy-border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s;
}
.bynet-payment-method.selected {
    border-color: var(--gummy-pink);
    box-shadow: 0 4px 16px rgba(229,24,126,0.12);
}
.payment-radio {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: var(--gummy-pink-soft);
    cursor: pointer;
}
.payment-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.payment-radio label {
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    flex: 1;
    color: var(--gummy-dark);
}
.payment-icon { height: 26px; width: auto; }
.payment-info {
    padding: 16px 20px;
    background: var(--gummy-bg-light);
    font-size: 13px;
    color: var(--gummy-gray);
    line-height: 1.5;
    border-top: 1px solid var(--gummy-border);
}
.payment-info p { margin: 0; }

/* ---- BILLING OPTION ---- */
.bynet-billing-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: 2px solid var(--gummy-pink);
    border-radius: 12px;
    background: var(--gummy-pink-soft);
    cursor: pointer;
}
.bynet-billing-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.bynet-billing-option label {
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    color: var(--gummy-dark);
}

/* ---- BUTTONS ---- */
.bynet-btn {
    display: inline-block;
    padding: 18px 32px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    width: 100%;
    font-family: inherit;
}
.bynet-btn:active { transform: scale(0.98); }

.bynet-btn-next,
.bynet-btn-pay {
    background: var(--gummy-pink);
    color: #fff;
    box-shadow: 0 6px 20px rgba(229,24,126,0.3);
}
.bynet-btn-next:hover,
.bynet-btn-pay:hover {
    background: var(--gummy-pink-hover);
    box-shadow: 0 8px 24px rgba(229,24,126,0.4);
    transform: translateY(-2px);
}

.step-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    gap: 16px;
}
.step-buttons .bynet-btn { flex: 1; }
.bynet-back-link {
    color: var(--gummy-gray);
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
    flex-shrink: 0;
}
.bynet-back-link:hover { color: var(--gummy-pink); text-decoration: underline; }

/* ---- TRUST FOOTER ---- */
.bynet-trust-footer {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 16px;
    padding: 24px 16px;
    margin-top: 32px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gummy-gray);
    font-weight: 600;
}
.trust-icon { font-size: 18px; }

/* ---- VALIDATION ---- */
.bynet-field-error input,
.bynet-field-error select { border-color: #e53e3e !important; }
.bynet-error-msg { color: #e53e3e; font-size: 12px; margin-top: 4px; }

.woocommerce-error,
.woocommerce-message {
    max-width: 1200px;
    margin: 10px auto !important;
    border-radius: 12px;
}

/* ---- STEP TRANSITIONS ---- */
.bynet-step {
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================
   PIX PAYMENT PAGE
   ============================ */
.bynet-pix-payment {
    max-width: 540px;
    margin: 0 auto;
    padding: 32px 20px;
    text-align: center;
    background: #fff;
    border-radius: var(--gummy-radius-lg);
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.pix-header { margin-bottom: 28px; }
.pix-icon-circle {
    width: 72px;
    height: 72px;
    background: var(--gummy-pink-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.pix-icon-img { width: 36px; height: 36px; }
.pix-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--gummy-dark);
    margin: 0 0 8px;
}
.pix-subtitle { color: var(--gummy-gray); font-size: 14px; margin: 0; }

.pix-amount {
    background: var(--gummy-pink-light);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}
.pix-amount-label { font-size: 14px; color: var(--gummy-gray); }
.pix-amount-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--gummy-pink);
    display: block;
    margin-top: 4px;
}

.pix-qrcode-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}
.pix-qrcode {
    background: #fff;
    padding: 16px;
    border: 2px solid var(--gummy-border);
    border-radius: 14px;
    display: inline-block;
}
.pix-qrcode canvas, .pix-qrcode img { display: block; }

.pix-copy-section { margin-bottom: 24px; text-align: left; }
.pix-copy-label { font-size: 13px; color: var(--gummy-gray); display: block; margin-bottom: 8px; font-weight: 600; }
.pix-copy-row { display: flex; gap: 8px; }
.pix-copy-input {
    flex: 1;
    padding: 14px 16px;
    border: 1.5px solid var(--gummy-border);
    border-radius: 12px;
    font-size: 13px;
    color: var(--gummy-text);
    background: var(--gummy-bg-light);
    overflow: hidden;
    text-overflow: ellipsis;
}
.pix-copy-btn {
    padding: 14px 24px;
    background: var(--gummy-pink);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.pix-copy-btn:hover { background: var(--gummy-pink-hover); }
.pix-copy-feedback { font-size: 12px; color: var(--gummy-green); display: block; margin-top: 6px; min-height: 18px; font-weight: 600; }

.pix-status { margin-bottom: 24px; }
.pix-status-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: #fff8e1;
    border-radius: 12px;
    color: #b8860b;
    font-weight: 600;
}
.pix-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--gummy-pink);
    border-radius: 50%;
    animation: pixSpin 1s linear infinite;
}
@keyframes pixSpin { to { transform: rotate(360deg); } }
.pix-status-confirmed {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--gummy-green-light);
    border-radius: 12px;
    color: var(--gummy-green);
    font-weight: 700;
}
.pix-success-icon {
    width: 40px;
    height: 40px;
    background: var(--gummy-green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}
.bynet-pix-success { text-align: center; padding: 40px 20px; }
.bynet-pix-success h2 { color: var(--gummy-green); margin-top: 16px; }

.pix-instructions {
    text-align: left;
    background: var(--gummy-bg-light);
    padding: 22px;
    border-radius: 12px;
    border: 1px solid var(--gummy-border);
}
.pix-instructions h4 { margin: 0 0 14px; font-size: 15px; color: var(--gummy-dark); font-weight: 700; }
.pix-instructions ol { margin: 0; padding-left: 22px; }
.pix-instructions li { padding: 4px 0; font-size: 14px; color: var(--gummy-text); }
.pix-expire-note { margin: 14px 0 0; font-size: 12px; color: var(--gummy-gray); font-style: italic; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .bynet-checkout-wrapper { padding: 12px; }
    .bynet-checkout-form-col { padding: 20px; }
    .bynet-progress { padding: 0 10px; }
    .bynet-progress-line { left: 50px; right: 50px; }
    .bynet-progress-circle { width: 40px; height: 40px; font-size: 14px; }
    .bynet-progress-label { font-size: 11px; }
}

@media (max-width: 768px) {
    .bynet-field-row { flex-direction: column; gap: 0; }
    .bynet-field-half, .bynet-field-70, .bynet-field-30 { width: 100% !important; }
    .step-buttons { flex-direction: column-reverse; gap: 12px; }
    .bynet-back-link { text-align: center; width: 100%; }
    .review-row { flex-wrap: wrap; }
    .review-value { white-space: normal; }
    .step-section-title { font-size: 16px; }
    .bynet-trust-footer { gap: 10px; }
    .trust-badge { font-size: 11px; }
}
