/* Checkout Modal Overlay */
.checkout-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--tk-bg);
    z-index: 200;
    display: none;
    flex-direction: column;
}

.checkout-modal-overlay.active {
    display: flex;
}

.checkout-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: var(--tk-white);
}

.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--tk-divider);
    background: var(--tk-white);
}

.checkout-header h2 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.checkout-header i {
    font-size: 20px;
    cursor: pointer;
}

.checkout-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    position: relative;
}

.checkout-product-summary {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.checkout-product-summary img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--tk-divider);
}

.checkout-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.checkout-product-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--tk-black);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.1;
}

.checkout-product-option {
    font-size: 10px;
    color: var(--tk-gray-medium);
    margin-top: 1px;
}

.checkout-product-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.checkout-product-price .price-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--tk-red);
}

.checkout-product-price .qty-val {
    font-size: 11px;
    color: var(--tk-gray-medium);
}

.checkout-form-section {
    margin-top: 16px;
}

.checkout-form-section h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.form-subtitle {
    font-size: 13px;
    color: var(--tk-gray-medium);
    margin-bottom: 16px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group-flex {
    display: flex;
    gap: 12px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--tk-black);
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--tk-divider);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--tk-red);
}

.checkout-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 600;
}

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

.generate-pix-btn {
    width: 100%;
    background: var(--tk-red);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.generate-pix-btn:hover {
    background: #e6284d;
}

/* Pix Area */
.checkout-pix-area {
    text-align: center;
    padding: 20px 0;
}

.pix-success-header {
    margin-bottom: 16px;
}

.pix-success-header i {
    font-size: 36px;
    color: #00b900;
    margin-bottom: 8px;
}

.pix-success-header h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.pix-success-header p {
    font-size: 13px;
    color: var(--tk-gray-medium);
}

.pix-qr-container {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    border: 1px solid var(--tk-divider);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pix-qr-container img {
    max-width: 100%;
    max-height: 100%;
}

.pix-timer {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tk-red);
}

.pix-copy-section {
    margin-top: 16px;
    text-align: left;
}

.pix-copy-section label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
}

.pix-copy-section textarea {
    width: 100%;
    height: 45px;
    padding: 8px;
    border: 1px solid var(--tk-divider);
    border-radius: 8px;
    font-size: 11px;
    resize: none;
    outline: none;
    background: #f8f8f8;
    color: #333;
    word-break: break-all;
}

.copy-pix-btn {
    width: 100%;
    background: var(--tk-black);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--tk-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
}

/* Order Bump Styles */
.bump-modal-content {
    background: #f8f8f8;
}

.bump-scroll-area {
    padding: 16px;
    background: #f8f8f8;
}

.bump-subtitle {
    font-size: 14px;
    color: var(--tk-black);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
}

.bump-card {
    display: flex;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.bump-card.selected {
    border-color: var(--tk-red);
    background-color: #fffafb;
}

.bump-img-container {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 12px;
    background: #eee;
}

.bump-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bump-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bump-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tk-black);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.bump-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bump-old-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.bump-new-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--tk-red);
}

.bump-add-btn {
    background: #f0f0f0;
    color: var(--tk-black);
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
}

.bump-card.selected .bump-add-btn {
    background: var(--tk-red);
    color: #fff;
}

.bump-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 16px;
    border-top: 1px solid var(--tk-divider);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.bump-continue-btn {
    background: var(--tk-red);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    width: 100%;
}

.bump-skip {
    text-align: center;
    font-size: 13px;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    padding: 8px 0;
}

/* ==========================================
   Responsividade Mobile (Premium Viewport)
   ========================================== */
@media (max-width: 480px) {
    .checkout-modal-content {
        padding: 0;
    }
    
    .checkout-scroll-area {
        padding: 12px;
    }
    
    /* Converte os layouts de endereço flex inline para bloco vertical no celular */
    .input-group-flex,
    .input-group[style*="display: flex"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .input-group-flex > div,
    .input-group[style*="display: flex"] > div {
        width: 100% !important;
        flex: none !important;
    }
    
    .input-group-flex > div[style*="width"],
    .input-group[style*="display: flex"] > div[style*="width"] {
        width: 100% !important;
        flex: none !important;
    }

    /* Ajuste fino das margens dos inputs */
    .input-group {
        margin-bottom: 12px;
    }

    .input-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .input-group input {
        padding: 10px;
        font-size: 13px;
        border-radius: 6px;
    }

    /* Cards do Order Bump no Mobile */
    .bump-card {
        padding: 10px;
        margin-bottom: 12px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .bump-img-container {
        width: 65px;
        height: 65px;
        margin-right: 4px;
        border-radius: 4px;
    }

    .bump-title {
        font-size: 12px;
        line-height: 1.2;
        margin-bottom: 4px;
    }

    .bump-price-row {
        gap: 6px;
        margin-bottom: 4px;
    }

    .bump-new-price {
        font-size: 13px;
    }

    .bump-old-price {
        font-size: 11px;
    }

    .bump-add-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Ajuste da barra inferior de ação do Order Bump */
    .bump-bottom-bar {
        position: relative !important;
        box-shadow: none !important;
        border-top: none !important;
        padding: 12px 0 0 0;
        gap: 8px;
    }

    .bump-continue-btn {
        padding: 12px;
        font-size: 14px;
    }

    .bump-skip {
        font-size: 12px;
        padding: 4px 0;
    }

    /* Resumo do Produto no Checkout */
    .checkout-product-summary {
        gap: 8px;
        padding-bottom: 8px;
    }

    .checkout-product-summary img {
        width: 44px;
        height: 44px;
    }

    .checkout-product-title {
        font-size: 12px;
    }

    .checkout-total-row {
        margin-top: 16px;
        margin-bottom: 16px;
        font-size: 14px;
    }

    .checkout-total-row .total-price {
        font-size: 18px;
    }

    /* Área do Pix */
    .checkout-pix-area {
        padding: 10px 0;
    }

    .pix-success-header {
        margin-bottom: 10px;
    }

    .pix-success-header i {
        font-size: 28px;
        margin-bottom: 4px;
    }

    .pix-success-header h3 {
        font-size: 15px;
        margin-bottom: 2px;
    }

    .pix-success-header p {
        font-size: 12px;
    }

    .pix-qr-container {
        width: 120px;
        height: 120px;
        padding: 5px;
        border-radius: 8px;
    }

    .pix-timer {
        font-size: 11px;
        margin-top: 8px;
    }

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

    .pix-copy-section label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .pix-copy-section textarea {
        height: 38px;
        font-size: 10.5px;
        padding: 6px;
    }

    .copy-pix-btn {
        padding: 10px;
        font-size: 13px;
        margin-top: 8px;
        border-radius: 18px;
    }

    #checkoutWarningMessage {
        margin-top: 12px !important;
        padding: 10px 12px !important;
        border-radius: 10px !important;
    }
}
