/* ==========================================================================
   CHECKOUT SEGURO — ESTILO PAYT (CICATRIBEM)
   Design Fixo Sem Overflow Horizontal & Layout de Alta Conversão
   ========================================================================== */

:root {
    --primary: #16a34a;
    --primary-hover: #15803d;
    --primary-light: rgba(22, 163, 74, 0.08);
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-focus: #16a34a;
    --radius-card: 12px;
    --radius-input: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    box-sizing: border-box;
    overflow-x: hidden !important;
    width: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    position: relative;
    padding-bottom: 60px;
}

/* 1. HEADER ESTILO PAYT (Totalmente responsivo e sem vazamento lateral) */
.payt-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.payt-header-wrap {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.payt-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.payt-logo-text {
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #0f172a;
}

.payt-support {
    font-size: 12px;
    color: var(--text-muted);
}

.payt-security .security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #15803d;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .payt-header {
        padding: 10px 14px;
    }
    .payt-header-wrap {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
    }
    .payt-brand {
        flex-direction: column;
        gap: 2px;
        align-items: center;
    }
    .payt-logo-text {
        font-size: 18px;
    }
    .payt-support {
        font-size: 11px;
    }
    .payt-security .security-badge {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* 2. URGENCY BAR */
.payt-urgency-bar {
    background-color: #000000;
    color: #ffffff;
    text-align: center;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.payt-urgency-bar span {
    color: #ffffff;
}

.payt-urgency-bar .urgency-icon {
    font-size: 15px;
    color: #ffd700;
}

.payt-urgency-bar strong {
    color: #ffffff;
    font-weight: 800;
    font-family: monospace, sans-serif;
    font-size: 14px;
    letter-spacing: 0.06em;
}

@media (max-width: 520px) {
    .payt-urgency-bar {
        font-size: 11px;
        padding: 8px 10px;
        gap: 6px;
    }
    .payt-urgency-bar strong {
        font-size: 12px;
    }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* 3. LAYOUT CONTAINER (Zero overflow horizontal) */
.payt-container {
    max-width: 1140px;
    margin: 24px auto 0;
    padding: 0 16px;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.payt-layout {
    display: grid;
    grid-template-columns: 1fr 390px;
    gap: 28px;
    align-items: start;
    width: 100%;
}

@media (max-width: 960px) {
    .payt-container {
        margin-top: 14px;
        padding: 0 12px;
    }
    .payt-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }
    .payt-summary-col {
        order: 1; /* Resumo do Kit selecionado no topo para clareza */
        width: 100%;
    }
    .payt-form-col {
        order: 2; /* Etapas do formulário logo abaixo */
        width: 100%;
    }
}

/* 4. CARDS DE ETAPA */
.payt-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
    overflow: hidden;
    width: 100%;
}

.payt-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    background-color: #fafbfc;
}

.step-num {
    width: 26px;
    height: 26px;
    background-color: #0f172a;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.payt-card-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.payt-card-body {
    padding: 18px;
    width: 100%;
}

/* 5. FORMULÁRIOS & INPUTS */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    width: 100%;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

@media (max-width: 540px) {
    .form-row:not(.form-row-keep) {
        flex-direction: column;
        gap: 14px;
    }
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }

label {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    font-size: 14px;
    color: #0f172a;
    background-color: #ffffff;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
    max-width: 100%;
}

input::placeholder {
    color: #94a3b8;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.field-error {
    color: #dc2626;
    font-size: 12px;
    display: none;
    margin-top: 2px;
}

.cep-wrap {
    position: relative;
    width: 100%;
}

.cep-loading {
    position: absolute;
    right: 12px;
    top: 13px;
    font-size: 12px;
    color: var(--primary);
    display: none;
}

.cep-search-link {
    font-size: 12px;
    color: #2563eb;
    text-decoration: underline;
    margin-top: auto;
    margin-bottom: 12px;
    display: inline-block;
}

.shipping-info-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #f0fdf4;
    border: 1px dashed #86efac;
    padding: 12px 14px;
    border-radius: 8px;
    margin-top: 14px;
    width: 100%;
}

.shipping-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.shipping-text strong {
    display: block;
    font-size: 13px;
    color: #166534;
}

.shipping-text span {
    font-size: 12px;
    color: #15803d;
}

/* 6. ABAS DE PAGAMENTO */
.payt-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    width: 100%;
}

.payt-tab {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background-color: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-input);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    text-align: left;
    outline: none;
}

