/* Variáveis globais baseadas no TikTok */
:root {
    --tk-white: #FFFFFF;
    --tk-black: #161823;
    --tk-red: #FE2C55;
    --tk-red-hover: #E62A4D;
    --tk-cyan: #25F4EE;
    --tk-text-secondary: rgba(22, 24, 35, 0.7);
    --tk-text-tertiary: rgba(22, 24, 35, 0.5);
    --tk-border: rgba(22, 24, 35, 0.12);
    --tk-bg-gray: rgba(22, 24, 35, 0.03);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--tk-white);
    color: var(--tk-black);
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

.checkout-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background-color: var(--tk-white);
    position: relative;
    padding-bottom: 90px;
}

/* Header */
.tiktok-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--tk-border);
    position: sticky;
    top: 0;
    background: var(--tk-white);
    z-index: 10;
}

.tiktok-header h1 {
    font-size: 17px;
    font-weight: 600;
    color: var(--tk-black);
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tk-black);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.header-right {
    width: 32px;
    /* balancear o header */
}

/* Content */
.checkout-content {
    padding: 16px 16px;
}

.hidden {
    display: none !important;
}

/* Utilities */
.center-content {
    text-align: center;
    padding: 40px 0;
}

.divider {
    height: 8px;
    background-color: var(--tk-bg-gray);
    margin: 24px -16px;
    /* Para vazar as bordas padding da main */
}

/* Loading state */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--tk-border);
    border-top-color: var(--tk-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Error state */
.error-icon {
    color: var(--tk-red);
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

/* Order Summary */
.summary-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.order-items {
    margin-bottom: 16px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
}

.item-name {
    color: var(--tk-text-secondary);
}

.item-price {
    font-weight: 600;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px dashed var(--tk-border);
    font-size: 16px;
    font-weight: 700;
}

.total-price {
    font-size: 20px;
    color: var(--tk-red);
}

/* Pix Section */
.pix-info-section {
    text-align: center;
}

.pix-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pix-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.pix-subtitle {
    font-size: 14px;
    color: var(--tk-text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.qr-code-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 24px;
    border: 1px solid var(--tk-border);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.qr-code {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.expiration-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(254, 44, 85, 0.08);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--tk-red);
    font-weight: 500;
    margin-bottom: 24px;
}

.expiration-box svg {
    width: 16px;
    height: 16px;
}

.pix-code-box {
    background: var(--tk-bg-gray);
    border: 1px solid var(--tk-border);
    border-radius: 8px;
    padding: 16px;
    position: relative;
}

.pix-hash {
    font-family: monospace;
    font-size: 13px;
    color: var(--tk-text-secondary);
    word-break: break-all;
    text-align: left;
    padding: 8px 0;
}

.pix-hash::after {
    display: none;
}

/* Success state */
.success-icon {
    color: #20D5EC;
    /* Cyan to match TikTok */
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
}

#success-state h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

#success-state p {
    color: var(--tk-text-secondary);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 32px;
}

.mt-4 {
    margin-top: 16px;
}

/* Instructions */
.instructions-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.instruction-steps {
    list-style: none;
}

.instruction-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.step-number {
    width: 24px;
    height: 24px;
    background-color: var(--tk-bg-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-text {
    font-size: 14px;
    color: var(--tk-text-secondary);
    line-height: 1.5;
}

.step-text strong {
    color: var(--tk-black);
    font-weight: 600;
}

/* Bottom Actions */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: var(--tk-white);
    border-top: 1px solid var(--tk-border);
    display: flex;
    justify-content: center;
    z-index: 100;
}

@media (min-width: 481px) {
    .bottom-action-bar {
        max-width: 480px;
        margin: 0 auto;
    }
}

.btn-primary {
    width: 100%;
    background-color: var(--tk-red);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover,
.btn-primary:active {
    background-color: var(--tk-red-hover);
}

/* Toast */
.toast {
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast svg {
    width: 18px;
    height: 18px;
    color: #20D5EC;
}