.payt-tab.active {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.tab-icon {
    color: #64748b;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.payt-tab.active .tab-icon {
    color: var(--primary);
}

.tab-label strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
}

.tab-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.tab-pill {
    position: absolute;
    top: -9px;
    right: 8px;
    background-color: #16a34a;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

@media (max-width: 440px) {
    .payt-tabs {
        flex-direction: column;
        gap: 10px;
    }
    .payt-tab {
        padding: 10px 12px;
    }
}

/* Painel PIX */
.pix-info-card {
    background-color: #fafbfc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    width: 100%;
}

.pix-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.pix-badge-icon {
    font-size: 18px;
}

.pix-info-header h4 {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.pix-info-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pix-info-card li {
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}

/* Painel Cartão */
.card-flags {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    width: 100%;
}

.flag-icon {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: #94a3b8;
    background: #ffffff;
    opacity: 0.45;
    transition: all 0.2s;
}

/* 7. BOTÃO DE AÇÃO NO RODAPÉ (Após preencher todas as etapas) */
.payt-action-footer {
    margin-top: 4px;
    margin-bottom: 24px;
    width: 100%;
}

.payt-submit-btn {
    width: 100%;
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    padding: 18px 20px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    outline: none;
}

.payt-submit-btn:hover {
    background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.5);
    transform: translateY(-1px);
}

.payt-submit-btn:active {
    transform: translateY(1px);
}

.payt-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.payt-submit-btn .btn-text {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.payt-submit-btn .btn-subtext {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.9;
}

/* 8. SELOS DE CONFIANÇA */
.trust-seals {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px;
    background-color: #fafbfc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 100%;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

@media (max-width: 460px) {
    .trust-seals {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }
}

/* 9. COLUNA DE RESUMO DO PEDIDO */
.payt-summary-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    position: sticky;
    top: 20px;
    width: 100%;
}

.summary-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    background-color: #fafbfc;
}

.summary-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.summary-product {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.prod-img {
    width: 76px;
    height: 76px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prod-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prod-info {
    flex: 1;
    min-width: 0;
}

.prod-badge {
    display: inline-block;
    background-color: #fee2e2;
    color: #dc2626;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.prod-info h4 {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 4px;
}

.prod-sub {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
    margin-bottom: 4px;
}

.prod-qty {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.summary-details {
    padding: 16px;
    width: 100%;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.text-green {
    color: #16a34a;
    font-weight: 700;
}

.summary-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 12px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.summary-total span {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.total-amount {
    display: flex;
    align-items: baseline;
    gap: 3px;
    color: #16a34a;
}

.total-amount .currency {
    font-size: 14px;
    font-weight: 700;
}

.total-amount .val {
    font-size: 22px;
    font-weight: 900;
}

.summary-inst {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 0;
}

/* 10. MODAL PIX ESTILO PAYT */
.payt-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
}

.payt-modal-content {
    background-color: #ffffff;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    padding: 28px 24px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 26px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.modal-header {
    text-align: center;
    margin-bottom: 16px;
}

.pix-modal-icon {
    font-size: 28px;
    display: inline-block;
    margin-bottom: 6px;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 4px;
}

.modal-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.pix-qr-container {
    background: #ffffff;
    border: 2px dashed #bbf7d0;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 14px auto;
    width: 220px;
    height: 220px;
}

.pix-amount-pill {
    text-align: center;
    font-size: 15px;
    color: #0f172a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 8px 16px;
    border-radius: 20px;
    margin: 12px auto;
    display: inline-block;
    width: 100%;
}

.pix-amount-pill strong {
    color: #16a34a;
    font-size: 18px;
}

.pix-copy-section {
    margin: 16px 0;
    width: 100%;
}

.pix-copy-section label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}

.copy-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.copy-input-group input {
    font-family: monospace;
    font-size: 12px;
    background: #f8fafc;
    flex: 1;
}

.copy-input-group button {
    background: #16a34a;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-input);
    padding: 0 16px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.copy-input-group button:hover {
    background: #15803d;
}

.copy-feedback {
    display: none;
    font-size: 12px;
    color: #16a34a;
    font-weight: 600;
    margin-top: 4px;
}

.pix-timer-alert {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    font-size: 12px;
    color: #991b1b;
    margin: 14px 0;
}

.pix-timer-alert strong {
    font-family: monospace;
    font-size: 14px;
}

.pix-instructions {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #475569;
}

.pix-instructions ol {
    margin-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pix-status-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    font-size: 12px;
    color: #166534;
    background: #f0fdf4;
    border-radius: 8px;
}

.pulse-ring {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #22c55e;
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
